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)?
Best Answer
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.