RTNETLINK answers: File exists… maybe because assigned a new mac adress

Posted on

Problem :

I got a “RTNETLINK answers: File exists Failed to bring up eth0:1” on “ifup eth0:1”.

I suspect it happens because i assigned a new mac adress in my VM’s network adapter.

Can you tell me how to fix the issue?

My configuration looks like this:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
allow-hotplug eth0
iface eth0 inet static
    address 192.168.1.80
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 192.168.1.1

# Alias being connected to 192.168.10.x Network
auto eth0:1
allow-hotplug eth0:1
iface eth0:1 inet static
    address 192.168.10.83
    netmask 255.255.255.0
    gateway 192.168.10.10
    dns-nameservers 192.168.10.1

Why do I get “RTNETLINK answer: File exists..” suddenly?
I worked with this configuration before without problems.
All i did in the past is to renew the adapters mac adress.

At the moment I am connected to the 192.168.10.x Network and if I do

/etc/init.d/networking stop
/etc/init.d/networking start

then i got “RTNETLINK […] falied to bring up eth0:1”
but the strage thing is that i am able to connect to 192.168.10.83 via ssh from my host machine. But I cannot reach the internet from the debian client.

I hope it is clear what my problem is, now.

update

if i change my /etc/network/interfaces like this then “ifup eth0” fails, too with the same error!

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
allow-hotplug eth0
iface eth0 inet static
    address 192.168.10.83
    netmask 255.255.255.0
    gateway 192.168.10.10
    dns-nameservers 192.168.10.1

with verbose option enabled i got:

Configuring interfache eth0=eth0 (inet) 
run-parts --verbose /etc/network/if-pre-up.d 
ip addr add 192.168.10.83/255.255.255.0 broadcast 192.168.10.255 dev eth0 label eth0   
RTNETLINK answers: File exists Failed to bring up eth0.

same if i type this manually:

ip addr add 192.168.10.83/255.255.255.0 broadcast 192.168.10.255 dev eth0 label eth0

Solution :

Have a look at /etc/udev/rules.d/70-persistent-net.rules

This is mine: (appropriately munged)

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x10de:/sys/devices/pci0000:00/0000:00:0a.0 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="11:22:33:44:55:66", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x168c:/sys/devices/pci0000:00/0000:00:14.0/0000:07:00.0 (ath5k)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="77:88:99:aa:bb:cc", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

I imagine you’ve got an entry for eth0 there, remove the whole line, then stop/start networking, or just reboot. The file should be recreated as the system (re)discovers the network devices.

This file is what maps a network device (by MAC) to a network device NAME. As an example, my “11:22:33:44:55:66” device, is called /dev/eth0.

This is how the system keeps from swapping eth0 and eth1 around each boot, if you were to have multiple NIC’s, or multiple Wifi devices, and so on.

The file next to this one, 70-persistent-cd.rules, does the same for your CD/DVD/BD/laserdisc players, keeping them straight name-wise. (I’d love to see a usb laserdisc unit!)

You have set two default gateways with the same metric.
(https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1043244/comments/8)

Try to delete one gateway line which you don’t want to use.

Also I’m not shure if allow-hotplug eth0:1 is correct. Try to delete it.

Leave a Reply

Your email address will not be published. Required fields are marked *