If you'd prefer to work directly with UNIX, Daniel Cote has published his ipfw configuration file, along with some tips on how to use ipfw in Mac OS X - you can read the article right here.
NOTE: You should really understand exactly what it is you're doing before you going mucking about with the firewall software! For a more simplistic approach, try Brickhouse or any of the hardware routers.

