Preserve /etc/network/interfaces configuration when changing PCIe cards

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I have several NICs in my Ubuntu 16.04 box (3 of them at the moment). As best I can tell their names are related to their PCIe names. My problem is that when I add or remove a card of any type (graphics, HBA, etc) the interface names seem to change and then the booting hangs for several minutes trying to bring the network up. If I have to reboot several times then this really adds up.



This is my /etc/network/interfaces:



auto lo
iface lo inet loopback

auto enp8s0
iface enp8s0 inet manual

auto enp5s0
iface enp5s0 inet manual

auto enp6s0f0
iface enp6s0f0 inet manual

auto enp6s0f1
iface enp6s0f1 inet manual

auto br0
iface br0 inet dhcp
hwaddress 50:e5:49:ed:72:3d
bridge_ports enp8s0 enp6s0f0 enp6s0f1 enp5s0
bridge_stp off









share|improve this question





















  • did you look into persistent-net-rules for udev ?
    – Robert Riedl
    Feb 8 at 15:45










  • @RobertRiedl I haven't (never heard of those things), but I will.
    – chew socks
    Feb 8 at 20:11















up vote
0
down vote

favorite












I have several NICs in my Ubuntu 16.04 box (3 of them at the moment). As best I can tell their names are related to their PCIe names. My problem is that when I add or remove a card of any type (graphics, HBA, etc) the interface names seem to change and then the booting hangs for several minutes trying to bring the network up. If I have to reboot several times then this really adds up.



This is my /etc/network/interfaces:



auto lo
iface lo inet loopback

auto enp8s0
iface enp8s0 inet manual

auto enp5s0
iface enp5s0 inet manual

auto enp6s0f0
iface enp6s0f0 inet manual

auto enp6s0f1
iface enp6s0f1 inet manual

auto br0
iface br0 inet dhcp
hwaddress 50:e5:49:ed:72:3d
bridge_ports enp8s0 enp6s0f0 enp6s0f1 enp5s0
bridge_stp off









share|improve this question





















  • did you look into persistent-net-rules for udev ?
    – Robert Riedl
    Feb 8 at 15:45










  • @RobertRiedl I haven't (never heard of those things), but I will.
    – chew socks
    Feb 8 at 20:11













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have several NICs in my Ubuntu 16.04 box (3 of them at the moment). As best I can tell their names are related to their PCIe names. My problem is that when I add or remove a card of any type (graphics, HBA, etc) the interface names seem to change and then the booting hangs for several minutes trying to bring the network up. If I have to reboot several times then this really adds up.



This is my /etc/network/interfaces:



auto lo
iface lo inet loopback

auto enp8s0
iface enp8s0 inet manual

auto enp5s0
iface enp5s0 inet manual

auto enp6s0f0
iface enp6s0f0 inet manual

auto enp6s0f1
iface enp6s0f1 inet manual

auto br0
iface br0 inet dhcp
hwaddress 50:e5:49:ed:72:3d
bridge_ports enp8s0 enp6s0f0 enp6s0f1 enp5s0
bridge_stp off









share|improve this question













I have several NICs in my Ubuntu 16.04 box (3 of them at the moment). As best I can tell their names are related to their PCIe names. My problem is that when I add or remove a card of any type (graphics, HBA, etc) the interface names seem to change and then the booting hangs for several minutes trying to bring the network up. If I have to reboot several times then this really adds up.



This is my /etc/network/interfaces:



auto lo
iface lo inet loopback

auto enp8s0
iface enp8s0 inet manual

auto enp5s0
iface enp5s0 inet manual

auto enp6s0f0
iface enp6s0f0 inet manual

auto enp6s0f1
iface enp6s0f1 inet manual

auto br0
iface br0 inet dhcp
hwaddress 50:e5:49:ed:72:3d
bridge_ports enp8s0 enp6s0f0 enp6s0f1 enp5s0
bridge_stp off






16.04 networking pci pcie






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 7 at 21:03









chew socks

14419




14419











  • did you look into persistent-net-rules for udev ?
    – Robert Riedl
    Feb 8 at 15:45










  • @RobertRiedl I haven't (never heard of those things), but I will.
    – chew socks
    Feb 8 at 20:11

















  • did you look into persistent-net-rules for udev ?
    – Robert Riedl
    Feb 8 at 15:45










  • @RobertRiedl I haven't (never heard of those things), but I will.
    – chew socks
    Feb 8 at 20:11
















did you look into persistent-net-rules for udev ?
– Robert Riedl
Feb 8 at 15:45




did you look into persistent-net-rules for udev ?
– Robert Riedl
Feb 8 at 15:45












@RobertRiedl I haven't (never heard of those things), but I will.
– chew socks
Feb 8 at 20:11





@RobertRiedl I haven't (never heard of those things), but I will.
– chew socks
Feb 8 at 20:11











1 Answer
1






active

oldest

votes

















up vote
1
down vote













Udev has a mechanism to fixate the name of network devices




First, take note of your interfaces mac-addresses. You can see them with ip a or ifconfig -a



Second, the file /etc/udev/rules.d/70-persistent-net.rules has to be created manually in 16.04.



Use your favorite editor



sudo nano /etc/udev/rules.d/70-persistent-net.rules


The line for fixing the interface name of the NIC with MAC address "02:01:02:03:04:05" to "eth0" is:



SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTRaddress=="02:01:02:03:04:05", ATTRdev_id=="0x0", ATTRtype=="1", NAME="eth0"


So for your first interface called enp8s0it would be



SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTRaddress=="<the-mac-address>", ATTRdev_id=="0x0", ATTRtype=="1", NAME="enp8s0"


You have to make an entry for each network card. This takes effect on reboot.




  • Disclaimer: For Ubuntu versions before 16.04 you have to add KERNEL=="eth*" *





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',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    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%2f1004017%2fpreserve-etc-network-interfaces-configuration-when-changing-pcie-cards%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    Udev has a mechanism to fixate the name of network devices




    First, take note of your interfaces mac-addresses. You can see them with ip a or ifconfig -a



    Second, the file /etc/udev/rules.d/70-persistent-net.rules has to be created manually in 16.04.



    Use your favorite editor



    sudo nano /etc/udev/rules.d/70-persistent-net.rules


    The line for fixing the interface name of the NIC with MAC address "02:01:02:03:04:05" to "eth0" is:



    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTRaddress=="02:01:02:03:04:05", ATTRdev_id=="0x0", ATTRtype=="1", NAME="eth0"


    So for your first interface called enp8s0it would be



    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTRaddress=="<the-mac-address>", ATTRdev_id=="0x0", ATTRtype=="1", NAME="enp8s0"


    You have to make an entry for each network card. This takes effect on reboot.




    • Disclaimer: For Ubuntu versions before 16.04 you have to add KERNEL=="eth*" *





    share|improve this answer
























      up vote
      1
      down vote













      Udev has a mechanism to fixate the name of network devices




      First, take note of your interfaces mac-addresses. You can see them with ip a or ifconfig -a



      Second, the file /etc/udev/rules.d/70-persistent-net.rules has to be created manually in 16.04.



      Use your favorite editor



      sudo nano /etc/udev/rules.d/70-persistent-net.rules


      The line for fixing the interface name of the NIC with MAC address "02:01:02:03:04:05" to "eth0" is:



      SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTRaddress=="02:01:02:03:04:05", ATTRdev_id=="0x0", ATTRtype=="1", NAME="eth0"


      So for your first interface called enp8s0it would be



      SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTRaddress=="<the-mac-address>", ATTRdev_id=="0x0", ATTRtype=="1", NAME="enp8s0"


      You have to make an entry for each network card. This takes effect on reboot.




      • Disclaimer: For Ubuntu versions before 16.04 you have to add KERNEL=="eth*" *





      share|improve this answer






















        up vote
        1
        down vote










        up vote
        1
        down vote









        Udev has a mechanism to fixate the name of network devices




        First, take note of your interfaces mac-addresses. You can see them with ip a or ifconfig -a



        Second, the file /etc/udev/rules.d/70-persistent-net.rules has to be created manually in 16.04.



        Use your favorite editor



        sudo nano /etc/udev/rules.d/70-persistent-net.rules


        The line for fixing the interface name of the NIC with MAC address "02:01:02:03:04:05" to "eth0" is:



        SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTRaddress=="02:01:02:03:04:05", ATTRdev_id=="0x0", ATTRtype=="1", NAME="eth0"


        So for your first interface called enp8s0it would be



        SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTRaddress=="<the-mac-address>", ATTRdev_id=="0x0", ATTRtype=="1", NAME="enp8s0"


        You have to make an entry for each network card. This takes effect on reboot.




        • Disclaimer: For Ubuntu versions before 16.04 you have to add KERNEL=="eth*" *





        share|improve this answer












        Udev has a mechanism to fixate the name of network devices




        First, take note of your interfaces mac-addresses. You can see them with ip a or ifconfig -a



        Second, the file /etc/udev/rules.d/70-persistent-net.rules has to be created manually in 16.04.



        Use your favorite editor



        sudo nano /etc/udev/rules.d/70-persistent-net.rules


        The line for fixing the interface name of the NIC with MAC address "02:01:02:03:04:05" to "eth0" is:



        SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTRaddress=="02:01:02:03:04:05", ATTRdev_id=="0x0", ATTRtype=="1", NAME="eth0"


        So for your first interface called enp8s0it would be



        SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTRaddress=="<the-mac-address>", ATTRdev_id=="0x0", ATTRtype=="1", NAME="enp8s0"


        You have to make an entry for each network card. This takes effect on reboot.




        • Disclaimer: For Ubuntu versions before 16.04 you have to add KERNEL=="eth*" *






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 9 at 7:39









        Robert Riedl

        2,740623




        2,740623



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1004017%2fpreserve-etc-network-interfaces-configuration-when-changing-pcie-cards%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

            Trouble downloading packages list due to a “Hash sum mismatch” error

            How do I move numbers in filenames, in a batch renaming operation?