Port forwarding for Linux iptables

To forward requests ‘coming in on port 80’, to port 8000:

sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000

Then install the following package to make the changes permanent:

sudo apt-get install iptables-persistent

Author | Miles Davenport

Career programmer, who designs, assembles, fixes, and supports customers, software and systems.