On 6/24/20 12:24 PM, Beniamino Galvani wrote:
> On Tue, Jun 23, 2020 at 11:07:52PM -0400, Dusty Mabe wrote:
>> Hi,
>>
>> While researching a bug reported against RHEL CoreOS I've decided to look a 
>> bit deeper into
>> how a user would go about changing the name of a NIC on a machine to 
>> something custom. In
>> this investigation I have some questions:
>>
>> -  It seems as if nm-initrd-generator doesn't have support for the ifname= 
>> karg. Is that
>>    intentional?
> 
> Yes, it's intentional; interface renaming is done by the 40-network
> module:
> 
>   
> https://github.com/dracutdevs/dracut/blob/050/modules.d/40network/ifname-genrules.sh

Ahh, I mistakenly thought it was part of the 35network-legacy dracut module. 
Thanks

> 
>> - If I specify the nic name and MAC as part of the ip= line the mac 
>> specified gets set to
>>   'cloned-mac-address' rather than 'mac-address'. Is that right?
>>     - i.e, 
>> ip=192.168.122.111::192.168.122.1:255.255.255.0:initrdhost:nicname:none:0:52:54:00:00:00:0a
>>     - 
>> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/master/src/initrd/nmi-cmdline-reader.c#L583
> 
> It's right. The 9th field of an ip= option is the new MAC address to
> assign to the interface, and so cloned-mac-address is the right
> property to set. The old network module also uses that field to
> specify the new MAC.

OK thanks for confirming. The documentation around this is sparse and I 
couldn't quite
tell which was the right one. I thought maybe we were setting the wrong one and 
that's
why NIC renaming wasn't working for me, but it was because of the no udev 
helper that I
mention and you confirm below.

> 
>> - Is there a udev helper that parses NM keyfiles and sets up udev rules like 
>> /lib/udev/rename_device
>>   does for reading legacy network scripts in /etc/sysconfig/network-scripts/ 
>> ?
>>     - 
>> https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/consistent-network-interface-device-naming_configuring-and-managing-networking#how-the-network-device-naming-works_consistent-network-interface-device-naming
>>     - 
>> https://github.com/fedora-sysv/initscripts/blob/master/src/rename_device.c
> 
> I am not aware of such helper for NM keyfiles.

Thanks for confirming. After talking with you and the team today I opened a BZ 
as we
think it's a current gap in behavior between the old legacy network scripts 
approach
and the NM keyfiles only approach. The BZ is:

- https://bugzilla.redhat.com/show_bug.cgi?id=1851279

In our discussions we also discussed two other things that may want to do. I 
opened issues
upstream to talk about them:

- https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/479
- https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/480


Thanks again!
Dusty



_______________________________________________
networkmanager-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to