iptables

Complete iptables Shell Scripts

Allow Tomcat to Run as Unpriveledged User But Still Serve Port 80

iptables --table nat --append PREROUTING --protocol tcp --destination-port 80 \
    --in-interface eth0 --jump REDIRECT --to-port 8080

NOTE!The above rule will not redirect local requests, since these bypass the PREROUTING chain. Any browsers or other client software running on the server itself will either have to connect directly to port 8080. In most situations, this will be acceptable.