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

Clash 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
16.04 networking pci pcie
add a comment |Â
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
16.04 networking pci pcie
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
add a comment |Â
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
16.04 networking pci pcie
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
16.04 networking pci pcie
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
add a comment |Â
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
add a comment |Â
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*"*
add a comment |Â
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*"*
add a comment |Â
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*"*
add a comment |Â
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*"*
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*"*
answered Feb 9 at 7:39
Robert Riedl
2,740623
2,740623
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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