2

I'm running Ubuntu 12.04 Server on VirtualBox. I'm trying to setup two interfaces with static IP addresses. If I only attach one network interface then eth0 works fine, but once I attach my second interface, eth0 doesn't work but eth1 does. I'm doing this because eth0 is my management subnet and eth1 is my admin/employee subnet. Below is how I've configured the /etc/network/interfaces file. Any help would be greatly appreciate. Thanks.

# This file describes the network interfaces available on your system
# and how to active them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 10.192.168.60
netmask 255.255.254.0
gateway 10.192.168.1
network 10.192.168.0
broadcast 10.192.169.255
dns-nameserver 192.168.1.21

# The secondary network interface
auto eth1
iface eth1 inet static
address 192.168.0.11
netmask 255.255.248.0
gateway 192.168.0.1
network 192.168.0.0
broadcast 192.168.7.255
dns-nameserver 192.168.1.21
3
  • 1
    Problem maybe occur because when you bring up eth1 you add again default gw and change routing. If you do not use network on eth0 to route traffic to internet or another lan network you can configure them without gw. Meybe solve problem.
    – 2707974
    Mar 26, 2014 at 13:57
  • yes, you cannot configure two default gateways. Have a look at route and consider what interface should go to external networks, if any. If your eth0 works as intended, you should drop the gateway in eth1. edit: sorry this was meant as comment - not answer
    – benjaminR
    Mar 26, 2014 at 14:20
  • I dropped the gateway from eth1, then restarted the network service. Same issue continues to occur. The odd thing is that when I restarted the network service, it says "failed to bring up eth1" but eth1 is the only one working. Mar 26, 2014 at 14:25

1 Answer 1

0

perhaps a problem with udev settings? First check that both interfaces show up in ifconfig -a and that they are handled correctly by udev:

cat /etc/udev/rules.d/70-persistent-net.rules

(check that mac address eth0 matches udev rule eth0, etc.)

Second, since you're using same nameserver on both NICs, accessible from eth1, perhaps the gateway should be on eth1 and enable forwarding between NICs?

echo 1 > /proc/sys/net/ipv4/ip_forward

Third, since your eth0 has a standard netmask/broadcast, try to leave out rules and let ubuntu figure out routing by only giving necessary info:

auto eth0
iface eth0 inet static
address 10.192.168.60
netmask 255.255.254.0
dns-nameserver 192.168.1.21
2
  • The mac addresses match between eth0 and the udev rule eth0, same with eth1 and udev rule eth1. Finally, I did the forwarding, and changed the suggested info about the netmask, gateway, and broadcast...but the same issue is occuring. Mar 26, 2014 at 15:43
  • strange, I just booted a saucy server with your settings and the NICs come up fine. Just for the record: Do you have both network adapters enabled in virtualbox as 'Host-only Adapter' or 'Internal Network' with a common name, e.g. 'vboxnet0', or do you use NAT or Bridged interfaces to real physical devices on your box?
    – benjaminR
    Mar 27, 2014 at 8:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .