Check this out - probably close to what you want:
http://en.wikipedia.org/wiki/Proxy_server[
^]
A proxy server would have 2 NICs - one for external side (Internet) and one for internal network and allow internal computers to share the same connection to the Internet (only one IP address on the Internet side will be used). The external network will have no idea that there are other computers sharing the same Internet connection (well, this is not entirely true but kind of irrelevant).
You could even find some free source code for it probably if you google a bit...