Thursday, June 5, 2014

Set iptables rulesets

Redirecting traffic to different ports - in this caser, redirect standard http requests and https requests to a server which doesn't run as root (all ports < 1000 require root access)

sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8443


To show the new rules, do

iptables -t nat --list

No comments:

Post a Comment