Tuesday, December 27, 2011

udev[566]: renamed network interface eth0 to eth3

This came up when I moved a disk containing an existing Debian 6.0 installation to a different machine. The original machine had two NICs and at one point I had tried a third. At boot-time, udev looked for the MAC addresses of these three NICs, but didn't find them. Instead, it found a *fourth* (the integral NIC in the new machine). Since it already had MAC addresses registered for eth0, eth1, and eth2, it went on to register the NIC to the next number in line (eth3).

Now, in my case, this is not really desirable. I'd rather have udev forget the old NICs and assign the new NIC to eth0.

Here's how to do it. Whenever udev detects a new NIC, it writes an entry to /etc/udev/rules.d/70-persistent-net.rules. So, edit that file, deleting the old, stale entries and leaving the latest one (as eth0).

(This works on Debian and openSUSE, and presumably on all other modern Linuxes.)

No comments:

Post a Comment