In Ubuntu 22.04, I created a NetworkManager profile called netplan-enp2s0.nmconnection
:
[connection]
id=netplan-enp2s0
uuid=7ea6f90b-3495-3533-948a-ef0035687c34
type=ethernet
interface-name=enp2s0
permissions=
timestamp=1634026237
[ethernet]
mac-address-blacklist=
wake-on-lan=0
[ipv4]
address1=192.168.0.100/16,192.168.0.254
dns=192.168.0.254;8.8.8.8;4.4.4.4;
dns-search=
ignore-auto-dns=true
method=manual
[ipv6]
addr-gen-mode=eui64
dns-search=
method=ignore
[proxy]
The profile is enabled and active:
$ nmcli con show
NAME UUID TYPE DEVICE
netplan-enp2s0 7ea6f90b-3495-3533-948a-ef0035687c34 ethernet enp2s0
But even issuing:
$ sudo nmcli con up netplan-enp2s0
its content is ignored:
$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:30:18:05:87:36 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.17/16 brd 192.168.255.255 scope global dynamic noprefixroute enp2s0
valid_lft 82426sec preferred_lft 82426sec
inet6 fe80::230:18ff:fe05:8736/64 scope link
valid_lft forever preferred_lft forever
and also the GUI shows the outdated settings:

If I change the settings in the GUI it creates a new profile instead of updating the existing one.
What is my mistake?
UPDATE
Here the diff against the profile crated by the GUI (right side):
$ sudo diff netplan-enp2s0.nmconnection netplan-enp2s0-7ea6f90b-3495-3533-948a-ef0035687c34.nmconnection
6,7c6
< permissions=
< timestamp=1634026237
---
> timestamp=1666184508
10d8
< mac-address-blacklist=
15,17d12
< dns-search=
< ignore-auto-dns=true
22d16
< dns-search=