From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pascal Hambourg Subject: Re: Packet disappears after DNAT? Date: Sat, 19 Dec 2015 17:38:31 +0100 Message-ID: <56758807.90402@plouf.fr.eu.org> References: <5662BD03.60004@plouf.fr.eu.org> <56653CCC.6020603@plouf.fr.eu.org> <56706DC5.8010206@plouf.fr.eu.org> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Sender: netfilter-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="iso-8859-1" To: Scott Bronson Cc: netfilter Scott Bronson a =E9crit : >=20 > Good question. Editing mistake. I'm actually forwarding different > ports to different guests depending on port number: >=20 > iptables -t nat -A POSTROUTING -s 192.168.122.10/32 -d > 192.168.122.10/32 -p udp --dport 53 -j MASQUERADE > iptables -t nat -A POSTROUTING -s 192.168.122.10/32 -d > 192.168.122.10/32 -p tcp --dport 53 -j MASQUERADE > iptables -t nat -A POSTROUTING -s 192.168.122.12/32 -d > 192.168.122.12/32 -p tcp --dport 25 -j MASQUERADE I don't think you need a separate rule for each forwarded port. One global rule would do the job, as only forwarded packets would match the source/destination address. iptables -t nat -A POSTROUTING -s 192.168.122.10/32 -d 192.168.122.10/3= 2 -j MASQUERADE