You can use the ‘iptables-persistent’ tool.
To install iptables-persistency pachage:
The you can manipulate the iptables by the ‘iptables’ command.
To save the current iptables rules:
sudo /etc/init.d/iptables-persistent store
It will store the rules for ipv4 and ipv6 in
It will load the rules from these files during booting the system.