Proposal: enable stateless persistant network interface names

Martin Pitt mpitt at debian.org
Fri May 8 11:40:39 BST 2015


Hello Konstantin,

Konstantin Khomoutov [2015-05-08 13:08 +0300]:
> Is it possible to provide a tool (a shell script?) that would print out
> the new would-be name of the interface provided by the user so that it
> would be possible to migrate remote systems only accessible via SSH?

The closest thing to that would be something like this:

  $ sudo udevadm test /sys/class/net/wlan0 |grep ID_NET_NAME_
  ID_NET_NAME_MAC=wlxa44e31848d2c
  ID_NET_NAME_PATH=wlp3s0

As I wrote the _MAC name isn't used by default (this has to be enabled
explicitly, and it's a bit unwieldy); the default policy is to use the
first existing variable in ID_NET_NAME_ONBOARD, ID_NET_NAME_SLOT, or
ID_NET_NAME_PATH.

Indeed it sounds useful to put that into a little shell script in
/usr/share/doc/udev/ or so which the admin can run if she wants to
migrate to the new names.

> I mean, a sysadmin would then be able to determine the new name of the
> network interface, reflect this change in the firewall setup and other
> relevant places, delete 70-persistent-net.rules and reboot the box
> (or may be perform some more involved encantation with calling ifdown /
> ip link name ... / ifup while in a screen/tmux session).

It's not advisable to change network names at runtime. Well, you could
stop all networking services and unload and reload the driver modules,
but that sounds about as error prone as just rebooting :-) I don't
know whether it's possible to change the name while the interface is
up and in use.

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)




More information about the Pkg-systemd-maintainers mailing list