iptables

    Save current rules

    iptables-save >/etc/iptables/rules.v4
    

    Note: requires package iptables-persistent

    And keep it persistent at reboot, /etc/network/if-pre-up.d/iptables:

    #!/bin/sh
    /sbin/iptables-restore </etc/iptables/rules.v4
    

    chmod +x /etc/network/if-pre-up.d/iptables

    List rules

    iptables -L
    

    Flush everything

    iptables -F
    iptables -X
    iptables -t nat -F
    iptables -t nat -X
    iptables -t mangle -F
    iptables -t mangle -X
    iptables -P INPUT ACCEPT
    iptables -P FORWARD ACCEPT
    iptables -P OUTPUT ACCEPT
    

    source