Saving iptables firewall rules

To save iptables firewall rules, run

This will print the firewal rule. You can save it to a file. For example

For IPv6, you can use