Solved

I have disabled CNDN but cannot define the order of ethX

Posted on 2014-11-07
14
45 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
ID: 40428347
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
ID: 40428392
Can you still disable NetworkManager service and enable network service ?
0
 
LVL 62

Expert Comment

by:gheist
ID: 40430017
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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

Author Comment

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

Author Comment

by:mickt
ID: 40432180
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
ID: 40432213
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 62

Expert Comment

by:gheist
ID: 40432222
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
 

Author Comment

by:mickt
ID: 40432246
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
ID: 40432370
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 62

Expert Comment

by:gheist
ID: 40432430
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
ID: 40432437
It is not creating the files.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40432468
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
ID: 40464401
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
ID: 40905861
configured bond0 on each server
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Full Backup software for Linux 5 67
FTP output from Wireshak 6 90
Using init script with Systemd: need help crafting unit file 11 111
Use CRON to save a copy of an open file 1 40
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 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