How to disable persistent network device names?
Hi,
after switching from SLES 10 to 11 I saw that I couldn't use FORCE_PERSISTENT_NAMES=no anymore.
How can we prevent persistent network device names? There are some problems with this:
1) If 70-persistent-net.rules is removed, it is recreated with totally strange values. E.g. I have file with
SUBSYSTEM="net", ACTION="add", DRIVERS="?*", ATTR{address}="00:1b:21:0e:3e:68", ATTR{type}="1", KERNEL="eth*", NAME="eth0"
Now I remove the file (we have a diskless environment where those files can get removed due to a local disk change) and call "udevadm trigger". The new 70-persistent-net.rules now contains:
SUBSYSTEM="net", ACTION="add", DRIVERS="?*", ATTR{address}="00:1b:21:0e:3e:68", ATTR{type}="1", KERNEL="eth*", NAME="eth_s6_0"
Different on every host, sometimes eth_s1_0 etc.
So on the next reboot I have no network, because our config files are always ifcfg-eth0 (and additionally sometimes ifcfg-eth1).
2) When a mainboard is exchanged, the MACs change. But on the next boot I still want the new NICs to be eth0 and eth1, in the order in which they are recognized by the bios.
It doesn't make sense if those new cards become eth2 and eth3 because the old, non-existing NICs are listed in the rules file with their MACs.
So how can we prevent this? Why was the FORCE_PERSISTENT_NAMES option removed?
Persistent device names might be nice for laptops with wlan or usb network devices. For our site with 120 PCs and Servers with it's bad because I can't care about 120 rules file to make sure they all are always ok before the next boot. I just want to get rid of the feature :-)
cu,
Frank
Signature · 5 lines
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *
Quoted 20 lines · Frank Steiner
Hi,
after switching from SLES 10 to 11 I saw that I couldn't use FORCE_PERSISTENT_NAMES=no anymore.How can we prevent persistent network device names? There are some problems with this:
1) If 70-persistent-net.rules is removed, it is recreated with totally strange values. E.g. I have file with
SUBSYSTEM="net", ACTION="add", DRIVERS="?*",ATTR{address}="00:1b:21:0e:3e:68", ATTR{type}="1", KERNEL="eth*", NAME="eth0"
Now I remove the file (we have a diskless environment where those
files
can get removed due to a local disk change) and call "udevadm
trigger".
The new 70-persistent-net.rules now contains:
Quoted 3 lines
SUBSYSTEM="net", ACTION="add", DRIVERS="?*",ATTR{address}="00:1b:21:0e:3e:68", ATTR{type}="1", KERNEL="eth*", NAME="eth_s6_0"
Here your mac addresses are probably changing. Are you using the forcedeth driver? (See below.)
Quoted 12 lines
2) When a mainboard is exchanged, the MACs change. But on the next boot
I still want the new NICs to be eth0 and eth1, in the order in which they are recognized by the bios.
It doesn't make sense if those new cards become eth2 and eth3 because the old, non-existing NICs are listed in the rules file
with
their MACs.So how can we prevent this? Why was the
FORCE_PERSISTENT_NAMESoption removed?
Quoted 7 lines
Persistent device names might be nice for laptops with wlan or usb network devices.
For our site with 120 PCs and Servers with it's bad because I can't care about 120
rules file to make sure they all are always ok before the next boot. I just want to
get rid of the feature :-)
This is the standard recommendation from the debian irc channel. You may need to modify just how much of the mac address you keep and how much you wildcard. Note that there may be a more appropriate technique, this just leapt to mind.
------------------<snip>----------------------
dpkg([email protected])] forcedeth is probably the open-source nVidia
Ethernet driver, for nForce motherboards. Found in 2.4.23
and later
kernels. Ask me about <forcedeth mac>. See also <mcp67>,
<rtl8211c>.
[msg(dpkg)] forcedeth mac
[dpkg([email protected])] If you're using the <forcedeth> driver and your
network card keeps changing its name each time (eth0, then
eth1, then
eth2, etc), edit /etc/udev/rules.d/70-persistent-net.rules
(Lenny) or
/etc/udev/rules.d/z25_persistent-net.rules (Etch), remove
all but one
entry, and replace the MAC address with "00:00:6c:*". See
also <z25>.
Karl <[email protected]>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
Hi,
thanks for your help. But I'm not using the forcedeth driver, and wildcards wouldn't help me, unfortunately, because we have many hosts with dual-port cards and MAC addresses like
eth0: xxxx.68
eth1: xxxx.69
:-(
cu,
Frank
Signature · 5 lines
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *
Quoted 7 lines · Frank Steiner
Hi,
after switching from SLES 10 to 11 I saw that I couldn't use FORCE_PERSISTENT_NAMES=no anymore.How can we prevent persistent network device names? There are some problems with this:
Did you try removing the persistent net generator rule file? (usually 75-persistent-net-generator.rules)
Don't know where that is located in SLES, might be in /etc/udev/rules.d or /lib/udev/rules.d
Olaf
Hi,
Olaf wrote
Quoted 4 lines
Did you try removing the persistent net generator rule file? (usually 75-persistent-net-generator.rules)
Don't know where that is located in SLES, might be in/etc/udev/rules.dor/lib/udev/rules.d
that would work, yes! But with the next udev update that file would be back and if I missed that, the rule files could get created by the next "udevadm trigger" call (from whereever). So this is a work-around, but not reliable, clean solution, I guess.
I also though that removing the 70-persistent-* rules on every boot before boot.udev runs would help, but I've least one hosts that still creates renamed network devices other than eth0 and eth1 (see my other email on the list), so this doesn't help either.
cu,
Frank
Signature · 5 lines
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *
Hi Frank,
Quoted 9 lines
Quoted 4 lines
Did you try removing the persistent net generator rule file? (usually 75-persistent-net-generator.rules)
Don't know where that is located in SLES, might be in/etc/udev/rules.dor/lib/udev/rules.dthat would work, yes! But with the next udev update that file would be back and if I missed that, the rule files could get created by the next "udevadm trigger" call (from whereever). So this is a work-around, but not reliable, clean solution, I guess.
OK, in that case you could create your own rule to bypass the net-generator.
Put something like this in 69-bypass-persistent-net.rules:
SUBSYSTEM="net", ACTION="add", NAME="%k"
Quoted 4 lines
I also though that removing the 70-persistent-* rules on every boot before boot.udev runs would help, but I've least one hosts that still creates renamed network devices other than eth0 and eth1 (see my other email on the list), so this doesn't help either.
The persistent net generator recreates the persistent-net if it does not exist.
Olaf
Olaf wrote
Quoted 4 lines
OK, in that case you could create your own rule to bypass the net-generator.
Put something like this in 69-bypass-persistent-net.rules:
SUBSYSTEM="net", ACTION="add", NAME="%k"
I will try that, thanks!
Signature · 5 lines
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *
Hi Olaf,
Olaf wrote
Quoted 4 lines
OK, in that case you could create your own rule to bypass the net-generator.
Put something like this in 69-bypass-persistent-net.rules:
SUBSYSTEM="net", ACTION="add", NAME="%k"
I tried this, with and without removing the 70-persistent-net.rules, but still my test host comes up with eth_s2_0 and eth_s2_1, so the kernel must tell udev those names.
But in /var/log/boot.msg I find this (quoting only about eth0 here):
<6>e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
...
<6>eth0 renamed to eth_s2_0 by udevd [274]
<6>udev: renamed network interface eth0 to eth_s2_0
So udev must have some other rule telling it to rename those devices. After I have removed 70-persistent-net.rules (and it is not re-created when rebooting) I don't know where this could come from :-( Do you have any idea?
cu,
Frank
Signature · 5 lines
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *
Hi Frank,
Quoted 18 lines
Olaf wrote
Quoted 4 lines
OK, in that case you could create your own rule to bypass the net-generator.
Put something like this in 69-bypass-persistent-net.rules:
SUBSYSTEM="net", ACTION="add", NAME="%k"I tried this, with and without removing the 70-persistent-net.rules, but still my test host comes up with
eth_s2_0andeth_s2_1, so the kernel must tell udev those names.But in
/var/log/boot.msgI find this (quoting only about eth0 here):<6>e1000: eth0:
e1000_probe: Intel(R) PRO/1000 Network Connection
...
<6>eth0 renamed toeth_s2_0by udevd [274]
<6>udev: renamed network interface eth0 toeth_s2_0
Quoted 4 lines
So udev must have some other rule telling it to rename those devices. After I have removed 70-persistent-net.rules (and it is not re-created when rebooting) I don't know where this could come from :-( Do you have any idea?
Could be something from the SLES initramfs?
I don't have/use SLES so I really don't know where the rename to eth_s2_* comes from, sorry.
Olaf
Olaf wrote
Quoted 3 lines
Could be something from the SLES initramfs?
I don't have/use SLES so I really don't know where the rename to eth_s2_* comes from, sorry.
Good idea. I see that udevd starts anbd the renaming happens before /etc/init.d/boot.udev is even started, so the initramfs is a good candidate.
Thanks for the hint, I'll post if I find a solution!
cu,
Frank
Signature · 5 lines
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *
Olaf wrote
Quoted 3 lines
Could be something from the SLES initramfs?
I don't have/use SLES so I really don't know where the rename to eth_s2_* comes from, sorry.
You had the right idea! I was using a initrd on this host and the mkinitrd script copies the 70-persistent-net.rules into the initrd if it finds this file. I guess while I was trying around with the udev rules, a new kernel was installed (happens automatically after a reboot) and took the wrong file for its initrd.
Now with this solved, I can go on with your bypass-rules to be independent of the MACs.
Thanks a lot for your help!!
cu,
Frank
Signature · 5 lines
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/ Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/ LMU, Amalienstr. 17 Phone: +49 89 2180-4049 80333 Muenchen, Germany Fax: +49 89 2180-99-4049 * Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *