I am trying to setup routing between 3 subnets using an Ubuntu 12.10 server with 3 NICs. I would like to be able to have all these subnets route between one another as well as be able to access the internet.
The 10.0.2.0 network is connected to the internet. The Netgear router box connected to the Internet has an address of 10.0.2.1.
The three subnets are 10.0.2.0/16, 10.100.0.0/16, and 10.101.0.0/16.
I have tried to setup my /etc/network/interfaces to define both the NICs and the routing but it doesn't seem to be working. I can ping all the NICs on the ubuntu server from any machine on any of the respective subnets but I am not able to ping any systems on different subnets from any of those subnets. Neither can I get out to the internet from the subnets.
# /etc/network/interfaces # The loopback network interface auto lo iface lo inet loopback # The primary network interface # eth0 auto eth0 allow-hotplug eth0 iface eth0 inet static address 10.0.2.154 netmask 255.255.0.0 gateway 10.0.2.1 dns-nameservers 10.0.2.100 126.96.36.199 # eth1 auto eth1 allow-hotplug eth1 iface eth1 inet static address 10.100.0.4 netmask 255.255.0.0 dns-nameservers 10.0.2.100 188.8.131.52 # eth2 auto eth2 allow-hotplug eth2 iface eth2 inet static address 10.101.0.1 netmask 255.255.0.0 dns-nameservers 10.0.2.100 184.108.40.206 up route add -net 10.0.0.0 netmask 255.255.0.0 gw 10.0.2.1 dev eth0 up route add -net 10.100.0.0 netmask 255.255.0.0 gw 10.0.2.154 dev eth0 up route add -net 10.101.0.0 netmask 255.255.0.0 gw 10.0.2.154 dev eth0 up route add -net 10.101.0.0 netmask 255.255.0.0 gw 10.100.0.4 dev eth1 up route add -net 10.0.0.0 netmask 255.255.0.0 gw 10.100.0.4 dev eth1 up route add -net 10.100.0.0 netmask 255.255.0.0 gw 10.101.0.1 dev eth2 up route add -net 10.0.0.0 netmask 255.255.0.0 gw 10.101.0.1 dev eth2
I would love to hear any suggestions as to how I could fix my /etc/network/interfaces file to properly route between these subnets.