[EMAIL PROTECTED] wrote:
-----Original Message-----
From: Noah [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 25, 2003 9:03 AM
To: [EMAIL PROTECTED]
Subject: port forwarding with IP TABLES - bad argument

$IPTABLES -A PREROUTING -t nat -p tcp -d $EXTIP --dport 10700 
-j DNAT --to
$PORTFWIP:10700
    
<snip>
  
Bad argument `10700'
That command should work, as long as the "$PORTFWIP:10700" is on the same
line as everything else.  Try executing it outside the script:

#iptables -A PREROUTING -t nat -p tcp -d 10.0.0.1 --dport 10700 -j DNAT --to 10.1.1.1:10700
  

I did some google searches for this ("iptables prerouting").  Noah's  command does look ok, but I don't see a lot of people specify a port number in their --to rule.  In other words, if you don't need to change the portnumber, then just specifying a different IP address in --to will send it to that new machine with the same 10700 portnumber.

Like so:
iptables -A PREROUTING -t nat -p tcp -d 10.0.0.1 --dport 10700 -j DNAT --to
10.1.1.1

should also work (again, sans carriage returns).


Reply via email to