How do i set the default iptables policy on linux?



  • The default policy can only be set on the default iptables chains, INPUT, OUTPUT and FORWARD.

    The policy settings can be either DROP or ACCEPT.

    The policy is when no rule matches, "what should I do now rule?" the last rule when nothing is matched, in the case below is drop the packet on the floor.

    sudo iptables -P FORWARD DROP
    

    The user defined chains always move back to the default rules, so that is why the policy is only set on the default chains.


Log in to reply
 

© Lightnetics 2024