0

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)?

jetboy
  • 912
  • 2
  • 11
  • 25
  • 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 03 '11 at 02: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 03 '11 at 02:50

2 Answers2

0

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.

Gaumire
  • 825
  • 6
  • 13
0

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?

kbyrd
  • 3,672
  • 2
  • 24
  • 34