iptables
Apply rules
Use iptables-apply when possible:
_$: iptables-restore < file-with-rules  # Be careful!
_$: iptables-apply   < file-with-rules  # Allows you to go back if you messed up the configuration
In case iptables-apply complains about not finding the /etc/network/iptables file, copy your rules file to that location:
_$: cp file-with-rules /etc/network/iptables
_$: iptables-apply
_$: rm /etc/network/iptables
Save rules
_$: iptables-save > file-with-rules