Last active
December 18, 2015 05:59
-
-
Save ppdeassis/5736379 to your computer and use it in GitHub Desktop.
Manipulating rules with iptables
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
# listing chain rules | |
iptables --list CHAIN --line-numbers | |
# deleting a rule | |
iptables --delete CHAIN LINE_NUMBER | |
# inserting a rule in a predefined position (i.e. 3) | |
iptables -I INPUT 2 -p tcp --dport 80 -j ACCEPT | |
# appending rule to chain | |
iptables -A INPUT -p tcp --dport 80 -j ACCEPT | |
# saving rule modifications | |
service iptables save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment