Properly disabling predictable interface naming on Xenial












3















I'm running a few Ubuntu Xenial instances on an Openstack private cloud, and running into trouble with predictable network interface naming. I've tried to disable it by setting GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" in /etc/default/grub. After rebooting, the first network interface still has its old 'predictable' name (ens3), but the second interface has its old name (eth1).



dmesg has [ 1.403328] virtio_net virtio0 ens3: renamed from eth0



How do I configure Ubuntu so my first network interface is named eth0?










share|improve this question














bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • As far as I recall it should be GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1 biosdevname=0"

    – Doug Smythies
    Jul 27 '16 at 0:33






  • 1





    net.ifnames=1 enables 'predictable' names (ens3 etc)

    – insertjokehere
    Jul 27 '16 at 2:04











  • Yes, it seems inconsistent. What I mentioned used to work on 14.04. I gave up on 16.04, and now use the new interface names. see also here and here.

    – Doug Smythies
    Jul 27 '16 at 15:23


















3















I'm running a few Ubuntu Xenial instances on an Openstack private cloud, and running into trouble with predictable network interface naming. I've tried to disable it by setting GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" in /etc/default/grub. After rebooting, the first network interface still has its old 'predictable' name (ens3), but the second interface has its old name (eth1).



dmesg has [ 1.403328] virtio_net virtio0 ens3: renamed from eth0



How do I configure Ubuntu so my first network interface is named eth0?










share|improve this question














bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • As far as I recall it should be GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1 biosdevname=0"

    – Doug Smythies
    Jul 27 '16 at 0:33






  • 1





    net.ifnames=1 enables 'predictable' names (ens3 etc)

    – insertjokehere
    Jul 27 '16 at 2:04











  • Yes, it seems inconsistent. What I mentioned used to work on 14.04. I gave up on 16.04, and now use the new interface names. see also here and here.

    – Doug Smythies
    Jul 27 '16 at 15:23
















3












3








3








I'm running a few Ubuntu Xenial instances on an Openstack private cloud, and running into trouble with predictable network interface naming. I've tried to disable it by setting GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" in /etc/default/grub. After rebooting, the first network interface still has its old 'predictable' name (ens3), but the second interface has its old name (eth1).



dmesg has [ 1.403328] virtio_net virtio0 ens3: renamed from eth0



How do I configure Ubuntu so my first network interface is named eth0?










share|improve this question














I'm running a few Ubuntu Xenial instances on an Openstack private cloud, and running into trouble with predictable network interface naming. I've tried to disable it by setting GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" in /etc/default/grub. After rebooting, the first network interface still has its old 'predictable' name (ens3), but the second interface has its old name (eth1).



dmesg has [ 1.403328] virtio_net virtio0 ens3: renamed from eth0



How do I configure Ubuntu so my first network interface is named eth0?







networking 16.04 systemd






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 26 '16 at 22:55









insertjokehereinsertjokehere

11612




11612





bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • As far as I recall it should be GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1 biosdevname=0"

    – Doug Smythies
    Jul 27 '16 at 0:33






  • 1





    net.ifnames=1 enables 'predictable' names (ens3 etc)

    – insertjokehere
    Jul 27 '16 at 2:04











  • Yes, it seems inconsistent. What I mentioned used to work on 14.04. I gave up on 16.04, and now use the new interface names. see also here and here.

    – Doug Smythies
    Jul 27 '16 at 15:23





















  • As far as I recall it should be GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1 biosdevname=0"

    – Doug Smythies
    Jul 27 '16 at 0:33






  • 1





    net.ifnames=1 enables 'predictable' names (ens3 etc)

    – insertjokehere
    Jul 27 '16 at 2:04











  • Yes, it seems inconsistent. What I mentioned used to work on 14.04. I gave up on 16.04, and now use the new interface names. see also here and here.

    – Doug Smythies
    Jul 27 '16 at 15:23



















As far as I recall it should be GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1 biosdevname=0"

– Doug Smythies
Jul 27 '16 at 0:33





As far as I recall it should be GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=1 biosdevname=0"

– Doug Smythies
Jul 27 '16 at 0:33




1




1





net.ifnames=1 enables 'predictable' names (ens3 etc)

– insertjokehere
Jul 27 '16 at 2:04





net.ifnames=1 enables 'predictable' names (ens3 etc)

– insertjokehere
Jul 27 '16 at 2:04













Yes, it seems inconsistent. What I mentioned used to work on 14.04. I gave up on 16.04, and now use the new interface names. see also here and here.

– Doug Smythies
Jul 27 '16 at 15:23







Yes, it seems inconsistent. What I mentioned used to work on 14.04. I gave up on 16.04, and now use the new interface names. see also here and here.

– Doug Smythies
Jul 27 '16 at 15:23












2 Answers
2






active

oldest

votes


















0














Edit your /etc/udev/rules.d/70-persistent-net.rules. The format is pretty simple. Only 1 line per interface, and just copy/paste an existing line, and change the mac address and the device name.



Here's what an entry looks like:



# PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="20:1a:06:d8:65:ae", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"





share|improve this answer
























  • That's fine when you've got a couple of machines, but trying to scale that to dozens or hundreds of machines isn't really viable. Besides, that's just undoing the change after its been made, what I'm trying to is stop it from being renamed in the first place

    – insertjokehere
    Jul 27 '16 at 1:59



















0














I think that the cleaner solution is:



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


and reboot. This will bring back the old interface naming.



If you want to assign specific network interfaces names, and you have persistent mac addresses, then you can follow heynnema's solution or use a systemd.link.






share|improve this answer

























    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%2f803322%2fproperly-disabling-predictable-interface-naming-on-xenial%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Edit your /etc/udev/rules.d/70-persistent-net.rules. The format is pretty simple. Only 1 line per interface, and just copy/paste an existing line, and change the mac address and the device name.



    Here's what an entry looks like:



    # PCI device 0x10ec:0x8168 (r8169)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="20:1a:06:d8:65:ae", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"





    share|improve this answer
























    • That's fine when you've got a couple of machines, but trying to scale that to dozens or hundreds of machines isn't really viable. Besides, that's just undoing the change after its been made, what I'm trying to is stop it from being renamed in the first place

      – insertjokehere
      Jul 27 '16 at 1:59
















    0














    Edit your /etc/udev/rules.d/70-persistent-net.rules. The format is pretty simple. Only 1 line per interface, and just copy/paste an existing line, and change the mac address and the device name.



    Here's what an entry looks like:



    # PCI device 0x10ec:0x8168 (r8169)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="20:1a:06:d8:65:ae", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"





    share|improve this answer
























    • That's fine when you've got a couple of machines, but trying to scale that to dozens or hundreds of machines isn't really viable. Besides, that's just undoing the change after its been made, what I'm trying to is stop it from being renamed in the first place

      – insertjokehere
      Jul 27 '16 at 1:59














    0












    0








    0







    Edit your /etc/udev/rules.d/70-persistent-net.rules. The format is pretty simple. Only 1 line per interface, and just copy/paste an existing line, and change the mac address and the device name.



    Here's what an entry looks like:



    # PCI device 0x10ec:0x8168 (r8169)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="20:1a:06:d8:65:ae", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"





    share|improve this answer













    Edit your /etc/udev/rules.d/70-persistent-net.rules. The format is pretty simple. Only 1 line per interface, and just copy/paste an existing line, and change the mac address and the device name.



    Here's what an entry looks like:



    # PCI device 0x10ec:0x8168 (r8169)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="20:1a:06:d8:65:ae", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jul 27 '16 at 1:50









    heynnemaheynnema

    20.2k22258




    20.2k22258













    • That's fine when you've got a couple of machines, but trying to scale that to dozens or hundreds of machines isn't really viable. Besides, that's just undoing the change after its been made, what I'm trying to is stop it from being renamed in the first place

      – insertjokehere
      Jul 27 '16 at 1:59



















    • That's fine when you've got a couple of machines, but trying to scale that to dozens or hundreds of machines isn't really viable. Besides, that's just undoing the change after its been made, what I'm trying to is stop it from being renamed in the first place

      – insertjokehere
      Jul 27 '16 at 1:59

















    That's fine when you've got a couple of machines, but trying to scale that to dozens or hundreds of machines isn't really viable. Besides, that's just undoing the change after its been made, what I'm trying to is stop it from being renamed in the first place

    – insertjokehere
    Jul 27 '16 at 1:59





    That's fine when you've got a couple of machines, but trying to scale that to dozens or hundreds of machines isn't really viable. Besides, that's just undoing the change after its been made, what I'm trying to is stop it from being renamed in the first place

    – insertjokehere
    Jul 27 '16 at 1:59













    0














    I think that the cleaner solution is:



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


    and reboot. This will bring back the old interface naming.



    If you want to assign specific network interfaces names, and you have persistent mac addresses, then you can follow heynnema's solution or use a systemd.link.






    share|improve this answer






























      0














      I think that the cleaner solution is:



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


      and reboot. This will bring back the old interface naming.



      If you want to assign specific network interfaces names, and you have persistent mac addresses, then you can follow heynnema's solution or use a systemd.link.






      share|improve this answer




























        0












        0








        0







        I think that the cleaner solution is:



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


        and reboot. This will bring back the old interface naming.



        If you want to assign specific network interfaces names, and you have persistent mac addresses, then you can follow heynnema's solution or use a systemd.link.






        share|improve this answer















        I think that the cleaner solution is:



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


        and reboot. This will bring back the old interface naming.



        If you want to assign specific network interfaces names, and you have persistent mac addresses, then you can follow heynnema's solution or use a systemd.link.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 15 '18 at 12:27

























        answered Apr 15 '18 at 11:16









        chefarovchefarov

        1114




        1114






























            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%2f803322%2fproperly-disabling-predictable-interface-naming-on-xenial%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

            How did Captain America manage to do this?

            迪纳利

            南乌拉尔铁路局