Linux Netfilter discussions
 help / color / mirror / Atom feed
* static nat with iptables
@ 2004-02-22  7:09 zeinali
  2004-02-22 15:13 ` John Black
  0 siblings, 1 reply; 4+ messages in thread
From: zeinali @ 2004-02-22  7:09 UTC (permalink / raw)
  To: netfilter

[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

Dear sir 

Pls kindly help me

I have a private address like 192.168.20.19/24 and I have a public address
like 213.29.76.153/27 im going to translate (STATIC NAT) my private ip
address to public address (213.29.76.19) with iptables

Meanwhile my router is redhat linux 8.0 and have 2 network adapter like
below

Eth0 192.168.20.1 /24  (connect to private network)

Eth1 213.29.76.154 /27 (connected to internet )

 

Many Thanks&Best Regards

       Behnam Zeinali

         Internet Dept.

     www.maadiran.com <http://www.maadiran.com/> 

 


[-- Attachment #2: Type: text/html, Size: 2986 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: static nat with iptables
  2004-02-22  7:09 zeinali
@ 2004-02-22 15:13 ` John Black
  0 siblings, 0 replies; 4+ messages in thread
From: John Black @ 2004-02-22 15:13 UTC (permalink / raw)
  To: netfilter

[-- Attachment #1: Type: text/plain, Size: 778 bytes --]

is your eth0 ip address a static ip or dynamic?  if it is static try this:

iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED, RELATED -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
iptables -A FORWARD -j LOG


iptables -t nat -A POSTROUTING -s 192.168.20.0/24 -o eth1  -j SNAT --to 213.29.76.153


  Dear sir 

  Pls kindly help me

  I have a private address like 192.168.20.19/24 and I have a public address like 213.29.76.153/27 im going to translate (STATIC NAT) my private ip address to public address (213.29.76.19) with iptables

  Meanwhile my router is redhat linux 8.0 and have 2 network adapter like below

  Eth0 192.168.20.1 /24  (connect to private network)

  Eth1 213.29.76.154 /27 (connected to internet )

   


[-- Attachment #2: Type: text/html, Size: 2964 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: static nat with iptables
       [not found] <FD1B6DC5FFF43C4888DCC155FE8C1FFE9CCAE7@7xch10ka.sevenspace.local>
@ 2004-02-22 20:59 ` Mussie Gebregziabiher
  2004-02-23  4:34   ` John A. Sullivan III
  0 siblings, 1 reply; 4+ messages in thread
From: Mussie Gebregziabiher @ 2004-02-22 20:59 UTC (permalink / raw)
  To: netfilter


Make sure that ip_forwarding is enabled. Not sure if it is enabled by
default. 

cat /etc/sysctl.conf 

# Controls IP packet forwarding
net.ipv4.ip_forward = 1

Good luck!

-MGG

-----Original Message-----
From: netfilter-admin@lists.netfilter.org
[mailto:netfilter-admin@lists.netfilter.org] On Behalf Of John Black
Sent: Sunday, February 22, 2004 10:13 AM
To: netfilter@lists.netfilter.org
Subject: Re: static nat with iptables

is your eth0 ip address a static ip or dynamic?  if it is static try this:
 
iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED, RELATED -j
ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
iptables -A FORWARD -j LOG
 
iptables -t nat -A POSTROUTING -s 192.168.20.0/24 -o eth1  -j SNAT --to
213.29.76.153
 
 
Dear sir 
Pls kindly help me
I have a private address like 192.168.20.19/24 and I have a public address
like 213.29.76.153/27 im going to translate (STATIC NAT) my private ip
address to public address (213.29.76.19) with iptables
Meanwhile my router is redhat linux 8.0 and have 2 network adapter like
below
Eth0 192.168.20.1 /24  (connect to private network)
Eth1 213.29.76.154 /27 (connected to internet )
 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: static nat with iptables
  2004-02-22 20:59 ` static nat with iptables Mussie Gebregziabiher
@ 2004-02-23  4:34   ` John A. Sullivan III
  0 siblings, 0 replies; 4+ messages in thread
From: John A. Sullivan III @ 2004-02-23  4:34 UTC (permalink / raw)
  To: Mussie Gebregziabiher, netfilter

Perhaps I misunderstood the e-mail but is the address to which you are
NATting on the same network as your public interface? I don't think
213.29.76.154/27 and 213.29.76.19/27 are on the same network - John

On Sun, 2004-02-22 at 15:59, Mussie Gebregziabiher wrote:
> Make sure that ip_forwarding is enabled. Not sure if it is enabled by
> default. 
> 
> cat /etc/sysctl.conf 
> 
> # Controls IP packet forwarding
> net.ipv4.ip_forward = 1
> 
> Good luck!
> 
> -MGG
> 
> -----Original Message-----
> From: netfilter-admin@lists.netfilter.org
> [mailto:netfilter-admin@lists.netfilter.org] On Behalf Of John Black
> Sent: Sunday, February 22, 2004 10:13 AM
> To: netfilter@lists.netfilter.org
> Subject: Re: static nat with iptables
> 
> is your eth0 ip address a static ip or dynamic?  if it is static try this:
>  
> iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED, RELATED -j
> ACCEPT
> iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
> iptables -A FORWARD -j LOG
>  
> iptables -t nat -A POSTROUTING -s 192.168.20.0/24 -o eth1  -j SNAT --to
> 213.29.76.153
>  
>  
> Dear sir 
> Pls kindly help me
> I have a private address like 192.168.20.19/24 and I have a public address
> like 213.29.76.153/27 im going to translate (STATIC NAT) my private ip
> address to public address (213.29.76.19) with iptables
> Meanwhile my router is redhat linux 8.0 and have 2 network adapter like
> below
> Eth0 192.168.20.1 /24  (connect to private network)
> Eth1 213.29.76.154 /27 (connected to internet )
>  
-- 
Open Source Development Corporation
Financially Sustainable open source development
http://www.opensourcedevelopmentcorp.com



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-02-23  4:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <FD1B6DC5FFF43C4888DCC155FE8C1FFE9CCAE7@7xch10ka.sevenspace.local>
2004-02-22 20:59 ` static nat with iptables Mussie Gebregziabiher
2004-02-23  4:34   ` John A. Sullivan III
2004-02-22  7:09 zeinali
2004-02-22 15:13 ` John Black

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox