[CentOS] How to set macaddr with nmcli

Fri Aug 3 14:09:11 UTC 2018
Robert Moskowitz <rgm at htt-consult.com>

Yo, Mark

On 08/03/2018 09:34 AM, mark wrote:
> Robert Moskowitz wrote:
>> I see my problem.  I mis-read what
>>
>> nmcli con mod eth0 mac "02:67:15:00:81:0B"
>>
>> does.  It sets HWADDR; which interface to link to, not MACADDR, what MAC
>> address you want for your interface.
>>
>> So I have read the nmcli pages and googled a bit.  I cannot find a way
>> to set MACADDR.  I suppose I can set HWADDR then use sed to change it to
>> MACADDR, but this seems a real hack.
>>
> Do it in the ifcfg-*, and in /etc/udev/rules.d/*-net.rules. I *think*
> that's all I've changed.

I don't need the udev/rules.  C7-armv7 is working just fine with eth0.

But I want to script it for my howto using nmcli.  I cannot see how to 
set MACADDR with nmcli.  I may have to join their list to ask. Nicely.

> I have to spoof it on a couple of users' workstations, because they're
> running 9 yr old software that's productive... and tied to the MAC address
> *and* to the NIC name, so I have to have a couple of parms on the grub2
> command line, because it *has* to be named eth0. Oh, and the maker was
> sold, and the new company says, "you changed machines? Sure, we'll
> generate a new license... that'll be $15,000, please.

Yeah, what he said.  Been there.

>> BTW, I remember setting MAC addresses on 3COM 3C501C boards because the
>> old board died and we had software licensed to specific MAC addresses.  So
>> you had to specify your MAC address in the config file.  The DEC admin had
>> to do a similar thing if he had to swap out his LAN card (related: read up
>> on why Dr. Comer set ARP timeout to 10min).
>>
>> Then there was that counterfeit 3C503C from Malaysia, all with the same
>> MAC address.  Caused havoc on the networks.  EVERYONE had to specify
>> their MAC address with those.  3COM did find the plant making these clones
>> and shut them down.  But the damage was done to a lot of us.
> Oh, wow, I don't remember hearing about that. What a freakin' pain!

I knew the 3COM engineer that figured it out.  The boards were perfect 
clones.  But all with the same MAC address.  Packaging was perfect.  He 
put one of the boxes in water until it came apart, got someone to read 
the newspapers the box was made from.  Figured out what city they were 
from. Then hired investigators to find the plant.   They had etched down 
the chips on a board to make their own masks.  Except they did not 
understand that each board had a unique macaddr burnt in...

We (Chrysler) only had about 10 of them (of course for manager's PCs).  
But I heard that GM had done a big buy from a supplier...