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

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

1 Answer 1

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.