Blog is moving

My blog is moving to If you are looking for a specific or older post you are in the right place Otherwise check out my new page for more up to date content.

Wednesday, November 21, 2012

Deleting iptables Rules by Line Number

Looking for a simple way of deleting a specific iptable rule? Well, here it is...

First display all rules by line numbers (this will show a list of the rules by line):
iptables -L INPUT -n --line-numbers
# or/and
iptables -L OUTPUT -n --line-numbers

Then use the line number to delete the rule:
tables -D INPUT 1  # where "1" is the line number or the rule

No comments: