I'm thinking of running my own Linux (of course) based server and I'm looking for a firewall app that will let me block all but select ports (80, 21, 22, 25, etc.) from all IP addresses. Also, It would be great if that same app could block IP addresses that I specify. It would be aperk if It were f/oss

Thanks!
Distro: TBD, probably homebrew
Arch: i686x64