Check out these articles on webmonkey about setting up a linux based firewall:
Setting Up a Linux Firewall on Your Network http://go.hotwired.com/webmonkey/01/31/index2a.html/20010829
IP Masquerade http://go.hotwired.com/webmonkey/99/30/index3a.html/eg20010829
A Server of Your Own http://go.hotwired.com/webmonkey/99/08/index3a.html/eg20010829
Philip