Mapping port 80 to inner port 8080:
/sbin/iptables -t nat -A PREROUTING -i eth+ -p tcp –dport 80 -j REDIRECT –to-port 8080
Well, I use this trick to avoid firewall blocking.
For binding more HTTP servers on different server implementations:
/sbin/iptables -t nat -A PREROUTING -i eth+ -p tcp -d xxx.xxx.xxx.xxx –dport 80 -j REDIRECT –to-port 8080
8080 is another server implementation’s listening port
# iptables -t nat -A PREROUTING -i eth0 -p tcp -dport 80 -j REDIRECT -to-port 8080
Bad argument `80′
Try `iptables -h’ or ‘iptables –help’ for more information.
The dport and to-port parameters require two dashes on the command line:
e.g.
–dport 80 ….. –to-port 8080
除了Iptables还有其它方案吗?