How do i flush all iptables nat rules on linux?



  • Man page for iptables.

    Check which nat rules you have.

    $ sudo iptables -t nat -L
    Chain PREROUTING (policy ACCEPT)
    target     prot opt source               destination
    
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
    DNAT       tcp  --  anywhere             anywhere             tcp dpt:http to:172.31.23.102:80
    
    Chain POSTROUTING (policy ACCEPT)
    target     prot opt source               destination
    

    Remove all iptables nat rules.

    $ sudo iptables -t nat -F
    

Log in to reply
 

© Lightnetics 2019