12

I decided to check out what name my ethernet device will end up with, but contrary to other distros, Debian doesn't seem to have activated this change (or is holding it back?),

  • Keep the old persistent network interface naming scheme for now and make the new one opt-in via net.ifnames=1 on the kernel command line.

The problem is that I have to edit the grub kernel lines, and that seems like overkill for something that can be disabled by modifying a file. Is there another way?

Braiam
  • 35,991
  • Maybe you want to check this link: http://www.science.uva.nl/research/air/wiki/LogicalInterfaceNames You may find a work around such as nameif and updating startup file... @Braiam – user1527227 Jul 24 '14 at 18:44
  • @user1527227 that's exactly what I don't want to do. – Braiam Jul 24 '14 at 18:48
  • On jesse you should only need to modify one line in /etc/default/grub. On wheezy there's really no way to enable this AFAIK. I really like the new naming scheme, so I setup my own udev rules on my wheeze servers. – GnP Jul 25 '14 at 19:06

4 Answers4

12

Version 220-7 on Debian dropped the patch that made this opt-in:

* Switch to net.ifnames persistent network interfaces (on new
  installations/for new hardware), and deprecate the old
  75-persistent-net-generator.rules.

This came about from a proposal in debian-devel list. Systems which were using the old naming won't be renamed until the user migrates. Read README.Debian for the migration guide.

The new name can be predicted by using:

sudo udevadm test /sys/class/net/eth0 2>/dev/null |grep ID_NET_NAME_

where eth0 is the current name of the device.

Braiam
  • 35,991
5

I assume you're talking about sid or jessie. For wheezy you may want to try the backport of v204.

There may be some misconceptions in play here: as can be seen from the udev rules here (for v208 currently in sid), the udev developers explicitly chose the kernel cmdline as the default way of enabling this functionality.
I don't see anything inherently "overkill" with using the chosen interface for it and simply putting GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1" in /etc/default/grub. Is there any specific side-effect you're worried about?

The fact that the answer you mentioned suggests removing a file to disable it is a hack (at least in Debian's case) that wouldn't work in the long-term because in debian those rules are stored in /lib/udev/rules.d, i.e.: they would get overwritten in an upgrade (besides, disabling functionality by effectively removing the file that describes it makes some sense, but enabling it is fundamentally different, so I think this is an unfair comparison).

OTOH, if you have a concrete reason for not using the kernel cmdline, you could report a bug against the debian package and have the maintainer move these rules to /etc/udev/. Then you could theoretically switch between the current "persistent" and the new "predictable" rules.

But just FYI: looking at the sources for version 209, it seems to get rid of the net.if_names check altogether, so your question may need some readdressing in the near future.

  • 1
    "explicitly chose the kernel cmdline as the default way of enabling this functionality." actually it is a Debian patch that does this, not udev devs. They only included a method to make it opt-out at boot, Debian changed that to opt-in, and enabling it should be easy since it's enabled by default. – Braiam Aug 10 '14 at 15:31
  • @Braiam: Nice catch! But I think the main argument remains that it was a udev choice of using the kernel cmdline as an interface, whether for enabling or disabling it. – Leo Antunes Aug 10 '14 at 15:57
  • I edited the kernel command line to include the net.ifname=1 parameter, but this feature was not enabled on Linux Mint. Which Linux distros are known to have support for this feature? – sherrellbc Jan 19 '16 at 21:56
0

Ubuntu 15.10 uses biosdevname which doesn't provide predictable network interface names. Even if you remove it (apt-get remove biosdevname) and edit grub (GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1") and the persistent rules, you still don't get predicatble network interaces.

The main reason seems to be backward compatibility. I tested it just now with 2 mobile broadband USB devices and the network interface name is inconsistently named on each boot(e.g. the first interface usb0, second usb1 and the other way around).The main reason seems to be backward compatibility.

There are some bugs open on launchpad(e.g. this) but the short answer is that if you are looking for predictable network interface names you should look for a different distro.

spuder
  • 18,053
  • Got it! I will actually update the answer as I think I've got it. – Anthony Hunt Jul 05 '15 at 17:57
  • 1
    @roalma I've updated the answer! Sorry for the previously "comment-like" post. – Anthony Hunt Jul 05 '15 at 18:07
  • Debian does support this functionality by default since version 220-7 when they dropped the patch that brough the behaviour about. Now new installed systems would use the predictable names by default. – Braiam Jul 06 '15 at 19:10
0

On Debian/Ubuntu, starting with udev 220, you can enable the new names by renaming this file:

sudo mv -T /etc/udev/rules.d/70-persistent-net.rules{,.old}

As suggested by /usr/share/doc/udev/README.Debian.gz, followed by

sudo update-initramfs -u

Then rebooting (or rmmod+insmod of the module driving your network card).

Tobu
  • 6,593