just download one of the firewall distros that have the built in
pfSense (FreeBSD) or IPCop (Linux) are the first 2 to mind. ClarkConnect is another good one though it may have limited functionality without paying, I don't know for sure. But we paid for it at work and it works really well for doing that.