NetworkManager off --> HWADDR required ?

Issues related to configuring your network
Post Reply
airprakken
Posts: 3
Joined: 2014/03/11 15:33:36

NetworkManager off --> HWADDR required ?

Post by airprakken » 2015/01/04 22:51:55

CentOS 7 minimal ISO installed as VM under VMware Player (but got same result with Qemu/KVM). All fully updated.

Following the most common opinion here I disabled NetworkManager in the VM. Then it seems that I MUST have HWADDR in ifcfg-eth0 (or whatever). Without it, the interface refuses to come up -- rejected in ifup-eth. Clearly the system already knows it's MAC and everything else seems OK. This is certainly a change from CentOS 6 where HWADDR was NOT required to be in the file.

If I enable NetworkManager, then it handles the MAC address and HWADDR is not required in ifcfg-*

Why do I care: I'm planning to deliver a minimal VM as part of a product. A clone ,OVA is delivered to customers who may know little about Linux internals. It just installs and runs on VMware ESXi or Worstation or Player. On CentOS 6 I make this work by deleting /etc/udev/rules.d/70-persistent-net.rules and turning off udev-post.

So, if I were to move to CentOS 7 for this VM, it appears to me that I would have to run NetworkManager. Is this true or is there something else somebody knows which would help?

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: NetworkManager off --> HWADDR required ?

Post by Super Jamie » 2015/01/05 05:35:23

Yes, use NetworkManager. You can control it graphicall with nm-applet, or on the commandline with nmcli (a commandline) or nmtui (a gui similar to the graphical mode).

NM sucked on EL6 and could not handle anything very complex, like bridges or bonds. It also tended to conflict with the initscripts network service.

In EL7, NM is great and can manage all interface types reliably. I use it in all my EL7 systems and recommend everyone do the same.

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: NetworkManager off --> HWADDR required ?

Post by aks » 2015/01/05 19:21:48

The MAC address has always been required in all versions of Centos - otherwise how does the computer "know" which interface is which interface when the only unique thing about them is the MAC address?

I agree NM has grown up alot more than it's been for ages now (unless you've been Fedora - then it's been grown up for quite a while now).

Use NM - it's a little more complex, but can do some very complex networking stuff.

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: NetworkManager off --> HWADDR required ?

Post by Super Jamie » 2015/01/05 23:38:48

aks wrote:The MAC address has always been required in all versions of Centos
I don't believe it was required in EL6 as devices are named by udev. As long as the ifcfg-ethX and DEVICE entry within that file match the name in udev, everything works fine without HWADDR.

HWADDR was definitely required in EL5, this is how the udev helper binary and script actually detect devices and rename them from ___tmpXXX.

airprakken
Posts: 3
Joined: 2014/03/11 15:33:36

Re: NetworkManager off --> HWADDR required ?

Post by airprakken » 2015/01/06 19:39:16

C7 clearly knows at lower levels what its MAC address is. For example:

I have a C7 VM running here under VMware:
- NetworkManager disabled and not running
- HWADDR commented out in ifcfg-eno16777736 (If I uncomment HWADDR everything works fine)

systemctl status network:
...ifup-eth[1158]: Device does not seem to be present...
Failed to start LSB: ...
Unit network.service entered failed state

ip a shows the correct mac address

/sys/class/net/eno16777736/address contains the correct mac address

I can see the code in ifup-eth where it is checking for HWADDR and failing. I believe I could write my own "first boot" code to ask the system what the MAC is and insert it in the ifcfg-eno... file. But that would be too weird.

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: NetworkManager off --> HWADDR required ?

Post by aks » 2015/01/06 20:13:25

Additionally in 7, I've found using rich rules in firewalld required me to change the MAC address (HWADDR) in ifcfg-ethx, otherwise moving the interface into a new customised zone would fail. I don't know why (these where cloned VMs, without any sysprep). Also in 6 I found a problem whereby the new MAC would be added as eth1 (say as opposed to eth0) and the ifcfg-eth0 would not be executed as eth0 was not eth1 thanks to udev (the persistent network names thing - also on cloned and non syspreped machines). Yes I'm aware this *should* be a function of cloneing and not of CentOS itself (after all CentOS does not "know" it's been cloned).
I'm not sure why that *seems* to be the case with the firewalld thing though.

Post Reply