Monthly Archives: October 2007

Port Mapping on Linux

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

Posted in Tricks | 3 Comments