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 two Ubuntu 10 Server VMs on VMware Workstation, using bridged networking. I want to route internet traffic to ServerB through ServerA. At the moment, ServerA can access the internet, but not ServerB. Each server can successfully ping the other.

ServerA /etc/network/interfaces (skipping the irrelevant stuff):

# The primary network interface WAN
auto eth0
iface eth0 inet static
    address 192.168.1.134
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1

    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 192.168.1.1
    dns-search mydomain.com

# The secondary network interface LAN
auto eth1
iface eth1 inet static
    address 172.16.96.1
    netmask 255.255.255.0
    network 172.16.96.0
    broadcast 172.16.96.255

Forwarding is enabled in /etc/sysctl.conf

ServerB /etc/network/interfaces (skipping the irrelevant stuff):

# The primary network interface
auto eth0
iface eth0 inet static
    address 172.16.96.34
    netmask 255.255.255.0
    network 172.16.96.0
    broadcast 172.16.96.255
    gateway 172.16.96.1

    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 172.16.96.1
    dns-search mydomain.com

I've cleared out iptables on both machines, so that can be ruled out. Have I messed something up, or am I missing something vital (like a static route)?

share|improve this question
    
Is forwarding actually enabled (have you rebooted since the setting was put in sysctl.conf)? Check with cat /proc/sys/net/ipv4/ip_forward. Also, have you done anything with iptables? –  Shane Madden Nov 3 '11 at 2:33
    
ip_forward is only set on ServerA. Both VMs have been rebooted. INPUT, FORWARD and OUTPUT are set to accept everything in iptables on both VMs. –  jetboy Nov 3 '11 at 2:50

2 Answers 2

A few suggestions,

  • Please see if the traffic from 172.16.96.0/24 goes out of eth0 on Server A.

  • Configure NAT on Server A using iptables for the 172.16.96.0/24 . Currently your traffic might go out from server A but won't get to return back for it takes the 172 network's IP when going out. Doing a NAT might help you here.

share|improve this answer

You don't explicitly say this, but I'm guessing the 172.16.96.* network (eth1 on ServerA and eth0 on ServerB) are set to host-only networking. The 172.16.* class B network is in the non-routable so you need Server A to do NAT on packets coming from ServerB.

In order to help you more, you need to give more specific about what you have tried and what specifically is failing. Is DNS working? Is ping working? Is ping sending packets that are seen outside of A but are not being returned?

share|improve this answer

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.