From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antony Stone Subject: Re: 3 outside networks Date: Mon, 17 Jun 2002 19:22:45 +0100 Sender: netfilter-admin@lists.samba.org Message-ID: <200206171822.g5HIMlA13809@Networker.rockstone.co.uk> References: <3D0DF393.6050203@terra.com.br> <200206171813.g5HIDoA13300@Networker.rockstone.co.uk> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <200206171813.g5HIDoA13300@Networker.rockstone.co.uk> Errors-To: netfilter-admin@lists.samba.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="us-ascii" To: netfilter@lists.samba.org On Monday 17 June 2002 7:13 pm, Antony Stone wrote: > On Monday 17 June 2002 3:34 pm, Srinath Mantripragada wrote: > > I have one inside net 172.16.0.0/24 and 3 outside nets 10.28.0.0/16 , > > 172.18.0.0/24 and Internet. > > The 3 nets are routed by one router that i do not have control. > > > > I have valid internet Addresses and i want to use NAT with one of them > > but not for 10.28 and 172.18 networks. > > > > I guess that i need something like : "-d ! 10.28.0.0/16 OR ! > > 172.18.0.0./24" > > but i dont know how to do that. > > Try this: > > iptables -A POSTROUTING -t nat -d 10.28.0.0/16 -j ACCEPT > iptables -A POSTROUTING -t nat -d 172.18.0.0/24 -j ACCEPT > iptables -A POSTROUTING -t nat -j SNAT --to a.b.c.d Ooops ! That last one should inlcude the interface name too: iptables -A POSTROUTING -t nat -o eth1 -j SNAT --to a.b.c.d Antony.