From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pascal Hambourg Subject: Re: DNAT and local hosts Date: Tue, 08 May 2007 11:03:34 +0200 Message-ID: <46403CE6.5010700@plouf.fr.eu.org> References: <46403616.60103@plouf.fr.eu.org> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <46403616.60103@plouf.fr.eu.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-bounces@lists.netfilter.org Errors-To: netfilter-bounces@lists.netfilter.org Content-Type: text/plain; charset="iso-8859-1"; format="flowed" To: netfilter@lists.netfilter.org Pascal Hambourg a =E9crit : >=20 > 3) NAT or MASQUERADE the source address of the redirected connections,=20 > so the replies from C1 are routed back to the firewall and can be=20 > properly un-DNATed before they reach C2 : >=20 > iptables -t nat POSTROUTING -o eth0 -d 192.168.0.10 \ > -p tcp --dport 1234 -j SNAT --to-source Oops, I forgot "-s 192.168.0.0/24" in order to avoid hiding=20 unnecessarily the source address of external connections to C2. > or : >=20 > iptables -t nat POSTROUTING -o eth0 -d 192.168.0.10 \ > -p tcp --dport 1234 -j MASQUERADE Same here.