From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John Black" Subject: Re: static nat with iptables Date: Sun, 22 Feb 2004 09:13:06 -0600 Sender: netfilter-admin@lists.netfilter.org Message-ID: <002201c3f956$60983f80$ed02fea9@black> References: <000501c3f912$c70bc230$190da8c0@iomco.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_001F_01C3F924.1512D340" Return-path: Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: To: netfilter@lists.netfilter.org This is a multi-part message in MIME format. ------=_NextPart_000_001F_01C3F924.1512D340 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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=20 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 ) =20 ------=_NextPart_000_001F_01C3F924.1512D340 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
is your eth0 ip address a static ip or=20 dynamic?  if it is static try=20 this:
 
iptables -A FORWARD -i eth1 -o eth0 -m = state=20 --state ESTABLISHED, RELATED -j ACCEPT
iptables -A FORWARD -i eth0 -o = eth1 -j=20 ACCEPT
iptables -A FORWARD -j LOG
 
iptables -t nat -A POSTROUTING -s = 192.168.20.0/24=20 -o eth1  -j SNAT --to 213.29.76.153
 
 

Dear sir =

Pls kindly help=20 me

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

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

Eth0 192.168.20.1 = /24 =20 (connect to private network)

Eth1 213.29.76.154 /27 = (connected=20 to internet )

 

------=_NextPart_000_001F_01C3F924.1512D340--