User Tools

Site Tools


tips:linux:iptablesredir

How to redirect a port using iptables?

To redirect port 80 to 8080 use:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

To list the NAT rules use:

iptables -t nat -L
tips/linux/iptablesredir.txt · Last modified: 2009/06/08 15:39 by erik