Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I have a host A which is connected to a global network and a local subnet. It's IPs are and respectively. There's server B ( on the global network.

Another box C is connected to the subnet with IP How to configure routing so that B is reachable from C?

PS: Global network is ISP's network, server B is a name server and C is a Virtual Box. A and C are Ubuntu.

share|improve this question
up vote 2 down vote accepted

In you virtual machine, add a default route to your A box

route add default gw

Also you'll have to enable ip forwarding and masquerading on the A box : take a look at this article . Anyway the command for that will looks like:

sudo sysctl net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -s -o eth0 -j MASQUERADE
share|improve this answer
@nambuls: Wow! This magic worked! – Alex Aug 26 '09 at 12:44

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.