TCP port forwarding with linux iptables NAT, PREROUTING and DNAT example
Posted on December 27th, 2007 by linux
Lets say that we would like to do port forwarding from our network interface eth0 on port 23 (telnet) to socket 10.0.0.1:23 (ip address:port):
iptables -t nat -I PREROUTING -p tcp -i eth0 –dport 111 -j DNAT –to 10.0.0.1:23
other example:
to do port forward from eth0 on port 456 to 192.168.0.1:788
iptables -t nat -I PREROUTING -p tcp [...]
Filed under: Administration, Networks, Security | No Comments »