A new NM connection auto created after reboot

I am testing iscsi boot on my old Sony notebook.

/boot is from local /dev/sda
/ and /home are btrfs subvols on remote iscsi target.

Anaconda install runs smoothly and booting works OK.

Now, I tried to enable WOL refering to:
https://www.reddit.com/r/Fedora/comments/fbd8ny/cannot_setup_wake_on_lan_on_fedora_31/

action:
$sudo nmcli connection modify “enp2s0” 802-3-ethernet.wake-on-lan magic
$sudo systemctl reboot

After reboot, a new enp2s0 connection is automatically created and activated, but with different UUID.

$ nmcli con
NAME    UUID                                  TYPE      DEVICE 
enp2s0  6d6a0ee1-4649-4b2b-bc08-3f6cdfc09fad  ethernet  enp2s0 
enp2s0  10e97d92-260e-4534-a053-36c9b255b281  ethernet  --    

check for the wol setting by:
$ nmcli con s enp2s0 | grep -i Wake
802-3-ethernet.wake-on-lan: default
802-3-ethernet.wake-on-lan-password: –
802-3-ethernet.wake-on-lan: magic
802-3-ethernet.wake-on-lan-password: –

The first newly created activated profile is not set, while the non-active profile is wol set.

Question: Why Fedora auto create a new NM profile, instead of using the existing “only” one before the reboot?

Please check permissions and compare configs when the duplicate appears:

sudo ls -a -l -Z /etc/NetworkManager/system-connections
sudo diff /etc/NetworkManager/system-connections/*enp2s0*

I just redo the installation from the beginning, and the result is the same.

  1. Fresh installation
  2. sudo dnf install NetworkManager-tui
  3. using nmtui, create a new profile named “wol” with all default settings
  4. activate “wol” using nmtui
  5. remove all extra profiles, and only “wol” remain
  6. reboot

A.
$ sudo nmcli con
NAME UUID TYPE DEVICE
enp2s0 9ccb5735-7a8f-4aec-be4a-af7de5f81ebe ethernet enp2s0
wol 9f8b6577-ca34-41ba-951a-89d40151d58f ethernet –

B. (Surprise! Only one files!)
sudo ls -a -l -Z /etc/NetworkManager/system-connections/
total 4
drwxr-xr-x. 1 root root system_u:object_r:NetworkManager_etc_rw_t:s0 32 Jan 18 02:15 .
drwxr-xr-x. 1 root root system_u:object_r:NetworkManager_etc_t:s0 160 Jan 18 01:44 …
-rw-------. 1 root root system_u:object_r:NetworkManager_etc_rw_t:s0 248 Jan 18 02:13 wol.nmconnection

C. (diff has no output, as only one connections files there)

D.
sudo nmcli con s enp2s0 > a.txt
sudo nmcli con s wol > b.txt
diff a.txt b.txt

diff a.txt b.txt

$ diff a.txt b.txt
1,2c1,2
< connection.id: enp2s0
< connection.uuid: 9ccb5735-7a8f-4aec-be4a-af7de5f81ebe

connection.id: wol
connection.uuid: 9f8b6577-ca34-41ba-951a-89d40151d58f
9c9
< connection.multi-connect: 1 (single)


connection.multi-connect: 0 (default)
11c11
< connection.timestamp: 1610908083


connection.timestamp: 1610907269
24c24
< connection.wait-device-timeout: 60000


connection.wait-device-timeout: -1
60c60
< ipv4.may-fail: no


ipv4.may-fail: yes
79c79
< ipv6.addr-gen-mode: eui64


ipv6.addr-gen-mode: stable-privacy
92,137d91
< GENERAL.NAME: enp2s0
< GENERAL.UUID: 9ccb5735-7a8f-4aec-be4a-af7de5f81ebe
< GENERAL.DEVICES: enp2s0
< GENERAL.IP-IFACE: enp2s0
< GENERAL.STATE: activated
< GENERAL.DEFAULT: yes
< GENERAL.DEFAULT6: no
< GENERAL.SPEC-OBJECT: –
< GENERAL.VPN: no
< GENERAL.DBUS-PATH: /org/freedesktop/NetworkManager/ActiveConnection/1
< GENERAL.CON-PATH: /org/freedesktop/NetworkManager/Settings/1
< GENERAL.ZONE: –
< GENERAL.MASTER-PATH: –
< IP4.ADDRESS[1]: 192.168.100.67/24
< IP4.GATEWAY: 192.168.100.253
< IP4.ROUTE[1]: dst = 0.0.0.0/0, nh = 192.168.100.253, mt = 100
< IP4.ROUTE[2]: dst = 192.168.100.0/24, nh = 0.0.0.0, mt = 100
< IP4.DNS[1]: 192.168.100.253
< DHCP4.OPTION[1]: dhcp_lease_time = 600
< DHCP4.OPTION[2]: domain_name_servers = 192.168.100.253
< DHCP4.OPTION[3]: expiry = 1610908676
< DHCP4.OPTION[4]: ip_address = 192.168.100.67
< DHCP4.OPTION[5]: next_server = 192.168.100.253
< DHCP4.OPTION[6]: requested_broadcast_address = 1
< DHCP4.OPTION[7]: requested_domain_name = 1
< DHCP4.OPTION[8]: requested_domain_name_servers = 1
< DHCP4.OPTION[9]: requested_domain_search = 1
< DHCP4.OPTION[10]: requested_host_name = 1
< DHCP4.OPTION[11]: requested_interface_mtu = 1
< DHCP4.OPTION[12]: requested_ms_classless_static_routes = 1
< DHCP4.OPTION[13]: requested_nis_domain = 1
< DHCP4.OPTION[14]: requested_nis_servers = 1
< DHCP4.OPTION[15]: requested_ntp_servers = 1
< DHCP4.OPTION[16]: requested_rfc3442_classless_static_routes = 1
< DHCP4.OPTION[17]: requested_root_path = 1
< DHCP4.OPTION[18]: requested_routers = 1
< DHCP4.OPTION[19]: requested_static_routes = 1
< DHCP4.OPTION[20]: requested_subnet_mask = 1
< DHCP4.OPTION[21]: requested_time_offset = 1
< DHCP4.OPTION[22]: requested_wpad = 1
< DHCP4.OPTION[23]: routers = 192.168.100.253
< DHCP4.OPTION[24]: subnet_mask = 255.255.255.0
< IP6.ADDRESS[1]: fe80::213:a9ff:feff:d01c/64
< IP6.GATEWAY: –
< IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 100
< IP6.ROUTE[2]: dst = ff00::/8, nh = ::, mt = 256, table=255

1 Like

Looks like the duplicate connection is runtime, so its config should be stored here:

/run/NetworkManager/system-connections

You can try to configure the option no-auto-default:

sudo tee /etc/NetworkManager/conf.d/00-custom.conf << EOF > /dev/null
[main]
no-auto-default=*
EOF
sudo systemctl restart NetworkManager.service
1 Like

I have recreate this setup in my KVM guest. The behaviour is the same as in my Sony notebook.

This is my /proc/cmdline:
BOOT_IMAGE=(hd0,gpt2)/vdaboot/vmlinuz-5.10.7-200.fc33.x86_64 root=UUID=0063c03f-cfdc-419e-b200-95e0aa1e27f3 ro rootflags=subvol=idaroot netroot=iscsi:@192.168.100.44::3260:iface0:vl100::iqn.2021-01.xxx.yyyy:zzzz rd.iscsi.initiator=iqn.2021-01.xxx.yyyy:zzzz ip=192.168.100.66:::255.255.255.0::vl100:none vlan=vl100:enp1s0

The suggested 00-custom.conf is applied, as no default connections are auto created for enp1s0 and vl1 after reboot.

Observations:

  1. NetworkManager still auto create the vl100 conneciton to /run/NetworkManager/system-connections
  2. NetworkManager will not create vl1 to /run/NetworkManager
  3. Once I edit the runtime connection, and reboot, NetworkManager will create another new one to /run with new UUID

It seems I cannot have a pre-defined NM connection for the iscsi VLAN interface.

1 Like

Does it do the same without using sudo?

1 Like

Regarding ‘nmcli con’ command?

The output is the same with or without sudo for my case.

I’d file a bug since it’s easily reproducible.

2 Likes

filed:
https://bugzilla.redhat.com/show_bug.cgi?id=1917640