Bootstrap FreeKB - iptables - drop rule
iptables - drop rule

Updated:   |  iptables articles

The final rule that should be listed in each chain (INPUT, OUTPUT, FORWARD) is the DROP rule, to deny any request that does not match one of the ALLOW rules. It is very important here that the -A or --append option is used so that the DROP rule is appended to the very end of the chain. You would never want to use the -I or --insert option, as this would insert the DROP rule as the very first rule in the chain.

 

iptables -A INPUT -j DROP
iptables -A OUTPUT -j DROP
iptables -A FORWARD -j DROP

 

The -L or --list option can be used to display the rules to ensure the rule was added.

The iptables-save command will need to be used to permanently save iptables.




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 112997 in the box below so that we can be sure you are a human.