Ubuntu – Ubuntu 16.04 Complicated Interface Names

16.04grub2interfacesysfssystemd

I'm trying to figure out how to restore the simple interface names in Ubuntu 16.04. I.e. enp3s0 renamed to eth0.

  • I have tried to modify the GRUB configuration. I have tried editing /etc/udev/rules.d/10-network.rules, but both methods did nothing for me.
    Help is greatly appreciated.

    /etc/udev/rules.d/10-network.rules: (I hid the mac address names.)

    SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="XX:XX:XX:XX:XX:XX″,KERNEL=="enp0s0″, NAME="eth0″
    SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="XX:XX:XX:XX:XX:XX″,KERNEL=="wlx02c5c1866772″, NAME="wlan0″
    
  • And I changed this line in the GRUB configuration (/etc/default/grub) …

    GRUB_CMDLINE_LINUX=""
    

    to look like this:

    GRUB_CMDLINE_LINUX="net.ifnames=1"
    

Best Answer

Tested on VBox with Ubuntu 16.04, enp0s3eth0

Option 1:

  1. Override udev rule

    sudo ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
    
  2. Update RAMDisk

    sudo update-initramfs -u
    

Option 2:

  1. Create a systemd link file

    sudo vim /etc/systemd/network/10-eth.link
    
  2. Let's define name related to MAC: (There are many options, see the linked reference)

    [Match]
    MACAddress=08:00:27:de:dd:4c
    
    [Link]
    Name=eth0
    
  3. Update RAMDisk

    sudo update-initramfs -u
    

Option 3:

  1. Add net.ifnames=0 to boot parameters

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash net.ifnames=0"
    
  2. Update grub

    sudo update-grub
    

Reference: systemd: Predictable Network Interface Names, Thanks @mikewhatever .

Related Question