iptables redirect

Luca Ferrari fluca1978 at infinito.it
Fri Dec 21 15:47:20 UTC 2007


Hi,
I'd like to open a port on my firewall to redirect to a testing web server 
machine, thus I'm doing:

$IPTABLES -t nat -I PREROUTING -i $EXT_INTF -p tcp -d $FIREWALL --dport 
9999 -s 0/0   -j DNAT --to $SONY:80 -v
$IPTABLES -I FORWARD -p tcp -i $EXT_INTF  --dport 9999   -d $SONY -j ACCEPT
$IPTABLES -I FORWARD -p tcp -i $EXT_INTF  --dport 80     -d $SONY -j ACCEPT

$SONY is my destination machine, and I'd like to have the connection opened 
from port 9999 on my firewall external interface to sony:80 port, but this is 
not working. If I try to connect I get connection refused.
Any idea?

Thanks,
Luca




More information about the ubuntu-users mailing list