Last active
August 29, 2015 14:14
-
-
Save davidrapin/e96dfffc8021ed76676c to your computer and use it in GitHub Desktop.
iptables cheat sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show routing (with rule numbers per Chain fortable:"nat") | |
alias routing='sudo iptables -t nat -L -n -v --line-number' | |
# open 80 explicitly | |
# sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT | |
# redirect 80 to 8080 | |
# iptables -t nat -A OUTPUT -o lo -p tcp --dport 80 -j REDIRECT --to-port 8080 | |
# delete a rule (table:"nat", Chain:"OUTPUT" rule:1) | |
# sudo iptables -t nat -D OUTPUT 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment