From: clister Subject: Re: topic local connections getting natted Date: Wed, 4 Feb 2004 10:00:52 +0100 Sender: netfilter-admin@lists.netfilter.org Message-ID: <200402041000.52086.clister@uah.es> References: <4020892A.6FB4D142@multitech.co.in> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4020892A.6FB4D142@multitech.co.in> Content-Disposition: inline Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="iso-8859-1" To: prabha Cc: immidi_kiran@yahoo.com, netfilter@lists.netfilter.org Hi all I've probed to include -i eth1 on POSTROUTING but it seems to not accept in= put interface specificaction on POSTROUTING=20 chain so i cant separate local packets from forwarded packets by inspecting= that. im going to try marking local packets on FILTER::OUTPUT chain so they get i= gnored on postrouting chaing. What Chain should i use for this NAT::OUTPUT or FILTER::OUTPUT so it's seen= before NAT::POSTROUTING? El Mi=E9rcoles, 4 de Febrero de 2004 06:54, prabha escribi=F3: > Hi > > > 185K 8942K SNAT all -- * eth0 0.0.0.0/0 > > 0.0.0.0/0 > to:1.2.3.4 > > This rule will change the source address of all the packet going out of > the eth0 interface. (Irrespective of whether they are local packets or > forwarded packets) > > >I thought this happened only if you create such rule on NAT::ouput so > > local > > >connections get natted prior to go out of the box. > > The NAT:OUTPUT chain will do a NAT for local packets (ie) packets > generated by the local machine. > > >Should i change this to: > >-t nat -A POSTROUTING -i eth1 -o eth0 -j SNAT --to-destination:1.2.3.4 > > to > > >avoid local packets getting natted? > > Yes, this should work. > > >and last question: > >All packets leaving routing code (local, forwarded) pass througth > >POSTROUTING chain at nat table or only forwarded packets? > > Yes, all the packets will pass through the POSTROUTING chain. > > Prabha