Thursday, March 15, 2007

Debian udev and eth0 versus eth2

Lately I've been playing with booting Linux from an USB stick.

One wierd thing I noticed that for some reason in dmesg I see the network interface detected as eth0, but eth0 didn't work.
Today I found out that the actual device is eth2!
Turns out that udev automatically adds mac address based mappings to the file

/etc/udev/rules.d/z25_persistent-net.rules

As I booted the USB stick once before in another laptop, the mac addresses of that machine already got eth0 and eth2, therefor the mac address of the new machine was mapped on eth2.

Just clearing this file and let it be populated again after a fresh boot fixes it.
Alternatively just edit the interface names in this file to match your liking.
Post a Comment