A lot of my scripts stopped working after installing Ubuntu 15.10 and I have trouble remembering this new name as I was used to ethx and wlanx for years. Is there a reason for this change? Do I have to get used to this or can I just rename it and go back to good old eth0?

$ ifconfig

enp0s25   Link encap:Ethernet  HWaddr 77:5a:5e:a6:86:d5  
      inet addr:192.168.31.239  Bcast:192.168.31.255  Mask:255.255.255.0
      inet6 addr: fe80::725a:b6ff:fea6:86d7/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:4833 errors:1332 dropped:0 overruns:0 frame:666
      TX packets:5589 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:3266446 (3.2 MB)  TX bytes:1046654 (1.0 MB)
      Interrupt:20 Memory:d3500000-d3520000
  • 2
    see this which also has a further link to more details. – Doug Smythies Nov 30 '15 at 19:19
  • 3
    Ooooooooooooooor fix your scripts once and for all and remove the reference (and change it for a command to determine the device name) ;-) (here are some pointers: askubuntu.com/questions/396837/… ) – Rinzwind Dec 1 '15 at 9:56
  • @Rinzwind That is great idea. – Mike Dec 1 '15 at 10:41
  • @Mike my boss (= lead coder) always agrees with me on that too but then he always uses hard coded paths and devices... and I scold him again and again ;) – Rinzwind Dec 1 '15 at 10:46
  • Dupe of this: unix.stackexchange.com/questions/134483/… – rugk Oct 11 at 20:23
up vote 84 down vote accepted

This is known as Predictable Network Interface naming and is part of systemd, to which Ubuntu has been transitioning as of version 15.04.

Basic idea is that unlike previous *nix naming scheme where probing for hardware occurs in no particular order and may change between reboots, here interface name depends on physical location of hardware and can be predicted/guessed by looking at lspci or lshw output. Conversely we can guess information about it's physical position in the pci system. In your case that would be pci bus 0, slot 2. According to the freedesktop.org article, there actually are 3 ways how interface name is assigned: based on BIOS/Firmware for onboard cards, based on PCI information, and based on MAC address of the interface. Refer here for other examples.

According to the freedesktop.org page one of the reasons for switching to predictable naming is that classic naming convention can lead to software security risks in multi-interface systems when devices are added and removed at boot. Also, according to the comment by Sam Hanes, "On a big server with many Ethernet ports it's invaluable: you can immediately tell which interface goes to which port and adding or removing hardware doesn't change the names of other ports."

See How to rename network interface in 15.10 in case you decide to revert back to the other version of naming.

  • 36
    I see little irony in word "predictable" :), thank you for the pointers. – Mike Dec 1 '15 at 10:35
  • 10
    "predictable", yeah, sure. I have ethernet disconnections after upgrade to 15.10 (clean install, old /home). Why break APIs and conventions? Now I have to figured out what is failing. I'm very upset with this :( – gorlok Jan 24 '16 at 14:31
  • 11
    failing is predictable i guess ;) – Anwar Aug 20 '16 at 7:16
  • 5
    eh, tell that to the systemd developers, guys. – Sergiy Kolodyazhnyy Aug 20 '16 at 7:23
  • 20
    Predictable Naming isn't particularly useful on desktop systems with only one interface, and in that case it's kind of obnoxious. On a big server with many Ethernet ports it's invaluable: you can immediately tell which interface goes to which port and adding or removing hardware doesn't change the names of other ports. That's the case it's designed for. – Sam Hanes Nov 12 '16 at 7:33

protected by Sergiy Kolodyazhnyy Jan 23 at 8:51

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.