Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

On 12.04, running as a guest in VirtualBox using two adapters, I was getting this error in response to ifup eth1

RTNETLINK answers: File exists
Failed to bring up eth1

This was the contents of /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

# Host-only interface
auto eth1
iface eth1 inet static
        address         192.168.56.20
        netmask         255.255.255.0
        network         192.168.56.0
        broadcast       192.168.56.255
        gateway         192.168.56.1

# NAT interface
auto eth2
iface eth2 inet dhcp

See this question for more about why I configured it this way.
In VirtualBox, how do I set up host-only virtual machines that can access the Internet?

share|improve this question
add comment

1 Answer 1

up vote 11 down vote accepted

The problem was that two default gateways were being set, one static and one by dhcp. You can't have two default gateways with the same metric.

https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1043244/comments/8

The solution: simply remove the gateway line from the configuration of eth1.

Or, add an explicit metric 100 line to eth1, to give the eth1 gateway a lower priority than the eth2 gateway.

share|improve this answer
add comment

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.