Dear All,
Sorry if this had been covered before.
How can I set or get the UUID for a NIC? I have installed new system, initially with a single NIC; now I've added another NIC and would like to create a new UUID to be used in the new network-script file (e.g. ifcfg-em2).
I did some searches over Google and found related topics on hard disk partitions only (such as blkid /dev/sda1, ls -l /dev/disk/by_uuid); but none of the them covers the UUID for a NIC.
I understand that, we can create a new network-script file without the UUID. However, i'm still curious of how it can be done.
Thanks in advance for any help or comment.
Regards, Khem
On 01/09/2013 10:55 AM, Khemara Lyn wrote:
Dear All,
Sorry if this had been covered before.
How can I set or get the UUID for a NIC? I have installed new system, initially with a single NIC; now I've added another NIC and would like to create a new UUID to be used in the new network-script file (e.g. ifcfg-em2).
I did some searches over Google and found related topics on hard disk partitions only (such as blkid /dev/sda1, ls -l /dev/disk/by_uuid); but none of the them covers the UUID for a NIC.
I understand that, we can create a new network-script file without the UUID. However, i'm still curious of how it can be done.
Thanks in advance for any help or comment.
Simply run uuidgen to create one
Ok, thank you; it's that simple! I've thought about it in a harder way.
Regards, Khem
On 01/09/2013 01:09 PM, Ed Greshko wrote:
On 01/09/2013 10:55 AM, Khemara Lyn wrote:
Dear All,
Sorry if this had been covered before.
How can I set or get the UUID for a NIC? I have installed new system, initially with a single NIC; now I've added another NIC and would like to create a new UUID to be used in the new network-script file (e.g. ifcfg-em2).
I did some searches over Google and found related topics on hard disk partitions only (such as blkid /dev/sda1, ls -l /dev/disk/by_uuid); but none of the them covers the UUID for a NIC.
I understand that, we can create a new network-script file without the UUID. However, i'm still curious of how it can be done.
Thanks in advance for any help or comment.
Simply run uuidgen to create one
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 not random. ifconfig will give them to you.
From googling, I gather that network cards can have UUIDs.
So far I cannot find one for my eth0. Maybe that is because my network card is the motherboard. My ifcfg-eth0 does not mention a UUID. network-functions does have UUID. get_uuid_by_config seems to be at least one way to fetch a value, but I don't understand it.
uuidgen emits a UUID to standard out. It does not directly affect any NIC.
On 01/09/2013 01:09 PM, Ed Greshko wrote:
On 01/09/2013 10:55 AM, Khemara Lyn wrote:
Dear All,
Sorry if this had been covered before.
How can I set or get the UUID for a NIC? I have installed new system,
initially with a single NIC; now I've added another NIC and would like to create a new UUID to be used in the new network-script file (e.g. ifcfg-em2).
Simply run uuidgen to create one
On Wed, 9 Jan 2013 09:37:05 -0600 (CST) Michael Hennebry hennebry@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
On 01/09/2013 09:07 PM, Michael Hennebry 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 not random. ifconfig will give them to you.
From googling, I gather that network cards can have UUIDs. So far I cannot find one for my eth0. Maybe that is because my network card is the motherboard. My ifcfg-eth0 does not mention a UUID. network-functions does have UUID. get_uuid_by_config seems to be at least one way to fetch a value, but I don't understand it.
uuidgen emits a UUID to standard out. It does not directly affect any NIC.
'uuidgen' is a generic tool for generating a Universally Unique IDentifier (UUID), intended to be used anywhere, and not just for NIC config files alone.
The output of the 'uuidgen' tool can be put into the NIC config file as a value for the key 'UUID='
- rejy (rmc)
On 01/09/2013 01:09 PM, Ed Greshko wrote:
On 01/09/2013 10:55 AM, Khemara Lyn wrote:
Dear All,
Sorry if this had been covered before.
How can I set or get the UUID for a NIC? I have installed new system,
initially with a single NIC; now I've added another NIC and would like to create a new UUID to be used in the new network-script file (e.g. ifcfg-em2).
Simply run uuidgen to create one
2013/1/9 Alan Cox alan@lxorguk.ukuu.org.uk:
On Wed, 9 Jan 2013 09:37:05 -0600 (CST) Michael Hennebry hennebry@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ł
On Fri, 2013-01-11 at 16:13 +0100, Paweł Brodacki wrote:
2013/1/9 Alan Cox alan@lxorguk.ukuu.org.uk:
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).
You try to call out Alan, THEN your last sentence above, states exactly what Alan said, they *can* have identical in the same machine *BUT RARE*. And you just stated you encountered it once? Sounds like what he stated to me.
The MAC has to be *host* unique not port unique. Thus some old SPARC boxes have one Mac for all the ports. Many Ethernet bridges also do the same trick.
There are examples of duplicate mac addresses on plug in cards but those are errors and shouldn't occur.
Allegedly, on or about 11 January 2013, Alan Cox sent:
The MAC has to be *host* unique not port unique. Thus some old SPARC boxes have one Mac for all the ports. Many Ethernet bridges also do the same trick.
I would have thought they'd need to be LAN unique, since the MAC is used for communication between the right NICs on a LAN. How's that going to work when they're not unique.
Am 12.01.2013 12:01, schrieb Tim:
Allegedly, on or about 11 January 2013, Alan Cox sent:
The MAC has to be *host* unique not port unique. Thus some old SPARC boxes have one Mac for all the ports. Many Ethernet bridges also do the same trick.
I would have thought they'd need to be LAN unique, since the MAC is used for communication between the right NICs on a LAN. How's that going to work when they're not unique.
google for NIC bonding / teaming http://www.linuxhorizon.ro/bonding.html
it IS unique for the LAN but not for the machine that is why failover can work as it works
it would be only a problem if DIFFERENT MACHINES have he same MAC because it is used fro cummunication and so it would be random who get which packages but with bondig it does not matter on which NIC packets are coming in and going out because it is the target of bonding using more than one NIC and with round-robin you even use all the NICs at the same time and not only for failover
Am 12.01.2013 14:23, schrieb Reindl Harald:
Am 12.01.2013 12:01, schrieb Tim:
Allegedly, on or about 11 January 2013, Alan Cox sent:
The MAC has to be *host* unique not port unique. Thus some old SPARC boxes have one Mac for all the ports. Many Ethernet bridges also do the same trick.
I would have thought they'd need to be LAN unique, since the MAC is used for communication between the right NICs on a LAN. How's that going to work when they're not unique.
google for NIC bonding / teaming http://www.linuxhorizon.ro/bonding.html
it IS unique for the LAN but not for the machine that is why failover can work as it works
it would be only a problem if DIFFERENT MACHINES have he same MAC because it is used fro cummunication and so it would be random who get which packages but with bondig it does not matter on which NIC packets are coming in and going out because it is the target of bonding using more than one NIC and with round-robin you even use all the NICs at the same time and not only for failover
and here the real world of bonding because i have yet wol-booted my remote-workstation for other reasons
as you can see the first 3 interfaces have the same MAC bond0 is the relevant, br0 only get the MAX from the interface behind
both have the MAC from eth0 eth1 has it's own because "Bonding Mode: adaptive load balancing" ____________________________________________________________
bond0: flags=5443<UP,BROADCAST,RUNNING,PROMISC,MASTER,MULTICAST> mtu 1472 ether 78:ac:c0:b1:76:e4 txqueuelen 0 (Ethernet) RX packets 1075 bytes 148294 (144.8 KiB) RX errors 0 dropped 101 overruns 0 frame 0 TX packets 1917 bytes 174680 (170.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1472 inet 10.0.0.99 netmask 255.255.255.0 broadcast 10.0.0.255 ether 78:ac:c0:b1:76:e4 txqueuelen 0 (Ethernet) RX packets 969 bytes 122332 (119.4 KiB) RX errors 0 dropped 56 overruns 0 frame 0 TX packets 401 bytes 75484 (73.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1472 ether 78:ac:c0:b1:76:e4 txqueuelen 1000 (Ethernet) RX packets 981 bytes 142218 (138.8 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1104 bytes 121274 (118.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 20 memory 0xfe700000-fe720000
eth1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1472 ether 00:1b:21:b6:5f:28 txqueuelen 1000 (Ethernet) RX packets 94 bytes 6076 (5.9 KiB) RX errors 0 dropped 92 overruns 0 frame 0 TX packets 813 bytes 53406 (52.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 16 memory 0xfe6c0000-fe6e0000 ____________________________________________________________
after "ifdown eth0" you even see "eth1" with the previously used MAc of eth0 and that is why the failover works without interrupt connections
Jan 12 16:27:39 rh kernel: bonding: bond0: releasing active interface eth0 Jan 12 16:27:39 rh kernel: device eth0 left promiscuous mode Jan 12 16:27:39 rh kernel: bonding: bond0: making interface eth1 the new active one. Jan 12 16:27:39 rh kernel: device eth1 entered promiscuous mode
bond0: flags=5443<UP,BROADCAST,RUNNING,PROMISC,MASTER,MULTICAST> mtu 1472 ether 78:ac:c0:b1:76:e4 txqueuelen 0 (Ethernet) RX packets 226 bytes 15692 (15.3 KiB) RX errors 0 dropped 214 overruns 0 frame 0 TX packets 1661 bytes 108084 (105.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1472 inet 10.0.0.99 netmask 255.255.255.0 broadcast 10.0.0.255 ether 78:ac:c0:b1:76:e4 txqueuelen 0 (Ethernet) RX packets 1543 bytes 170980 (166.9 KiB) RX errors 0 dropped 117 overruns 0 frame 0 TX packets 528 bytes 84906 (82.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1472 ether 78:ac:c0:b1:76:e4 txqueuelen 1000 (Ethernet) RX packets 226 bytes 15692 (15.3 KiB) RX errors 0 dropped 197 overruns 0 frame 0 TX packets 1668 bytes 108890 (106.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 16 memory 0xfe6c0000-fe6e0000 ____________________________________________________________
after "ifup eth0" again you see even "eth0" becomes the MAC from the physical "eth1" because they active interface does not change now without a good reason and "additional NIC" is no good reason, from the view of the LAN the machine has all the time "78:ac:c0:b1:76:e4"
bond0: flags=5443<UP,BROADCAST,RUNNING,PROMISC,MASTER,MULTICAST> mtu 1472 ether 78:ac:c0:b1:76:e4 txqueuelen 0 (Ethernet) RX packets 2435 bytes 448660 (438.1 KiB) RX errors 0 dropped 214 overruns 0 frame 0 TX packets 4471 bytes 387055 (377.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1472 inet 10.0.0.99 netmask 255.255.255.0 broadcast 10.0.0.255 ether 78:ac:c0:b1:76:e4 txqueuelen 0 (Ethernet) RX packets 2124 bytes 385770 (376.7 KiB) RX errors 0 dropped 162 overruns 0 frame 0 TX packets 752 bytes 144243 (140.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=6147<UP,BROADCAST,SLAVE,MULTICAST> mtu 1472 ether 00:1b:21:b6:5f:28 txqueuelen 1000 (Ethernet) RX packets 1547 bytes 201658 (196.9 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1971 bytes 178638 (174.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 20 memory 0xfe700000-fe720000
eth1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1472 ether 78:ac:c0:b1:76:e4 txqueuelen 1000 (Ethernet) RX packets 888 bytes 247002 (241.2 KiB) RX errors 0 dropped 197 overruns 0 frame 0 TX packets 2507 bytes 209255 (204.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 16 memory 0xfe6c0000-fe6e0000