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

5

1

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

steven

Posted 2013-07-11T05:40:46.527

Reputation: 121

How did you do that on Debian? It's Red Hat and its derivatives that use that sort of configuration, not Debian. – Michael Hampton – 2013-07-11T05:56:38.507

i am not shure. Its some months ago. I remember that I deleted a special config file so that on ifup debian was able to create it new. I thought is was the ifcfg-eth* file but its possible that I am wrong. – steven – 2013-07-11T06:01:35.043

@lain sorry, you are right I am a little bit confused. I updated my question and hope it is clearer now – steven – 2013-07-11T07:14:39.790

check here, it may be helpful? http://www.linuxquestions.org/questions/linux-networking-3/rtnetlink-answers-file-exists-542525/

– Angs – 2013-07-18T11:10:07.840

if you type /sbin/ip link show what do you get? Most likely is that @lornix got the answer why it does not work. – Manwe – 2013-07-22T17:58:42.267

Answers

6

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!)

lornix

Posted 2013-07-11T05:40:46.527

Reputation: 9 633

I don't understand how this worked (because the line was re-added again automatically on reboot), but it did. To fix, I commented out the corresponding line, did ifup <device>, then rebooted. – Mike – 2015-02-10T22:12:24.643

thank you very much, I will check it out as far as possible. By the way.. it is possible to accept an answer after the bounty ends? – steven – 2013-07-24T05:29:04.720

1

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.

donothingloop

Posted 2013-07-11T05:40:46.527

Reputation: 363

That's not true. One is 192.168.1.1 and the other is 192.168.10.10. – Mike – 2015-02-10T22:13:42.677