Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is my current setup (all servers are Ubuntu Server Edition 12.04):

Server 0 has two devices, eth0 and eth1. eth0 is connected to the wall (the internet), and eth1 is connected to a switch. eth1 has the following entry in /etc/network/interfaces:

auto eth1
iface eth1 inet static

Servers 1-4 each have one device, eth0. They are all connected to the switch, and they all obtain their DHCP information from Server 0. eth0 has the following interfaces entry (This is because Servers 1-4 are diskless nodes that ask Server 0 for everything needed to boot):

iface eth0 inet manual

With this configuration, Server 0 is the only server that has access to the internet. How would I go about routing any web request (such as apt-get or HTTP) from Servers 1-4 through Server 0 in order to give Servers 1-4 internet access? This seems like a problem that has been encountered many times, but I cannot for the life of me figure out how to set up the network properly.

The output of route -n is:

Destination    Gateway         Genmask         Flags ... Iface         UG    ... eth0   U     ... eth0   U     ... eth1
share|improve this question

You need to put two things : activating the forwarding (in /etc/sysctl.conf net.ipv4.ip_forward=1) and activate the NAT with iptables (/sbin/iptables -t nat -A POSTROUTING -s -o eth0 -j MASQUERADE). The NAT translate the private network to the external IP, so the internal machines can go on Internet. This line should be applied by your firewall. I don't know which firewall you have, so you must integrate it in your configuration.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.