Install Squid, a proxy server and set it up as a transparant proxy.
For the sharing, you'll need Samba.
There are lots of tutorials helping you out, most of them are generic. Debian ones are also an option as Ubuntu is based on it.
Or buy a router, those are not that expensive nowadays