This site will teach you a lot about masquerading (internet connection sharing).
If you want a real fast solution with minimal firewall rules, visit
this section of the above link. There are working scripts for iptables, ipchains and even ipfwadm. You can pretty much copy them but you need to adjust certain variables as for example $EXTIF, $INTIF, $IPTABLES and so on.
Just read through it once as you copy it and adjust the necessary variables. There are also instructions on how to start your script every time your system boots up.
Good luck!