Skip to content

Instantly share code, notes, and snippets.

@chrislaskey
Created January 15, 2013 21:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrislaskey/4542332 to your computer and use it in GitHub Desktop.
Save chrislaskey/4542332 to your computer and use it in GitHub Desktop.
Example generic iptable rules file for forwarding traffic from port 80 to port 8080, used in this case for configuring Jenkins/Hudson to run on port 80. Initial commit is the default iptable rules' output from `iptables-save > /etc/iptables.up.rules` on Ubuntu Server 12.04. The revised commit are the updated rules to forward traffic from port 80…
## Filter Table
*filter
:INPUT ACCEPT [971:197590]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [95:9682]
-A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
-A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
COMMIT
## NAT Table
*nat
-A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
COMMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment