By default Ubuntu/Debian OS wont load iptable on boot.
So to load iptables on boot use follow procedure:
Save iptable conf with iptables-save command:
iptables-save > /etc/iptables.conf
Next, open file with name /etc/network/if-up.d/iptables and add following content:
#!/bin/sh
iptables-restore < /etc/iptables.conf
Change permission file /etc/network/if-up.d/iptables as executable with following command:
chmod +x /etc/network/if-up.d/iptables
Now, iptables will restored on boot.
Whenever you change iptable rules don’t forgot to update iptables.conf file. Use following command to update iptables.conf file:
iptables-save > /etc/iptables.conf