No, I don't want persistent net rules
Solution 1
The persistent net rules are generated by /lib/udev/rules.d/75-persistent-net-generator.rules
(or something similar, I'm looking on a newer Debian machine).
If Ubuntu 8.04 still has that generator script in /etc/udev/rules.d, you can just get rid of it.
Otherwise, I believe putting a blank file in /etc/udev/rules.d will override the one in /lib.
You could also write your own rules file to give the interface a name—the persistent rules generator ignores the interface if a name has already been set.
Solution 2
I followed derobert's advice, deleting /etc/udev/rules.d/75-persistent-net-generator.rules
, and also I edited the already generated /etc/udev/rules.d/70-persistent-net.rules
so that the lines looked like this:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{type}=="1", KERNEL=="eth*", NAME="%k"
Note the %k
in NAME
, which means to use the kernel name.
Related videos on Youtube
Yugo Kamo
Updated on September 18, 2022Comments
-
Yugo Kamo over 1 year
I have a bootable Linux memstick that I use on a lot of different PCs (but all of the same model and configuration). Trouble is that udev is renaming the eth interfaces so that what was
eth0
on the last PC is suddenly ethX, where X=1..inf. This causes if-up (called by ifplugd) to fail, since/etc/network/interfaces
only specifies how to bring upeth0
:auto eth0 iface eth0 inet dhcp
It's a well-known problem; I've googled and found that this is caused by the MAC addresses changing and that it may be fixed by deleting
/etc/udev/rules.d/70-persistent-net.rules
. But that only works after a reboot, which is inconvenient and should be unneccessary, since I know what behaviour I want.What I want is non-persistent net rules, or in the alternative, an
/etc/network/interfaces
script that adapts to the changing eth names, or perhaps it can be done with ifplugd. What's the best way to achieve this?Distro: Ubuntu 8.04.
-
psusi over 12 years8.04 is no longer supported on the desktop; upgrade to at least 10.04. You will probably find this issue is fixed there also.
-