Skip to content

Instantly share code, notes, and snippets.

@miguel-amaral
Last active September 4, 2018 10:08
Show Gist options
  • Save miguel-amaral/07e500d5e0ba573126063a2d7e44c09f to your computer and use it in GitHub Desktop.
Save miguel-amaral/07e500d5e0ba573126063a2d7e44c09f to your computer and use it in GitHub Desktop.
forward traffic from port 80 to 8080
# flush current rules (might not apply)
#iptables -t nat -L
# 80 -> 8080
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 8080
# 443 -> 8443
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 443 -j REDIRECT --to-port 8443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment