I just installed Ubuntu 10.04 LTS server on a old desktop PC with a dual port network card I would like to use as router for my home network. How do I have to set up the interfaces so that the internet connection is passed through the server?
The first step when configuring Linux as a router is to enable IP forwarding:
Now the OS can route packets between interfaces.
I would suggest that you use a front-end to
If you prefer a GUI then see some of the other helpful answers on this page.
If you would like to hack at the command line and experience the true power of the Force, then try the excellent Shorewall front-end to
The shorewall package is available in the Ubuntu repositories (choose either the shell or Perl package). The Shorewall site has great documentation and helpful tutorials for a multitude of scenarios. The basic 2- or 3- interface examples should get you going.
Personally, I would recommend using a dedicated gateway distro such as ipcop, m0n0wall or an all-in-one system like ClearOS or Untangle. It would simplify the management of the firewall as well as offer you quite a few other features (also, with simplicity built in).