Re: nic enumeration

Kay Sievers
2010-07-09T07:57:31Z

On Fri, Jul 9, 2010 at 09:18, Florian Weimer <fweimer@bfk.de> wrote:
>> Ok, but can we achieve the renaming w/o a reboot?
>
> "udev-trigger" or "udevadm trigger" works for renaming network
> interfaces.  The kernel has some restrictions on renaming interfaces
> which are in use, so this might not work in your case.

On older systems it would be:
udevtrigger
on newer systems it would be:
udevadm trigger

On recent systems you need to add:
udevadm trigger --action=add
otherwise 'change' events will be triggered, which don't rename any
netif. The default 'add' events caused too many problems with tools
with not well integrated tools.

And you should always limit the trigger to the subsystem you want to work with:
udevadm trigger --action=add --subsystem-match=net
otherwise you run events for all devices on the system, which may
cause completely unrelated trouble.

Anyway, it's not recommended to do anything like this. On many distros
it will cause trouble with the network scripts/services, which are run
again for already active interfaces. Using the udevadm trigger
'hammer' on the running system may lead to all sorts of problems. This
tool is usually only used at coldplug time during bootup.

Also, busy interfaces which might be included in the rename attempt
will cause ethX_rename failures if names need to be swapped.

In general, there is no safe way, or a tool to do this. You have to
know very well what you are doing. It's pretty common, that you
disconnect yourself from a remote box if you try anything like this.

Kay