The generic method is to put your commands in a bash script (firewall.sh say) like this:
Code:
#! /bin/bash
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
make it executable: chmod +x iptables.sh
then add it, with it's whole path if needed, to /etc/rc.local
Many distros have other ways of adding the entries.