From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Zemella Subject: Re: Port forwarding doesn't work. Date: Sun, 12 Oct 2003 23:41:02 +0200 Sender: netfilter-admin@lists.netfilter.org Message-ID: <1065994862.3562.10.camel@Marvin> References: <200310121218.25934.Herman@AerospaceSoftware.com> <200310121411.00898.Herman@AerospaceSoftware.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=-ZF4JmZ5TAhcfit/xx6lx" Return-path: In-Reply-To: <200310121411.00898.Herman@AerospaceSoftware.com> Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: To: Herman@AerospaceSoftware.com Cc: netfilter@lists.netfilter.org --=-ZF4JmZ5TAhcfit/xx6lx Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Herman, did you try something like iptables -t nat -I PREROUTING -d x.x.x.x -j DNAT --to destination y.y.y.y where you can add also protocol,port..... Important is also that the destination machine routes back the packets via the nat machine or you must specify an additional POSTROUTING roule so that it looks for the destination machine that the pakets are originated from the nat machine. Perhaps an example to the PREROUTING roule. iptables -t nat -I POSTROUTING -d y.y.y.y -j SNAT --to-source z.z.z.z then z.z.z.z should be bind to the natting machine. works for iptables 1.2.7a greetings Gerd Am Son, den 12.10.2003 schrieb Herman um 22:11: > Has anybody got me a *working* port forwarding rule please??? > > This thing is driving me nuts, since the rules straight from the manuals don't > work with 1.2.7a or 1.2.9rc1. > > Cheers, --=-ZF4JmZ5TAhcfit/xx6lx Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Hi Herman,

did you try something like

iptables -t nat -I PREROUTING  -d x.x.x.x -j DNAT --to destination y.y.y.y

where you can add also protocol,port.....
Important is also that the destination machine routes back the packets via the nat machine or you must specify an additional POSTROUTING roule so that it looks for the destination machine that the pakets are originated from the nat machine.
Perhaps an example to the PREROUTING roule.

iptables -t nat -I POSTROUTING -d y.y.y.y -j SNAT --to-source z.z.z.z
then z.z.z.z should be bind to the natting machine.

works for iptables 1.2.7a

greetings
Gerd

Am Son, den 12.10.2003 schrieb Herman um 22:11:
Has anybody got me a *working* port forwarding rule please???

This thing is driving me nuts, since the rules straight from the manuals don't 
work with 1.2.7a or 1.2.9rc1.

Cheers,
--=-ZF4JmZ5TAhcfit/xx6lx--