How to Set/Get UUID for a NIC

Paweł Brodacki pawel.brodacki at gmail.com
Fri Jan 11 15:13:09 UTC 2013


2013/1/9 Alan Cox <alan at lxorguk.ukuu.org.uk>:
> On Wed, 9 Jan 2013 09:37:05 -0600 (CST)
> Michael Hennebry <hennebry at web.cs.ndsu.nodak.edu> wrote:
>
>> On Wed, 9 Jan 2013, Khemara Lyn wrote:
>>
>> > Ok, thank you; it's that simple! I've thought about it in a harder way.
>>
>> Actually, it's even easier.
>> NICs come with built-in six-byte MAC adddresses
>> that are supposed to be unique.
>
> They are supposed to be unique *per machine* - you can have two nics on
> the same machine with the same MAC although this is rare.
>
> Alan

Alan, please, verify information before dissemination.
MAC address assigned to a physical NIC ought to be globally unique.
Ethernet frames are sent to MAC address, so two identical addresses
present in any broadcast domain would awfully confuse network
switches. See e.g. Wikipedia article on MAC
https://en.wikipedia.org/wiki/MAC_address. Hardware producers reserve
prefixes (first 3 bytes of the address) and are responsible for not
manufacturing devices with identical suffixes (last 3 bytes of the
address). This should result in globally unique MAC addresses, however
I did encounter NICs with identical ones (cheap stuff of unknown and
dubious provenance).

Khemara,
If you use NetworkManager, then it will present you with graphical
tool for configuration of NICs and it will handle identification for
you. I think it will also generate a UUID for the card and put it into
its config file.
However, the required and sufficient entry mapping physical device to
logical one is HWADDR="xx:yy:zz:aa:bb:cc" line, where
xx:yy:zz:aa:bb:cc from this example would be replaced by the real MAC
address of your card.  UUID line is for NetworkManager's benefit, see
also discussion in the list here:
https://lists.fedoraproject.org/pipermail/users/2011-May/396591.html.
You can determine NIC's MAC address by running
ip addr show <device_name>
In my KVM F18 guest it produces:
$ ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP qlen 1000
    link/ether 52:54:00:42:1d:c6 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.150/24 brd 192.168.122.255 scope global eth0
    inet6 fe80::5054:ff:fe42:1dc6/64 scope link
       valid_lft forever preferred_lft forever
$
The card's MAC address is also present in the ifcfg-eth0 file:
$ cat ifcfg-eth0
UUID="06693902-df40-49f6-8f0e-c7bac49531c7"
NM_CONTROLLED="yes"
HWADDR="52:54:00:42:1D:C6"
BOOTPROTO="dhcp"
DEVICE="eth0"
ONBOOT="yes"
$

HTH,
Paweł


More information about the users mailing list