To save your iptables rules on a Ubuntu system you can do the following:
Install package iptables-persistent with sudo apt install iptables-persistent
When you have made new rules later on then you must save this rules with the command: sudo dpkg-reconfigure iptables-persistent