11

On Fedora/RHEL/CentOS there is a line in /etc/sysconfig/network-scripts/ifcfg-x files which defines UUID:

UUID=30fcd648-ad1e-4428-as6f-951e8e4d16df

NICs have MAC addresses by them selves, so what is the purpose of pointing UUIDs to NICs when there is already an identification number (MAC) and also unlike file systems UUIDs they can't be stored on device itself?

  • 3
    Not all network interfaces are Ethernet. Serial interfaces and TUN interfaces (and probably many more) do not have MACs. Though, I'm not sure what RedHat uses those UUIDs for. – derobert Aug 2 '14 at 2:35
12

Ethernet cards might have (supposedly) unique MAC addresses, but what about virtual interfaces like aliases (e.g. eth0:0), bridges or VPNs? They need an ID too, so an UUID would be a good fit.

By the way, since the question is about NetworkManager and NetworkManager deals with connections, there are scenarios where you can have multiple connections for a device. For example you have a laptop with an Ethernet card which you use both at home and at work. At home you're using only IPv4 like most home users, but at work you're using only IPv6 because the company managed to migrate to it. So you have two different connections which need different IDs, so the MAC address of the Ethernet card can't be used by itself. Therefore an UUID is again a good fit for an ID.

  • 2
    Virtual Adapters Have Virtual MAC too, seems that is used by network manager itself: centos.org/forums/viewtopic.php?t=8524 – Sudoer Aug 2 '14 at 2:13
  • how is the uuid for the ethernet created? How is the UUID in the ifcfg-eth0 file for home and work related to the device itself? – mcr Aug 5 '16 at 1:06
  • 1
    @mcr, I don't think it matters what kind the UUID is, as long as it's an UUID. So you could use the command line program uuidgen (from util-linux) to generate one. – Cristian Ciupitu Aug 5 '16 at 14:31
0

Sounds like UUID for NIC should be a very limited case. I can regen a UUID for nic in a second and invalidate my ifcfg-ens32 (or whatever device name) config file. Sounds like we should remove UUID from the default NIC configuration model, and only use it for VirtualIP as found in HA solutions? They seem too transient to be reliable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.