Proposal: enable stateless persistant network interface names

josh at joshtriplett.org josh at joshtriplett.org
Fri May 8 20:29:03 BST 2015


On Fri, May 08, 2015 at 09:06:25PM +0200, Karsten Merker wrote:
> On Fri, May 08, 2015 at 10:50:30AM -0700, Josh Triplett wrote:
> > Karsten Merker wrote:
> > > while this probably works resonably well for (semi-)fixed devices
> > > like onboard-NICs and PCI/PCIe cards, it results in a completely
> > > unsuitable behaviour with pluggable devices such as USB network
> > > adapters.  When using ifnames, the interface name depends on the
> > > USB port into which the device is currently plugged and the
> > > interface name changes when one uses a USB hub or plugs the
> > > device into another host port.  This would mean that a user would
> > > always have to plug his USB network device into the same port
> > > that was used during initial setup to keep it working, and
> > > one-off use of a USB hub would require changing the network
> > > configuration.  Despite the problems of the MAC-based system
> > > that we use currently, the ifnames method appears way worse
> > > to me than what we have now.
> > 
> > That would only be a problem if you're using ifupdown and its hardcoded
> > network interface names.  Other network software handles dynamic names.
> 
> How is for example iptables supposed to handle changing interface
> names?

Associate the rules with addresses, names, or other aspects of network
topology, rather than specific interfaces.

And for servers or routers (the common case for iptables usage), ifnames
should provide quite stable names.

> IPtables rules often specify a specific incoming or
> outgoing interface, so the interface name must be known at the
> ruleset load time.  This would mean that with the ifnames
> mechanism and its port-based interface naming, an iptables
> ruleset on a laptop with a USB network adapter would only work if
> the adapter is either always plugged into the same port or the
> user changes the ruleset every time he uses another USB port.

On a laptop (or anywhere else), ideally you're using a higher-level tool
than iptables.  For instance, if you're trying to share connectivity
from one network and NAT it to another, that's easily done with a few
clicks these days.  And it doesn't depend on which adapter

> > Without this, you can't reliably use a system with *two* USB network
> > devices, because they won't consistently come up with the same names.
> > Or, for that matter, a system with a built-in network interface and a
> > USB network interface.
> 
> The current default MAC-based mechanism handles exactly this case
> very well on a number of systems for me (one built-in network
> interface and one or two USB network adapters). Every adapter
> always gets the same interface name, regardless of the bringup
> order.

Answered in my other response, sorry.  Yes, the MAC-based mechanism
handles this too, but it has quite a few other issues.

- Josh Triplett




More information about the Pkg-systemd-maintainers mailing list