11 octobre 2010

Bind socket to interface: No such device

My VM with Ubuntu on it has trouble sometimes dealing with the changes between bridged eth0 and eth1.

The symptom:
SIOCSIFFADDR: No such device
eth0: ERROR while getting interface flags: No such device
Bind socket to interface: No such device
Failed to bring eth0

First check all your network interfaces:
ifconfig -a
You should see that the eth1 interface is actually present (but not connected).

Note the MAC address of eth1. Edit /etc/udev/rules.d/70-persistent-net.rules and change eth1 -> eth0 (the MAC address should be the correct one). You can delete the old line for eth0.

Restart the VM and the network should be OK.