Well you can setup Iptables which has already been suggested, or you could turn the system into a firewall. I have a pIII setup with three nic's running Smoothwall-firewall
. After setup it's a headless system, so you don't need a monitor. If you have more than one pc going to be connected to it, you will need a switch (preferred) or hub.
You can do everything you asked about and a lot more, portforwarding, filtering, you can set a time limit on when and how long you want a specific pc to have access to the internet.
I tried version 2.0 it worked fine on a pII but it lacked some of the features in 3.0. But if you use 3.0 you will need at least a pIII. Or should I say I never had any luck installing 3.0 on a PII.
Edit: I should note the reason I have three nics, one will go to my wireless router.