Take the 2-minute tour ×
Server Fault is a question and answer site for professional 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 77.37.194.100 and 10.1.1.1 respectively. There's server B (77.37.195.255) on the global network.

Another box C is connected to the subnet with IP 10.1.1.15. 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
add comment

1 Answer

up vote 2 down vote accepted

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

route add default gw 10.1.1.1

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 10.0.0.0/8 -o eth0 -j MASQUERADE
share|improve this answer
    
@nambuls: Wow! This magic worked! –  Alex Aug 26 '09 at 12:44
add comment

Your Answer

 
discard

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.