iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
其中eth0爲外網網卡名稱linux
iptables命令用法:http://man.linuxde.net/iptablestcp