Automatically renaming network interfaces
The kernel automatically assigns names to network interfaces when they are first instantiated. For people who roam or hotplug network devices this results in non-deterministic naming of interfaces. In order to have interface names that are consistent, it is possible to rename them based on various properties (MAC address of device, ESSID of wireless network, etcetera). However renaming is only possible before a network interface is brought up. There is only a small window between network device detection and configuration where it can be renamed. The point in time of detection and configuration depends on the method used. There can also be different mechanisms to do the renaming. The current status is that interface renaming does not work well for everyone.
Related bugs
245435, 267007, 291111, 294111, 294180
Related packages
hotplug, ifrename, ifplugd, ifupdown, udev, waproamd
Suggested approaches
- {dd:guus} Call ifrename right before every network configuration event (viz., before S:S40networking, in /etc/hotplug/net.agent, before starting ifplugd or waproamd, before running ifup manually).
madduck No, ifrename must be called after the driver is loaded, not before the network is configured. It should be called by hotplug/udev, but the problem is that the new interface name has to be provided in the INTERFACE environment variable. Proposed solution: do as udev does: halt the /etc/hotplug.d processing (not sure how) and call all /etc/hotplug.d/net/[].hotplug scripts again. This is a hack. It would be better if udevsend would call e.g. run-hotplug-parts, which would process all scripts until one exits e.g. 140, which means that run-hotplug-parts should terminate since the script exiting with 140 has started another instance (with modified environment). Then ifrename should be called as /etc/hotplug.d/net/020ifrename.
{dd:jdthood} Whoever is running /etc/hotplug.d/net/[].hotplug should do renaming first and provide the new interface name in INTERFACE.
- {dd:guus} Generalise this to "whoever starts configuring a network interface", some people just ifup/ifdown interfaces manually, ifupdown should run ifrename in that case.
Problems
- {dd:guus} Udev has its own mechanism of renaming interfaces?
madduck yeah, but udev will work as it will happen way before ifplugd and ifrename.
Feel free to correct mistakes, add your own suggestions and any problems you may see.