[opensuse] renaming a network dev w/udevadm from command line?
How does one rename an ethernet interface from the command line using udevadm? I've looked at the man page on that, and it's about as clear as lead paint. On reboot the other day, my persistent netdev rules didn't run for some reason, likely some new 'gotcha' in disabling old boot procedures. Rather than doing what I did which was to make the modules in question dynamically loadable, and bring up the system by hand and load the modules in the order I wanted them loaded, I' figured it would be easier to ask on here how one does this? If they are already installed, do I need to do a udevadm control? Or do I need a udevadm action to emulate what is going on in the 70-persistent-net.rules? These all look like 'add', so aren't there old names that need to be moved out of the way? or does adding these at "new name" automatically deleted them at "old name"? Thanks... SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:26:b9:2c:a4:f1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3" # PCI device 0x8086:0x105e (e1000e) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:bf:be:b2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x8086:0x105e (e1000e) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:bf:be:b3", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" # PCI device 0x14e4:0x1639 (bnx2) (custom name provided by external tool) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:26:b9:2c:a4:ef", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"; # PCI device 0x8086:0x1528 (ixgbe) (custom name provided by external tool) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="a0:36:9f:15:c9:c0", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth_s2_0" # PCI device 0x8086:0x1528 (ixgbe) (custom name provided by external tool) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="a0:36:9f:15:c9:c2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth_s2_1" ~ ~ ~ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Sun, 02 Jun 2013 19:04:00 -0700 Linda Walsh <suse@tlinx.org> пишет:
How does one rename an ethernet interface from the command line using udevadm?
Does "ip link set dev ethX name XXX" work? Interface must be down at this point.
I've looked at the man page on that, and it's about as clear as lead paint.
On reboot the other day, my persistent netdev rules didn't run for some reason, likely some new 'gotcha' in disabling old boot procedures.
Rather than doing what I did which was to make the modules in question dynamically loadable, and bring up the system by hand and load the modules in the order I wanted them loaded, I' figured it would be easier to ask on here how one does this?
If they are already installed, do I need to do a udevadm control?
Or do I need a udevadm action to emulate what is going on in the 70-persistent-net.rules?
Yes. You can just do "echo add > /sys/.../event" for your device. Or use "udevadm trigger" which effectively does the same.
These all look like 'add', so aren't there old names that need to be moved out of the way?
Yes
or does adding these at "new name" automatically deleted them at "old name"?
No.
Thanks...
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:26:b9:2c:a4:f1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
Current upstream udev does not attempt to work around "need to be moved out of the way" so this will not work reliably. Use name space that does not clash with internal kernel one, like "netXXX". That is guaranteed to work. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrey Borzenkov wrote:
Current upstream udev does not attempt to work around "need to be moved out of the way" so this will not work reliably. Use name space that does not clash with internal kernel one, like "netXXX". That is guaranteed to work.
How does udev rename them? Can't I invoke the method that udev uses to rename them when it works or are you saying some new udev doesn't have this? I was under the understanding that we were not going to have to rename our interfaces. How do I get the consistent and same names I had before? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Mon, 03 Jun 2013 00:16:52 -0700 Linda Walsh <suse@tlinx.org> пишет:
Andrey Borzenkov wrote:
Current upstream udev does not attempt to work around "need to be moved out of the way" so this will not work reliably. Use name space that does not clash with internal kernel one, like "netXXX". That is guaranteed to work.
How does udev rename them? Can't I invoke the method that udev uses to rename them when it works or are you saying some new udev doesn't have this?
ioctl(sk, SIOCSIFNAME, &ifr); That is exactly what "ip link set name" does.
I was under the understanding that we were not going to have to rename our interfaces.
How do I get the consistent and same names I had before?
You gave zero information about openSUSE version you are running, which makes it rather hard to even guess the answer. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrey Borzenkov wrote:
� Mon, 03 Jun 2013 00:16:52 -0700 Linda Walsh <suse@tlinx.org> �����:
Andrey Borzenkov wrote:
Current upstream udev does not attempt to work around "need to be moved out of the way" so this will not work reliably. Use name space that does not clash with internal kernel one, like "netXXX". That is guaranteed to work. How does udev rename them? Can't I invoke the method that udev uses to rename them when it works or are you saying some new udev doesn't have this?
ioctl(sk, SIOCSIFNAME, &ifr);
That is exactly what "ip link set name" does.
I was under the understanding that we were not going to have to rename our interfaces.
How do I get the consistent and same names I had before?
You gave zero information about openSUSE version you are running, which makes it rather hard to even guess the answer.
Hmmm... ip link set name seems to work to rename an interface. Is that new? I.e. why has there been a need for rules in /etc/udev/70-... if it could be done via script w/ip link set name? Or is that new to some specific version of udev? I am somewhere beyond 12.3 with updates from factory installed. I'm still working on getting a stable boot back since I left 12.1...*sigh*. (not that doing so, is the only thing on my plate... -- before yesterday my last reboot was 21 days ago...so I'm not real focused on it -- too many other things to do... -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Mon, 03 Jun 2013 02:02:13 -0700 Linda Walsh <suse@tlinx.org> пишет:
Andrey Borzenkov wrote:
� Mon, 03 Jun 2013 00:16:52 -0700 Linda Walsh <suse@tlinx.org> �����:
Andrey Borzenkov wrote:
Current upstream udev does not attempt to work around "need to be moved out of the way" so this will not work reliably. Use name space that does not clash with internal kernel one, like "netXXX". That is guaranteed to work. How does udev rename them? Can't I invoke the method that udev uses to rename them when it works or are you saying some new udev doesn't have this?
ioctl(sk, SIOCSIFNAME, &ifr);
That is exactly what "ip link set name" does.
I was under the understanding that we were not going to have to rename our interfaces.
How do I get the consistent and same names I had before?
You gave zero information about openSUSE version you are running, which makes it rather hard to even guess the answer.
Hmmm... ip link set name seems to work to rename an interface.
Is that new?
No.
I am somewhere beyond 12.3 with updates from factory installed.
12.3 + updates still includes old logic for interface renaming which tries to work around races with kernel. It disappeared in 12.3 (probably, unintentionally, simply because it was removed upstream) and was added back with 12.3 update. Factory likely dropped it completely. This may become an issue on update ...
I'm still working on getting a stable boot back since I left 12.1...*sigh*. (not that doing so, is the only thing on my plate... -- before yesterday my last reboot was 21 days ago...so I'm not real focused on it -- too many other things to do...
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Andrey Borzenkov
-
Linda Walsh