Bootstrap FreeKB - iptables - remove a rule (-D --delete)
iptables - remove a rule (-D --delete)

Updated:   |  iptables articles

Let's say iptables --list-rules command returns the following output. The nice this about this output is that is provides you with the exact format that can be used to delete a rule.

~]# iptables --list-rules
-A INPUT -d 172.17.0.2/32 ! -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT
-P FORWARD DROP
-P OUTPUT ACCEP

 

Here is how you would delete a rule. You simply take the above output and replace -A (append) with -D or --delete.

iptables -D INPUT -d 172.17.0.2/32 ! -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 899411 in the box below so that we can be sure you are a human.