ARGH udev won't stop renaming my interfaces!

13,053

Solution 1

Actually I did get it to work eventually with PCI address ID. Two things, you have to:

  1. Put/edit this in etc/default/grub:

    GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1 biosdevname=0
    

    then do a sudo update-grub

  2. Put your desired names into /etc/udev/rules.d/70-persistent-net.rules, like this:

    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNELS=="0000:03:00.0", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
    

    Where 0000:03:00.0 is your PCI address you located in your dmesg output.

Note: No need to disable IPV6, I forgot that flag was in there. We just don't use it, so we disable it for safety.

Solution 2

  1. Append this to /etc/default/grub:

    GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 biosdevname=0"
    
  2. Update bootloader :

    sudo update-grub
    
  3. Reboot!

    reboot
    

Tested on ubuntu 15.10

Share:
13,053

Related videos on Youtube

Jonathan S. Fisher
Author by

Jonathan S. Fisher

Professional Redneck from Kansas. Purveyor of the second coming of Java. Favorite Quote: "After eating an entire bull, a mountain lion felt so good that he started roaring. He kept it up until a hunter came along and shot him. The moral: when you're full of bull, keep your mouth shut"

Updated on September 18, 2022

Comments

  • Jonathan S. Fisher
    Jonathan S. Fisher over 1 year

    I have the following in /etc/udev/rules.d/70-persistent-net.rules

    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d0:50:99:50:43:17", KERNEL=="eth*", NAME="eth0"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d0:50:99:50:43:18", KERNEL=="eth*", NAME="eth1"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="68:05:ca:1a:ce:9d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
    

    However, on boot, udev hate me. Why?

    dmesg snips:

    [   13.328778] e1000e 0000:01:00.0 eth0: registered PHC clock
    [   13.328781] e1000e 0000:01:00.0 eth0: (PCI Express:2.5GT/s:Width x1) 68:05:ca:1a:ce:9d
    [   13.328783] e1000e 0000:01:00.0 eth0: Intel(R) PRO/1000 Network Connection
    [   13.970303] igb 0000:07:00.0: Intel(R) Gigabit Ethernet Network Connection
    [   13.970305] igb 0000:07:00.0: eth1: (PCIe:2.5Gb/s:Width x1) d0:50:99:50:43:17
    [   13.970434] igb 0000:07:00.0: eth1: PBA No: 001300-000
    [   14.013474] igb 0000:08:00.0: Intel(R) Gigabit Ethernet Network Connection
    [   14.013476] igb 0000:08:00.0: eth2: (PCIe:2.5Gb/s:Width x1) d0:50:99:50:43:18
    [   14.013603] igb 0000:08:00.0: eth2: PBA No: 001300-000
    [   16.274874] systemd-udevd[155]: renamed network interface eth2 to p121p1
    [   16.847244] systemd-udevd[160]: renamed network interface eth1 to p119p1
    [   19.425858] systemd-udevd[607]: renamed network interface eth0 to eth2
    

    How come the third works but the first two don't?

  • cmks
    cmks about 8 years
    the OP already posted the answer in a comment... also, an accepted answer is already here.
  • MSS
    MSS about 8 years
    you wrong I did it and if you don't set net.ifnames=0 kernel will rename the interfaces. I don't really know maybe on other version it differ.