PDA

View Full Version : Easy to remember way to remove iptables rule?



Fli
07-03-2015, 11:17 AM
Hello,

please what is the easy to remember way to delete/remove an IPtables firewall rule via Linux command line?


There is one way, but i cant remember it:

1) list iptables rules
# iptables -L INPUT -n --line-numbers
or
# iptables -L --line-numbers

2) remove rule
# iptables -D INPUT X
(X = line number to remove)

(source (https://www.howtoforge.com/community/threads/drop-all-localhost-8-anywhere.60438/#post-291593))