renaming network interface in Ubuntu 16.04 with systemd fails












13















I'm using a headless Ubuntu 16.04 LTS Server with two physical network cards, which are named enp5s0f0 and enp5s0f1.



I would like to rename these interfaces, and followed this example. I therefore created the file /lib/systemd/network/70-myinterface.link (the original source does not seem to work) like this (I set the correct mac address):



[Match]
MACAddress=12:34:56:78:9a:bc

[Link]
Name=dmz0


and rebooted the server. Unfortunately the interface did not get renamed, even though udevadm shows that my configuration file is used:



$ udevadm info /sys/class/net/enp5s0f1
P: /devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:02.0/0000:05:00.1/net/enp5s0f1
E: DEVPATH=/devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:02.0/0000:05:00.1/net/enp5s0f1
E: ID_BUS=pci
E: ID_MODEL_FROM_DATABASE=80003ES2LAN Gigabit Ethernet Controller (Copper)
E: ID_MODEL_ID=0x1096
E: ID_NET_DRIVER=e1000e
E: ID_NET_LINK_FILE=/lib/systemd/network/70-myinterface.link <-- my file
E: ID_NET_NAME_MAC=enx123456789abc
E: ID_NET_NAME_PATH=enp5s0f1
E: ID_OUI_FROM_DATABASE=Intel Corporation
E: ID_PATH=pci-0000:05:00.1
E: ID_PATH_TAG=pci-0000_05_00_1
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_VENDOR_ID=0x8086
E: IFINDEX=3
E: INTERFACE=enp5s0f1
E: SUBSYSTEM=net
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp5s0f1
E: TAGS=:systemd:
E: USEC_INITIALIZED=1900192


Do you have any idea why the renaming did not work?










share|improve this question




















  • 1





    I would of thought /etc/systemd/network would be the best location to create this file.

    – NGRhodes
    Sep 3 '16 at 19:43











  • @NGRhodes I was assuming a typo based on the example cited, but who knows?

    – Elder Geek
    Sep 3 '16 at 19:49











  • Also, check networkmanager is not running, superuser.com/a/948996/127393 suggests networkmanager having priority

    – NGRhodes
    Sep 3 '16 at 20:18











  • After I had placed the bounty I noticed that there is a new udev rule file in 16.04 that always forces the MAC address type naming for USB adapters before networkd is consulted (/lib/udev/rules.d/73-usb-net-by-mac.rules). This doesn't feel right at all... I had to disable its rule completely, which made the .link file work again. I am not sure if it is the most correct option, though.'

    – Antti Haapala
    Sep 3 '16 at 20:49













  • Using MACAddress= [Match] doesn't work for me in link files as well, so I ended up using Path= instead. You should try too. Also you may check which link file matches your device with udevadm test-builtin net_setup_link /sys/class/net/enp5s0f1 command

    – webKnjaZ
    Sep 4 '16 at 15:22


















13















I'm using a headless Ubuntu 16.04 LTS Server with two physical network cards, which are named enp5s0f0 and enp5s0f1.



I would like to rename these interfaces, and followed this example. I therefore created the file /lib/systemd/network/70-myinterface.link (the original source does not seem to work) like this (I set the correct mac address):



[Match]
MACAddress=12:34:56:78:9a:bc

[Link]
Name=dmz0


and rebooted the server. Unfortunately the interface did not get renamed, even though udevadm shows that my configuration file is used:



$ udevadm info /sys/class/net/enp5s0f1
P: /devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:02.0/0000:05:00.1/net/enp5s0f1
E: DEVPATH=/devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:02.0/0000:05:00.1/net/enp5s0f1
E: ID_BUS=pci
E: ID_MODEL_FROM_DATABASE=80003ES2LAN Gigabit Ethernet Controller (Copper)
E: ID_MODEL_ID=0x1096
E: ID_NET_DRIVER=e1000e
E: ID_NET_LINK_FILE=/lib/systemd/network/70-myinterface.link <-- my file
E: ID_NET_NAME_MAC=enx123456789abc
E: ID_NET_NAME_PATH=enp5s0f1
E: ID_OUI_FROM_DATABASE=Intel Corporation
E: ID_PATH=pci-0000:05:00.1
E: ID_PATH_TAG=pci-0000_05_00_1
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_VENDOR_ID=0x8086
E: IFINDEX=3
E: INTERFACE=enp5s0f1
E: SUBSYSTEM=net
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp5s0f1
E: TAGS=:systemd:
E: USEC_INITIALIZED=1900192


Do you have any idea why the renaming did not work?










share|improve this question




















  • 1





    I would of thought /etc/systemd/network would be the best location to create this file.

    – NGRhodes
    Sep 3 '16 at 19:43











  • @NGRhodes I was assuming a typo based on the example cited, but who knows?

    – Elder Geek
    Sep 3 '16 at 19:49











  • Also, check networkmanager is not running, superuser.com/a/948996/127393 suggests networkmanager having priority

    – NGRhodes
    Sep 3 '16 at 20:18











  • After I had placed the bounty I noticed that there is a new udev rule file in 16.04 that always forces the MAC address type naming for USB adapters before networkd is consulted (/lib/udev/rules.d/73-usb-net-by-mac.rules). This doesn't feel right at all... I had to disable its rule completely, which made the .link file work again. I am not sure if it is the most correct option, though.'

    – Antti Haapala
    Sep 3 '16 at 20:49













  • Using MACAddress= [Match] doesn't work for me in link files as well, so I ended up using Path= instead. You should try too. Also you may check which link file matches your device with udevadm test-builtin net_setup_link /sys/class/net/enp5s0f1 command

    – webKnjaZ
    Sep 4 '16 at 15:22
















13












13








13


4






I'm using a headless Ubuntu 16.04 LTS Server with two physical network cards, which are named enp5s0f0 and enp5s0f1.



I would like to rename these interfaces, and followed this example. I therefore created the file /lib/systemd/network/70-myinterface.link (the original source does not seem to work) like this (I set the correct mac address):



[Match]
MACAddress=12:34:56:78:9a:bc

[Link]
Name=dmz0


and rebooted the server. Unfortunately the interface did not get renamed, even though udevadm shows that my configuration file is used:



$ udevadm info /sys/class/net/enp5s0f1
P: /devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:02.0/0000:05:00.1/net/enp5s0f1
E: DEVPATH=/devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:02.0/0000:05:00.1/net/enp5s0f1
E: ID_BUS=pci
E: ID_MODEL_FROM_DATABASE=80003ES2LAN Gigabit Ethernet Controller (Copper)
E: ID_MODEL_ID=0x1096
E: ID_NET_DRIVER=e1000e
E: ID_NET_LINK_FILE=/lib/systemd/network/70-myinterface.link <-- my file
E: ID_NET_NAME_MAC=enx123456789abc
E: ID_NET_NAME_PATH=enp5s0f1
E: ID_OUI_FROM_DATABASE=Intel Corporation
E: ID_PATH=pci-0000:05:00.1
E: ID_PATH_TAG=pci-0000_05_00_1
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_VENDOR_ID=0x8086
E: IFINDEX=3
E: INTERFACE=enp5s0f1
E: SUBSYSTEM=net
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp5s0f1
E: TAGS=:systemd:
E: USEC_INITIALIZED=1900192


Do you have any idea why the renaming did not work?










share|improve this question
















I'm using a headless Ubuntu 16.04 LTS Server with two physical network cards, which are named enp5s0f0 and enp5s0f1.



I would like to rename these interfaces, and followed this example. I therefore created the file /lib/systemd/network/70-myinterface.link (the original source does not seem to work) like this (I set the correct mac address):



[Match]
MACAddress=12:34:56:78:9a:bc

[Link]
Name=dmz0


and rebooted the server. Unfortunately the interface did not get renamed, even though udevadm shows that my configuration file is used:



$ udevadm info /sys/class/net/enp5s0f1
P: /devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:02.0/0000:05:00.1/net/enp5s0f1
E: DEVPATH=/devices/pci0000:00/0000:00:02.0/0000:01:00.0/0000:02:02.0/0000:05:00.1/net/enp5s0f1
E: ID_BUS=pci
E: ID_MODEL_FROM_DATABASE=80003ES2LAN Gigabit Ethernet Controller (Copper)
E: ID_MODEL_ID=0x1096
E: ID_NET_DRIVER=e1000e
E: ID_NET_LINK_FILE=/lib/systemd/network/70-myinterface.link <-- my file
E: ID_NET_NAME_MAC=enx123456789abc
E: ID_NET_NAME_PATH=enp5s0f1
E: ID_OUI_FROM_DATABASE=Intel Corporation
E: ID_PATH=pci-0000:05:00.1
E: ID_PATH_TAG=pci-0000_05_00_1
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_VENDOR_ID=0x8086
E: IFINDEX=3
E: INTERFACE=enp5s0f1
E: SUBSYSTEM=net
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp5s0f1
E: TAGS=:systemd:
E: USEC_INITIALIZED=1900192


Do you have any idea why the renaming did not work?







networking server 16.04






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 6 '16 at 11:16









Android Dev

11.1k63462




11.1k63462










asked Jun 6 '16 at 11:07









muffelmuffel

168115




168115








  • 1





    I would of thought /etc/systemd/network would be the best location to create this file.

    – NGRhodes
    Sep 3 '16 at 19:43











  • @NGRhodes I was assuming a typo based on the example cited, but who knows?

    – Elder Geek
    Sep 3 '16 at 19:49











  • Also, check networkmanager is not running, superuser.com/a/948996/127393 suggests networkmanager having priority

    – NGRhodes
    Sep 3 '16 at 20:18











  • After I had placed the bounty I noticed that there is a new udev rule file in 16.04 that always forces the MAC address type naming for USB adapters before networkd is consulted (/lib/udev/rules.d/73-usb-net-by-mac.rules). This doesn't feel right at all... I had to disable its rule completely, which made the .link file work again. I am not sure if it is the most correct option, though.'

    – Antti Haapala
    Sep 3 '16 at 20:49













  • Using MACAddress= [Match] doesn't work for me in link files as well, so I ended up using Path= instead. You should try too. Also you may check which link file matches your device with udevadm test-builtin net_setup_link /sys/class/net/enp5s0f1 command

    – webKnjaZ
    Sep 4 '16 at 15:22
















  • 1





    I would of thought /etc/systemd/network would be the best location to create this file.

    – NGRhodes
    Sep 3 '16 at 19:43











  • @NGRhodes I was assuming a typo based on the example cited, but who knows?

    – Elder Geek
    Sep 3 '16 at 19:49











  • Also, check networkmanager is not running, superuser.com/a/948996/127393 suggests networkmanager having priority

    – NGRhodes
    Sep 3 '16 at 20:18











  • After I had placed the bounty I noticed that there is a new udev rule file in 16.04 that always forces the MAC address type naming for USB adapters before networkd is consulted (/lib/udev/rules.d/73-usb-net-by-mac.rules). This doesn't feel right at all... I had to disable its rule completely, which made the .link file work again. I am not sure if it is the most correct option, though.'

    – Antti Haapala
    Sep 3 '16 at 20:49













  • Using MACAddress= [Match] doesn't work for me in link files as well, so I ended up using Path= instead. You should try too. Also you may check which link file matches your device with udevadm test-builtin net_setup_link /sys/class/net/enp5s0f1 command

    – webKnjaZ
    Sep 4 '16 at 15:22










1




1





I would of thought /etc/systemd/network would be the best location to create this file.

– NGRhodes
Sep 3 '16 at 19:43





I would of thought /etc/systemd/network would be the best location to create this file.

– NGRhodes
Sep 3 '16 at 19:43













@NGRhodes I was assuming a typo based on the example cited, but who knows?

– Elder Geek
Sep 3 '16 at 19:49





@NGRhodes I was assuming a typo based on the example cited, but who knows?

– Elder Geek
Sep 3 '16 at 19:49













Also, check networkmanager is not running, superuser.com/a/948996/127393 suggests networkmanager having priority

– NGRhodes
Sep 3 '16 at 20:18





Also, check networkmanager is not running, superuser.com/a/948996/127393 suggests networkmanager having priority

– NGRhodes
Sep 3 '16 at 20:18













After I had placed the bounty I noticed that there is a new udev rule file in 16.04 that always forces the MAC address type naming for USB adapters before networkd is consulted (/lib/udev/rules.d/73-usb-net-by-mac.rules). This doesn't feel right at all... I had to disable its rule completely, which made the .link file work again. I am not sure if it is the most correct option, though.'

– Antti Haapala
Sep 3 '16 at 20:49







After I had placed the bounty I noticed that there is a new udev rule file in 16.04 that always forces the MAC address type naming for USB adapters before networkd is consulted (/lib/udev/rules.d/73-usb-net-by-mac.rules). This doesn't feel right at all... I had to disable its rule completely, which made the .link file work again. I am not sure if it is the most correct option, though.'

– Antti Haapala
Sep 3 '16 at 20:49















Using MACAddress= [Match] doesn't work for me in link files as well, so I ended up using Path= instead. You should try too. Also you may check which link file matches your device with udevadm test-builtin net_setup_link /sys/class/net/enp5s0f1 command

– webKnjaZ
Sep 4 '16 at 15:22







Using MACAddress= [Match] doesn't work for me in link files as well, so I ended up using Path= instead. You should try too. Also you may check which link file matches your device with udevadm test-builtin net_setup_link /sys/class/net/enp5s0f1 command

– webKnjaZ
Sep 4 '16 at 15:22












5 Answers
5






active

oldest

votes


















6














This may or may not help .. I would check /etc/udev/rules.d and see if you have 70-persistent-net.rules. You should be able to rename them using that file



Mine looks like this:



SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="e0:cb:ee:d7:ff:9a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


If you have the entries for your cards in this file you can change the name to what ever you want by changing the "NAME=TheNameYouWant"






share|improve this answer
























  • Right on. I was about to post an answer in which I mentioned that interestingly, there are a few people using Ubuntu who have said that @muffel 's method for changing their network name didn't work. This was what I was going to suggest... +1

    – anonymous2
    Jun 6 '16 at 11:32











  • Here should the bounty go.

    – EKons
    Sep 2 '16 at 17:57



















3
















  • All the three custom naming methods, explained systemd: Predictable Network Interface Names, are related to udev rules.



    systemd .link's & udev rules have folder priority. /etc overrides /run overrides /lib.



    So check the current setup.



    # links
    ls -l /*/systemd/network/

    # rule that read links
    ls -l /*/udev/rules.d/80-net-setup-link.rules

    # rule that check for /etc/.../80-net-setup-link.rules & net.ifnames
    ls -l /*/udev/rules.d/73-usb-net-by-mac.rules


    After any change in these udev rules (adding/removing override files) to be effective, The boot RAM disk should be updated:



    sudo update-initramfs -u


    By default, these are the only files you may find



    ~$ ls -l /*/systemd/network/
    /etc/systemd/network/:
    total 0

    /lib/systemd/network/:
    total 12
    -rw-r--r-- 1 root root 404 Jul 12 17:28 80-container-host0.network ##(virtual-interface)
    -rw-r--r-- 1 root root 482 Jul 12 17:28 80-container-ve.network ##(virtual-interface)
    -rw-r--r-- 1 root root 80 Jul 12 17:28 99-default.link


    ~$ ls -l /*/udev/rules.d/80-net-setup-link.rules
    -rw-r--r-- 1 root root 292 Jul 12 17:28 /lib/udev/rules.d/80-net-setup-link.rules

    ~$ ls -l /*/udev/rules.d/73-usb-net-by-mac.rules
    -rw-r--r-- 1 root root 551 Jul 12 16:37 /lib/udev/rules.d/73-usb-net-by-mac.rules


    I have tested all of them in VBox fresh 16.04 install as documented in below link, all methods works as expected:



    Ubuntu 16.04 Complicated Interface Names



  • /etc/udev/rules.d/70-persistent-net-rules is from older releases replaced by systemd .link's (but they are not auto created), I added it here to check its existence for specific problems but not for
    AnttiHaapala's case.







share|improve this answer































    3














    An option that doesn't require udev rules (an alternative to systemd-networkd .link files) that works with Ubuntu 16.04 as well as many other Linux versions is



    Example:



    ifconfig peth0 down  
    ip link set peth0 name eth0
    ifconfig eth0 up


    In the example above peth0 is the original interface name and eth0 is the desired name. Plug in the name you currently have where peth0 is and the name you want where eth0 is. No reboot is required or suggested. Repeat the process for the second interface card



    Tested on Ubuntu 16.04 with kernel 4.4.0-36-generic #55-Ubuntu



    Edit: If you are looking for a persistent solution that survives reboot see Changing Network Interfaces name Ubuntu 16.04



    Sources: https://www.freedesktop.org/software/systemd/man/systemd.link.html



    http://kernelpanik.net/rename-a-linux-network-interface-without-udev/



    Testing.



    Note: since @antti-haapala method worked before and suddenly stopped you might be interested to know that "As a special case, an empty file (file size 0) or symlink with the same name pointing to /dev/null disables the configuration file entirely (it is "masked")". <-Source






    share|improve this answer


























    • I have been very useful your response, thank you + 1 @ElderGeek

      – user641576
      Jan 26 '17 at 9:48






    • 1





      @Alberto I'm glad it helped!

      – Elder Geek
      Jan 26 '17 at 15:17











    • sadly enough it is not persistent but still + 1

      – delfiler
      May 18 '18 at 14:15













    • @delfiler Thank you for your comment. If I'm understanding you correctly you are looking for a solution that survives a reboot. Am I clear on that?

      – Elder Geek
      May 18 '18 at 16:23











    • @delfiler see askubuntu.com/questions/767786/…

      – Elder Geek
      May 18 '18 at 16:33



















    2














    You need to update your initrd with something like update-initramfs -k all -c, since udev applies those configs already while running initrd.



    Ubuntu 16.04 doesn't have 70-persistent-net-rules file anymore.






    share|improve this answer





















    • 1





      That's odd, this 16.04 systems does. Ahh but it's an upgraded system. You are correct that it's not present in a fresh install.

      – Elder Geek
      Sep 3 '16 at 19:09





















    0














    I don't have enough reputation to comment, but just to add to the marked answer, clean installations of Ubuntu 16.04 won't have the /etc/udev/rules.d/70-persistent-net.rules file present. However, if you create it manually, you can add a line as shown in the answer here and it should work just like it did in older versions, with one notable difference - the KERNEL parameter should be specified as the name that was assigned to the interface by default. For example, if the system named the interface as "ens160" and you want to change it to "eth0", the line might look like:



    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="ens160", NAME="eth0"


    This tells the rule to only match on an interface matching the MAC specified (in the ATTR{address} parameter) and with a kernel name matching the KERNEL parameter. Alternatively you could probably omit the KERNEL parameter altogether and that should work as well.



    EDIT: And as already mentioned, if you want to use the .link file method then you will need to update initramfs for it to take effect. Also note the custom .link file should be created in /etc/systemd/network and not in /lib/systemd/network (either will work but best practice is to use /etc/systemd/network since that's what its there for - to allow for custom .link files that override the defaults in /lib/systemd/network).






    share|improve this answer










    New contributor




    dwillis77 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.




















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f783457%2frenaming-network-interface-in-ubuntu-16-04-with-systemd-fails%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      5 Answers
      5






      active

      oldest

      votes








      5 Answers
      5






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      6














      This may or may not help .. I would check /etc/udev/rules.d and see if you have 70-persistent-net.rules. You should be able to rename them using that file



      Mine looks like this:



      SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="e0:cb:ee:d7:ff:9a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


      If you have the entries for your cards in this file you can change the name to what ever you want by changing the "NAME=TheNameYouWant"






      share|improve this answer
























      • Right on. I was about to post an answer in which I mentioned that interestingly, there are a few people using Ubuntu who have said that @muffel 's method for changing their network name didn't work. This was what I was going to suggest... +1

        – anonymous2
        Jun 6 '16 at 11:32











      • Here should the bounty go.

        – EKons
        Sep 2 '16 at 17:57
















      6














      This may or may not help .. I would check /etc/udev/rules.d and see if you have 70-persistent-net.rules. You should be able to rename them using that file



      Mine looks like this:



      SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="e0:cb:ee:d7:ff:9a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


      If you have the entries for your cards in this file you can change the name to what ever you want by changing the "NAME=TheNameYouWant"






      share|improve this answer
























      • Right on. I was about to post an answer in which I mentioned that interestingly, there are a few people using Ubuntu who have said that @muffel 's method for changing their network name didn't work. This was what I was going to suggest... +1

        – anonymous2
        Jun 6 '16 at 11:32











      • Here should the bounty go.

        – EKons
        Sep 2 '16 at 17:57














      6












      6








      6







      This may or may not help .. I would check /etc/udev/rules.d and see if you have 70-persistent-net.rules. You should be able to rename them using that file



      Mine looks like this:



      SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="e0:cb:ee:d7:ff:9a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


      If you have the entries for your cards in this file you can change the name to what ever you want by changing the "NAME=TheNameYouWant"






      share|improve this answer













      This may or may not help .. I would check /etc/udev/rules.d and see if you have 70-persistent-net.rules. You should be able to rename them using that file



      Mine looks like this:



      SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="e0:cb:ee:d7:ff:9a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


      If you have the entries for your cards in this file you can change the name to what ever you want by changing the "NAME=TheNameYouWant"







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jun 6 '16 at 11:28









      John OrionJohn Orion

      2,3071823




      2,3071823













      • Right on. I was about to post an answer in which I mentioned that interestingly, there are a few people using Ubuntu who have said that @muffel 's method for changing their network name didn't work. This was what I was going to suggest... +1

        – anonymous2
        Jun 6 '16 at 11:32











      • Here should the bounty go.

        – EKons
        Sep 2 '16 at 17:57



















      • Right on. I was about to post an answer in which I mentioned that interestingly, there are a few people using Ubuntu who have said that @muffel 's method for changing their network name didn't work. This was what I was going to suggest... +1

        – anonymous2
        Jun 6 '16 at 11:32











      • Here should the bounty go.

        – EKons
        Sep 2 '16 at 17:57

















      Right on. I was about to post an answer in which I mentioned that interestingly, there are a few people using Ubuntu who have said that @muffel 's method for changing their network name didn't work. This was what I was going to suggest... +1

      – anonymous2
      Jun 6 '16 at 11:32





      Right on. I was about to post an answer in which I mentioned that interestingly, there are a few people using Ubuntu who have said that @muffel 's method for changing their network name didn't work. This was what I was going to suggest... +1

      – anonymous2
      Jun 6 '16 at 11:32













      Here should the bounty go.

      – EKons
      Sep 2 '16 at 17:57





      Here should the bounty go.

      – EKons
      Sep 2 '16 at 17:57













      3
















      • All the three custom naming methods, explained systemd: Predictable Network Interface Names, are related to udev rules.



        systemd .link's & udev rules have folder priority. /etc overrides /run overrides /lib.



        So check the current setup.



        # links
        ls -l /*/systemd/network/

        # rule that read links
        ls -l /*/udev/rules.d/80-net-setup-link.rules

        # rule that check for /etc/.../80-net-setup-link.rules & net.ifnames
        ls -l /*/udev/rules.d/73-usb-net-by-mac.rules


        After any change in these udev rules (adding/removing override files) to be effective, The boot RAM disk should be updated:



        sudo update-initramfs -u


        By default, these are the only files you may find



        ~$ ls -l /*/systemd/network/
        /etc/systemd/network/:
        total 0

        /lib/systemd/network/:
        total 12
        -rw-r--r-- 1 root root 404 Jul 12 17:28 80-container-host0.network ##(virtual-interface)
        -rw-r--r-- 1 root root 482 Jul 12 17:28 80-container-ve.network ##(virtual-interface)
        -rw-r--r-- 1 root root 80 Jul 12 17:28 99-default.link


        ~$ ls -l /*/udev/rules.d/80-net-setup-link.rules
        -rw-r--r-- 1 root root 292 Jul 12 17:28 /lib/udev/rules.d/80-net-setup-link.rules

        ~$ ls -l /*/udev/rules.d/73-usb-net-by-mac.rules
        -rw-r--r-- 1 root root 551 Jul 12 16:37 /lib/udev/rules.d/73-usb-net-by-mac.rules


        I have tested all of them in VBox fresh 16.04 install as documented in below link, all methods works as expected:



        Ubuntu 16.04 Complicated Interface Names



      • /etc/udev/rules.d/70-persistent-net-rules is from older releases replaced by systemd .link's (but they are not auto created), I added it here to check its existence for specific problems but not for
        AnttiHaapala's case.







      share|improve this answer




























        3
















        • All the three custom naming methods, explained systemd: Predictable Network Interface Names, are related to udev rules.



          systemd .link's & udev rules have folder priority. /etc overrides /run overrides /lib.



          So check the current setup.



          # links
          ls -l /*/systemd/network/

          # rule that read links
          ls -l /*/udev/rules.d/80-net-setup-link.rules

          # rule that check for /etc/.../80-net-setup-link.rules & net.ifnames
          ls -l /*/udev/rules.d/73-usb-net-by-mac.rules


          After any change in these udev rules (adding/removing override files) to be effective, The boot RAM disk should be updated:



          sudo update-initramfs -u


          By default, these are the only files you may find



          ~$ ls -l /*/systemd/network/
          /etc/systemd/network/:
          total 0

          /lib/systemd/network/:
          total 12
          -rw-r--r-- 1 root root 404 Jul 12 17:28 80-container-host0.network ##(virtual-interface)
          -rw-r--r-- 1 root root 482 Jul 12 17:28 80-container-ve.network ##(virtual-interface)
          -rw-r--r-- 1 root root 80 Jul 12 17:28 99-default.link


          ~$ ls -l /*/udev/rules.d/80-net-setup-link.rules
          -rw-r--r-- 1 root root 292 Jul 12 17:28 /lib/udev/rules.d/80-net-setup-link.rules

          ~$ ls -l /*/udev/rules.d/73-usb-net-by-mac.rules
          -rw-r--r-- 1 root root 551 Jul 12 16:37 /lib/udev/rules.d/73-usb-net-by-mac.rules


          I have tested all of them in VBox fresh 16.04 install as documented in below link, all methods works as expected:



          Ubuntu 16.04 Complicated Interface Names



        • /etc/udev/rules.d/70-persistent-net-rules is from older releases replaced by systemd .link's (but they are not auto created), I added it here to check its existence for specific problems but not for
          AnttiHaapala's case.







        share|improve this answer


























          3












          3








          3









          • All the three custom naming methods, explained systemd: Predictable Network Interface Names, are related to udev rules.



            systemd .link's & udev rules have folder priority. /etc overrides /run overrides /lib.



            So check the current setup.



            # links
            ls -l /*/systemd/network/

            # rule that read links
            ls -l /*/udev/rules.d/80-net-setup-link.rules

            # rule that check for /etc/.../80-net-setup-link.rules & net.ifnames
            ls -l /*/udev/rules.d/73-usb-net-by-mac.rules


            After any change in these udev rules (adding/removing override files) to be effective, The boot RAM disk should be updated:



            sudo update-initramfs -u


            By default, these are the only files you may find



            ~$ ls -l /*/systemd/network/
            /etc/systemd/network/:
            total 0

            /lib/systemd/network/:
            total 12
            -rw-r--r-- 1 root root 404 Jul 12 17:28 80-container-host0.network ##(virtual-interface)
            -rw-r--r-- 1 root root 482 Jul 12 17:28 80-container-ve.network ##(virtual-interface)
            -rw-r--r-- 1 root root 80 Jul 12 17:28 99-default.link


            ~$ ls -l /*/udev/rules.d/80-net-setup-link.rules
            -rw-r--r-- 1 root root 292 Jul 12 17:28 /lib/udev/rules.d/80-net-setup-link.rules

            ~$ ls -l /*/udev/rules.d/73-usb-net-by-mac.rules
            -rw-r--r-- 1 root root 551 Jul 12 16:37 /lib/udev/rules.d/73-usb-net-by-mac.rules


            I have tested all of them in VBox fresh 16.04 install as documented in below link, all methods works as expected:



            Ubuntu 16.04 Complicated Interface Names



          • /etc/udev/rules.d/70-persistent-net-rules is from older releases replaced by systemd .link's (but they are not auto created), I added it here to check its existence for specific problems but not for
            AnttiHaapala's case.







          share|improve this answer















          • All the three custom naming methods, explained systemd: Predictable Network Interface Names, are related to udev rules.



            systemd .link's & udev rules have folder priority. /etc overrides /run overrides /lib.



            So check the current setup.



            # links
            ls -l /*/systemd/network/

            # rule that read links
            ls -l /*/udev/rules.d/80-net-setup-link.rules

            # rule that check for /etc/.../80-net-setup-link.rules & net.ifnames
            ls -l /*/udev/rules.d/73-usb-net-by-mac.rules


            After any change in these udev rules (adding/removing override files) to be effective, The boot RAM disk should be updated:



            sudo update-initramfs -u


            By default, these are the only files you may find



            ~$ ls -l /*/systemd/network/
            /etc/systemd/network/:
            total 0

            /lib/systemd/network/:
            total 12
            -rw-r--r-- 1 root root 404 Jul 12 17:28 80-container-host0.network ##(virtual-interface)
            -rw-r--r-- 1 root root 482 Jul 12 17:28 80-container-ve.network ##(virtual-interface)
            -rw-r--r-- 1 root root 80 Jul 12 17:28 99-default.link


            ~$ ls -l /*/udev/rules.d/80-net-setup-link.rules
            -rw-r--r-- 1 root root 292 Jul 12 17:28 /lib/udev/rules.d/80-net-setup-link.rules

            ~$ ls -l /*/udev/rules.d/73-usb-net-by-mac.rules
            -rw-r--r-- 1 root root 551 Jul 12 16:37 /lib/udev/rules.d/73-usb-net-by-mac.rules


            I have tested all of them in VBox fresh 16.04 install as documented in below link, all methods works as expected:



            Ubuntu 16.04 Complicated Interface Names



          • /etc/udev/rules.d/70-persistent-net-rules is from older releases replaced by systemd .link's (but they are not auto created), I added it here to check its existence for specific problems but not for
            AnttiHaapala's case.








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 8 '16 at 14:20









          user.dzuser.dz

          35.1k1197178




          35.1k1197178























              3














              An option that doesn't require udev rules (an alternative to systemd-networkd .link files) that works with Ubuntu 16.04 as well as many other Linux versions is



              Example:



              ifconfig peth0 down  
              ip link set peth0 name eth0
              ifconfig eth0 up


              In the example above peth0 is the original interface name and eth0 is the desired name. Plug in the name you currently have where peth0 is and the name you want where eth0 is. No reboot is required or suggested. Repeat the process for the second interface card



              Tested on Ubuntu 16.04 with kernel 4.4.0-36-generic #55-Ubuntu



              Edit: If you are looking for a persistent solution that survives reboot see Changing Network Interfaces name Ubuntu 16.04



              Sources: https://www.freedesktop.org/software/systemd/man/systemd.link.html



              http://kernelpanik.net/rename-a-linux-network-interface-without-udev/



              Testing.



              Note: since @antti-haapala method worked before and suddenly stopped you might be interested to know that "As a special case, an empty file (file size 0) or symlink with the same name pointing to /dev/null disables the configuration file entirely (it is "masked")". <-Source






              share|improve this answer


























              • I have been very useful your response, thank you + 1 @ElderGeek

                – user641576
                Jan 26 '17 at 9:48






              • 1





                @Alberto I'm glad it helped!

                – Elder Geek
                Jan 26 '17 at 15:17











              • sadly enough it is not persistent but still + 1

                – delfiler
                May 18 '18 at 14:15













              • @delfiler Thank you for your comment. If I'm understanding you correctly you are looking for a solution that survives a reboot. Am I clear on that?

                – Elder Geek
                May 18 '18 at 16:23











              • @delfiler see askubuntu.com/questions/767786/…

                – Elder Geek
                May 18 '18 at 16:33
















              3














              An option that doesn't require udev rules (an alternative to systemd-networkd .link files) that works with Ubuntu 16.04 as well as many other Linux versions is



              Example:



              ifconfig peth0 down  
              ip link set peth0 name eth0
              ifconfig eth0 up


              In the example above peth0 is the original interface name and eth0 is the desired name. Plug in the name you currently have where peth0 is and the name you want where eth0 is. No reboot is required or suggested. Repeat the process for the second interface card



              Tested on Ubuntu 16.04 with kernel 4.4.0-36-generic #55-Ubuntu



              Edit: If you are looking for a persistent solution that survives reboot see Changing Network Interfaces name Ubuntu 16.04



              Sources: https://www.freedesktop.org/software/systemd/man/systemd.link.html



              http://kernelpanik.net/rename-a-linux-network-interface-without-udev/



              Testing.



              Note: since @antti-haapala method worked before and suddenly stopped you might be interested to know that "As a special case, an empty file (file size 0) or symlink with the same name pointing to /dev/null disables the configuration file entirely (it is "masked")". <-Source






              share|improve this answer


























              • I have been very useful your response, thank you + 1 @ElderGeek

                – user641576
                Jan 26 '17 at 9:48






              • 1





                @Alberto I'm glad it helped!

                – Elder Geek
                Jan 26 '17 at 15:17











              • sadly enough it is not persistent but still + 1

                – delfiler
                May 18 '18 at 14:15













              • @delfiler Thank you for your comment. If I'm understanding you correctly you are looking for a solution that survives a reboot. Am I clear on that?

                – Elder Geek
                May 18 '18 at 16:23











              • @delfiler see askubuntu.com/questions/767786/…

                – Elder Geek
                May 18 '18 at 16:33














              3












              3








              3







              An option that doesn't require udev rules (an alternative to systemd-networkd .link files) that works with Ubuntu 16.04 as well as many other Linux versions is



              Example:



              ifconfig peth0 down  
              ip link set peth0 name eth0
              ifconfig eth0 up


              In the example above peth0 is the original interface name and eth0 is the desired name. Plug in the name you currently have where peth0 is and the name you want where eth0 is. No reboot is required or suggested. Repeat the process for the second interface card



              Tested on Ubuntu 16.04 with kernel 4.4.0-36-generic #55-Ubuntu



              Edit: If you are looking for a persistent solution that survives reboot see Changing Network Interfaces name Ubuntu 16.04



              Sources: https://www.freedesktop.org/software/systemd/man/systemd.link.html



              http://kernelpanik.net/rename-a-linux-network-interface-without-udev/



              Testing.



              Note: since @antti-haapala method worked before and suddenly stopped you might be interested to know that "As a special case, an empty file (file size 0) or symlink with the same name pointing to /dev/null disables the configuration file entirely (it is "masked")". <-Source






              share|improve this answer















              An option that doesn't require udev rules (an alternative to systemd-networkd .link files) that works with Ubuntu 16.04 as well as many other Linux versions is



              Example:



              ifconfig peth0 down  
              ip link set peth0 name eth0
              ifconfig eth0 up


              In the example above peth0 is the original interface name and eth0 is the desired name. Plug in the name you currently have where peth0 is and the name you want where eth0 is. No reboot is required or suggested. Repeat the process for the second interface card



              Tested on Ubuntu 16.04 with kernel 4.4.0-36-generic #55-Ubuntu



              Edit: If you are looking for a persistent solution that survives reboot see Changing Network Interfaces name Ubuntu 16.04



              Sources: https://www.freedesktop.org/software/systemd/man/systemd.link.html



              http://kernelpanik.net/rename-a-linux-network-interface-without-udev/



              Testing.



              Note: since @antti-haapala method worked before and suddenly stopped you might be interested to know that "As a special case, an empty file (file size 0) or symlink with the same name pointing to /dev/null disables the configuration file entirely (it is "masked")". <-Source







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited May 18 '18 at 16:33

























              answered Sep 3 '16 at 19:24









              Elder GeekElder Geek

              27.4k955130




              27.4k955130













              • I have been very useful your response, thank you + 1 @ElderGeek

                – user641576
                Jan 26 '17 at 9:48






              • 1





                @Alberto I'm glad it helped!

                – Elder Geek
                Jan 26 '17 at 15:17











              • sadly enough it is not persistent but still + 1

                – delfiler
                May 18 '18 at 14:15













              • @delfiler Thank you for your comment. If I'm understanding you correctly you are looking for a solution that survives a reboot. Am I clear on that?

                – Elder Geek
                May 18 '18 at 16:23











              • @delfiler see askubuntu.com/questions/767786/…

                – Elder Geek
                May 18 '18 at 16:33



















              • I have been very useful your response, thank you + 1 @ElderGeek

                – user641576
                Jan 26 '17 at 9:48






              • 1





                @Alberto I'm glad it helped!

                – Elder Geek
                Jan 26 '17 at 15:17











              • sadly enough it is not persistent but still + 1

                – delfiler
                May 18 '18 at 14:15













              • @delfiler Thank you for your comment. If I'm understanding you correctly you are looking for a solution that survives a reboot. Am I clear on that?

                – Elder Geek
                May 18 '18 at 16:23











              • @delfiler see askubuntu.com/questions/767786/…

                – Elder Geek
                May 18 '18 at 16:33

















              I have been very useful your response, thank you + 1 @ElderGeek

              – user641576
              Jan 26 '17 at 9:48





              I have been very useful your response, thank you + 1 @ElderGeek

              – user641576
              Jan 26 '17 at 9:48




              1




              1





              @Alberto I'm glad it helped!

              – Elder Geek
              Jan 26 '17 at 15:17





              @Alberto I'm glad it helped!

              – Elder Geek
              Jan 26 '17 at 15:17













              sadly enough it is not persistent but still + 1

              – delfiler
              May 18 '18 at 14:15







              sadly enough it is not persistent but still + 1

              – delfiler
              May 18 '18 at 14:15















              @delfiler Thank you for your comment. If I'm understanding you correctly you are looking for a solution that survives a reboot. Am I clear on that?

              – Elder Geek
              May 18 '18 at 16:23





              @delfiler Thank you for your comment. If I'm understanding you correctly you are looking for a solution that survives a reboot. Am I clear on that?

              – Elder Geek
              May 18 '18 at 16:23













              @delfiler see askubuntu.com/questions/767786/…

              – Elder Geek
              May 18 '18 at 16:33





              @delfiler see askubuntu.com/questions/767786/…

              – Elder Geek
              May 18 '18 at 16:33











              2














              You need to update your initrd with something like update-initramfs -k all -c, since udev applies those configs already while running initrd.



              Ubuntu 16.04 doesn't have 70-persistent-net-rules file anymore.






              share|improve this answer





















              • 1





                That's odd, this 16.04 systems does. Ahh but it's an upgraded system. You are correct that it's not present in a fresh install.

                – Elder Geek
                Sep 3 '16 at 19:09


















              2














              You need to update your initrd with something like update-initramfs -k all -c, since udev applies those configs already while running initrd.



              Ubuntu 16.04 doesn't have 70-persistent-net-rules file anymore.






              share|improve this answer





















              • 1





                That's odd, this 16.04 systems does. Ahh but it's an upgraded system. You are correct that it's not present in a fresh install.

                – Elder Geek
                Sep 3 '16 at 19:09
















              2












              2








              2







              You need to update your initrd with something like update-initramfs -k all -c, since udev applies those configs already while running initrd.



              Ubuntu 16.04 doesn't have 70-persistent-net-rules file anymore.






              share|improve this answer















              You need to update your initrd with something like update-initramfs -k all -c, since udev applies those configs already while running initrd.



              Ubuntu 16.04 doesn't have 70-persistent-net-rules file anymore.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Aug 12 '16 at 0:42









              Hizqeel

              1,75351321




              1,75351321










              answered Aug 11 '16 at 22:40









              Jani JaakkolaJani Jaakkola

              211




              211








              • 1





                That's odd, this 16.04 systems does. Ahh but it's an upgraded system. You are correct that it's not present in a fresh install.

                – Elder Geek
                Sep 3 '16 at 19:09
















              • 1





                That's odd, this 16.04 systems does. Ahh but it's an upgraded system. You are correct that it's not present in a fresh install.

                – Elder Geek
                Sep 3 '16 at 19:09










              1




              1





              That's odd, this 16.04 systems does. Ahh but it's an upgraded system. You are correct that it's not present in a fresh install.

              – Elder Geek
              Sep 3 '16 at 19:09







              That's odd, this 16.04 systems does. Ahh but it's an upgraded system. You are correct that it's not present in a fresh install.

              – Elder Geek
              Sep 3 '16 at 19:09













              0














              I don't have enough reputation to comment, but just to add to the marked answer, clean installations of Ubuntu 16.04 won't have the /etc/udev/rules.d/70-persistent-net.rules file present. However, if you create it manually, you can add a line as shown in the answer here and it should work just like it did in older versions, with one notable difference - the KERNEL parameter should be specified as the name that was assigned to the interface by default. For example, if the system named the interface as "ens160" and you want to change it to "eth0", the line might look like:



              SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="ens160", NAME="eth0"


              This tells the rule to only match on an interface matching the MAC specified (in the ATTR{address} parameter) and with a kernel name matching the KERNEL parameter. Alternatively you could probably omit the KERNEL parameter altogether and that should work as well.



              EDIT: And as already mentioned, if you want to use the .link file method then you will need to update initramfs for it to take effect. Also note the custom .link file should be created in /etc/systemd/network and not in /lib/systemd/network (either will work but best practice is to use /etc/systemd/network since that's what its there for - to allow for custom .link files that override the defaults in /lib/systemd/network).






              share|improve this answer










              New contributor




              dwillis77 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.

























                0














                I don't have enough reputation to comment, but just to add to the marked answer, clean installations of Ubuntu 16.04 won't have the /etc/udev/rules.d/70-persistent-net.rules file present. However, if you create it manually, you can add a line as shown in the answer here and it should work just like it did in older versions, with one notable difference - the KERNEL parameter should be specified as the name that was assigned to the interface by default. For example, if the system named the interface as "ens160" and you want to change it to "eth0", the line might look like:



                SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="ens160", NAME="eth0"


                This tells the rule to only match on an interface matching the MAC specified (in the ATTR{address} parameter) and with a kernel name matching the KERNEL parameter. Alternatively you could probably omit the KERNEL parameter altogether and that should work as well.



                EDIT: And as already mentioned, if you want to use the .link file method then you will need to update initramfs for it to take effect. Also note the custom .link file should be created in /etc/systemd/network and not in /lib/systemd/network (either will work but best practice is to use /etc/systemd/network since that's what its there for - to allow for custom .link files that override the defaults in /lib/systemd/network).






                share|improve this answer










                New contributor




                dwillis77 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  0












                  0








                  0







                  I don't have enough reputation to comment, but just to add to the marked answer, clean installations of Ubuntu 16.04 won't have the /etc/udev/rules.d/70-persistent-net.rules file present. However, if you create it manually, you can add a line as shown in the answer here and it should work just like it did in older versions, with one notable difference - the KERNEL parameter should be specified as the name that was assigned to the interface by default. For example, if the system named the interface as "ens160" and you want to change it to "eth0", the line might look like:



                  SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="ens160", NAME="eth0"


                  This tells the rule to only match on an interface matching the MAC specified (in the ATTR{address} parameter) and with a kernel name matching the KERNEL parameter. Alternatively you could probably omit the KERNEL parameter altogether and that should work as well.



                  EDIT: And as already mentioned, if you want to use the .link file method then you will need to update initramfs for it to take effect. Also note the custom .link file should be created in /etc/systemd/network and not in /lib/systemd/network (either will work but best practice is to use /etc/systemd/network since that's what its there for - to allow for custom .link files that override the defaults in /lib/systemd/network).






                  share|improve this answer










                  New contributor




                  dwillis77 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  I don't have enough reputation to comment, but just to add to the marked answer, clean installations of Ubuntu 16.04 won't have the /etc/udev/rules.d/70-persistent-net.rules file present. However, if you create it manually, you can add a line as shown in the answer here and it should work just like it did in older versions, with one notable difference - the KERNEL parameter should be specified as the name that was assigned to the interface by default. For example, if the system named the interface as "ens160" and you want to change it to "eth0", the line might look like:



                  SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="ens160", NAME="eth0"


                  This tells the rule to only match on an interface matching the MAC specified (in the ATTR{address} parameter) and with a kernel name matching the KERNEL parameter. Alternatively you could probably omit the KERNEL parameter altogether and that should work as well.



                  EDIT: And as already mentioned, if you want to use the .link file method then you will need to update initramfs for it to take effect. Also note the custom .link file should be created in /etc/systemd/network and not in /lib/systemd/network (either will work but best practice is to use /etc/systemd/network since that's what its there for - to allow for custom .link files that override the defaults in /lib/systemd/network).







                  share|improve this answer










                  New contributor




                  dwillis77 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer








                  edited 35 mins ago





















                  New contributor




                  dwillis77 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 2 hours ago









                  dwillis77dwillis77

                  12




                  12




                  New contributor




                  dwillis77 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  dwillis77 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  dwillis77 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f783457%2frenaming-network-interface-in-ubuntu-16-04-with-systemd-fails%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      香粉寮

                      GameSpot