13

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?

garethTheRed
  • 33,957
  • 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 02 '14 at 02:35

2 Answers2

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: https://www.centos.org/forums/viewtopic.php?t=8524 – Microsoft Linux TM Aug 02 '14 at 02:13
  • 1
    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 05 '16 at 01: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 05 '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.