From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Beverley Subject: Re: Redirecting ports with netfilter: unexpected varying results possibly correlated with NAT Date: Sat, 29 Oct 2011 23:22:36 +0100 Message-ID: <1319926956.2993.61.camel@steve-pc> References: <1319669075.26402.6892.camel@andybev-desktop> <1319696663.26402.6931.camel@andybev-desktop> <1319912591.2993.8.camel@steve-pc> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=andybev.com; s=selector1; t=1319926958; bh=HvbgCbZNJuuJaqDJheJ9xTpx7fzP/MY0QhbYIZHD9Ms=; h=Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date: Message-ID:Mime-Version:Content-Transfer-Encoding; b=DYHZ52ztisbL3CkWFxOwlh0BvvC3MLj2bQdhlvD45ojRqc0ZTOisohkglEXfICzLh 5gQXpVJ9WJT+lFErfJjd5nu9p+AIb0WUu75zxliEefEsaIDZARxdMTI0kpB7bJnkGo p9wpphWiOLB36pe0Sp40ovCTQsRKqY+MiVT5qxaE= In-Reply-To: Sender: netfilter-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Jan Engelhardt Cc: Ronald , netfilter@vger.kernel.org On Sat, 2011-10-29 at 21:29 +0200, Jan Engelhardt wrote: > On Saturday 2011-10-29 20:23, Andrew Beverley wrote: > >> I can even add the following > >> line to my server. (This is in the case I use port redirection. Then I > >> use this line to make it an effective security enhancement): > >> > >> iptables -I PREROUTING -t raw -p udp --dport 500 -j DROP > > > >Yes, but the packets originating from the server will not pass through > >the PREROUTING chain. > > > >> Besides, I designed my netfilter configuration to not differentiate > >> between interfaces. I use the addrtype extension, works better. > > > >I like that, but remember that any packets leaving the server will only > >traverse the OUTPUT and POSTROUTING chains. > > This is wrong information. > > Packets very well pass through PREROUTING even when they come from lo. Sorry, I meant locally generated packets leaving the server, in which case I assume that they do not go through POSTROUTING?