Solved

I have disabled CNDN but cannot define the order of ethX

Posted on 2014-11-07
14
42 Views
Last Modified: 2015-07-30
I need to restore "eth" naming on my CentOS7 servers so that I can continue using various scripts.  I have disabled Consistent Network Device Naming by adding net.ifnames=0 to grub and have renamed and edited the ifcfg files and also created a persistent-net.rules file.  I did not install the biosdevname RPM hence no reference in grub.

Let's follow MAC, d8:d3:85:c4:a2:f0, which should be eth0.

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
BOOTPROTO=none
HWADDR=d8:d3:85:c4:a2:f0
ONBOOT=yes
NETBOOT=yes
IPADDR0=10.10.12.9
NETMASK0=255.255.255.0
GATEWAY0=10.10.12.1
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes

# cat /etc/udev/rules.d/70-persistent-net.rules
"SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d8:d3:85:c4:a2:f0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
"SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d8:d3:85:c4:a2:f4", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
"SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="9c:8e:99:29:45:48", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
"SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="9c:8e:99:29:45:4a", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
"SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="68:b5:99:cb:4e:18", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"
"SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="68:b5:99:cb:4e:1a", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"

# ifconfig eth0
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 9c:8e:99:29:45:48  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

# ifconfig eth4
eth4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.10.12.9  netmask 255.255.255.0  broadcast 10.10.12.255
        inet6 fe80::dad3:85ff:fec4:a2f0  prefixlen 64  scopeid 0x20<link>
        ether d8:d3:85:c4:a2:f0  txqueuelen 1000  (Ethernet)
        RX packets 10640  bytes 724244 (707.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 42762  bytes 11489169 (10.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 28  memory 0xf1000000-f17fffff

Did I miss something during the configuration?
0
Comment
Question by:mickt
  • 9
  • 4
14 Comments
 

Author Comment

by:mickt
Comment Utility
I just noticed that the UUID is missing from the ifcfg files.  I'll add it and see how it goes.


Another thing is that not every interface has an ifcfg file (before disabling CNDN).  Anyone know why this might be?
0
 
LVL 7

Expert Comment

by:Stampel
Comment Utility
Can you still disable NetworkManager service and enable network service ?
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
You dont need UUID, MAC is alrady globally unique.
MAC in your ifcfg is from ETH3, so you need to rename that ifcfg file ifcfg-eth3 and make sure interface is eth3, otherwise networking scripts will ignore that file.
0
 

Author Comment

by:mickt
Comment Utility
When I disable NetworkManager and enable network service only lo come up.  messages indicates incorrect MAC for eth0.
0
 

Author Comment

by:mickt
Comment Utility
gheist:
Why do you say eth3?  I set MAC d8:d3:85:c4:a2:f0 in both ifcfg-eth0 and 70-persistent-net.rules.  It is coming up as eth4 despite this configuration.
0
 

Author Comment

by:mickt
Comment Utility
The ifconfig eth0 command above shows MAC (9c:8e:99:29:45:48) from eth2 as per ifcfg-eth2 and 70-persistent-net.rules files, not the one for eth0 as expected.

The 70-persistent-net.rules entries shown above directly correlate with the new ifcfg-ethX files.

If I create ifcfg files and 70-persistent-net.rules file with specific correlated MAC addresses, why do they not come up as so but appear with different ones when checked with ifconfig?

Where does ifconfig get it's information from?
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
remove udev persistent rules and reboot to re-generate them
then adjust ifcfg-eth* files to match the new world.
then "service network restart"

I think you missed wiping udev dynamic rules when dumping the "biosdevnames"
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:mickt
Comment Utility
There was no rules file after initial boot.  I created it in the hope that it would associate MAC with interface etc. but it seems that it doesn't.

An important thing of note here is that this was a fully working server on CentOS6 with this NIC as eth0 (the physical network is connected to this NIC).

I have multiple servers and require specific interfaces on specific NICs due to NIC speeds etc.
0
 

Author Comment

by:mickt
Comment Utility
Here are the interfaces before I make changes.  The 1st is what I want as eth0.  It is one of two interfaces on the embedded NIC.  The remaining interfaces are on two mezz cards.  Basically all I'm trying to do is make enp2s0f0 eth0.  The contents of ifcfg-eth0 is what was ifcfg-enp2s0f0 with appropriate changes.

Who'd have thought it would be so difficult?! :)

# ifconfig
enp2s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.10.12.9  netmask 255.255.255.0  broadcast 10.10.12.255
        inet6 fe80::dad3:85ff:fec4:a2f0  prefixlen 64  scopeid 0x20<link>
        ether d8:d3:85:c4:a2:f0  txqueuelen 1000  (Ethernet)
        RX packets 421  bytes 30447 (29.7 KiB)
        RX errors 0  dropped 4  overruns 0  frame 0
        TX packets 84  bytes 12849 (12.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 28  memory 0xf1000000-f17fffff

enp2s0f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::dad3:85ff:fec4:a2f4  prefixlen 64  scopeid 0x20<link>
        ether d8:d3:85:c4:a2:f4  txqueuelen 1000  (Ethernet)
        RX packets 5  bytes 700 (700.0 B)
        RX errors 0  dropped 2  overruns 0  frame 0
        TX packets 14  bytes 2268 (2.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 40  memory 0xf0000000-f07fffff

ens1f0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 9c:8e:99:29:45:48  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens1f1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 9c:8e:99:29:45:4a  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens2f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::6ab5:99ff:fecb:4e18  prefixlen 64  scopeid 0x20<link>
        ether 68:b5:99:cb:4e:18  txqueuelen 1000  (Ethernet)
        RX packets 432  bytes 29084 (28.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 17  bytes 2490 (2.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens2f1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 68:b5:99:cb:4e:1a  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 6  bytes 560 (560.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 560 (560.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
Boot, let it create default udev rules
then adjust udev rules, reboot again and check ifconfig if MACs are correct.
0
 

Author Comment

by:mickt
Comment Utility
It is not creating the files.
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
It is not the udev we are used to, it is another thing:
http://www.freedesktop.org/software/systemd/man/systemd-udevd.service.html
0
 

Accepted Solution

by:
mickt earned 0 total points
Comment Utility
I'll need to revisit this later as it is still not working as expected.  I've a temp work around using bonding.
0
 

Author Closing Comment

by:mickt
Comment Utility
configured bond0 on each server
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Users are often faced with high disk consumption without really knowing where the largest amount of data resides. Disk Usage Analyzer (aka Baobab) is is a graphical, menu-driven application to analyse disk usage in any Gnome environment and can e…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now