This leads to the fact that no connections are managed by nm by default:
ubuntu@zlin:~$ nmcli con show
NAME UUID TYPE DEVICE
ubuntu@zlin:~$ nmcli d s
DEVICE TYPE STATE CONNECTION
enP1p0s0 ethernet unmanaged --
enP1p0s0d1 ethernet unmanaged --
enP2p0s0 ethernet unmanaged --
enP2p0s0d1 ethernet unmanaged --
encc000 ethernet unmanaged --
lo loopback unmanaged --
encc000.2653 vlan unmanaged --
Changing the renderer from networkd to NetworkManager is probably what you are looking for:
# default:
ubuntu@zlin:~$ cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
encc000:
dhcp4: no
dhcp6: no
vlans:
encc000.2653:
link: encc000
id: 2653
addresses: [ 10.245.236.14/24 ]
gateway4: 10.245.236.1
nameservers:
search: [ canonical.com ] addresses:
- "10.245.236.1"
# change the renderer form 'networkd' to 'NetworkManager':
ubuntu@zlin:~$ cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: NetworkManager
ethernets:
encc000:
dhcp4: no
dhcp6: no
vlans:
encc000.2653:
link: encc000
id: 2653
addresses: [ 10.245.236.14/24 ]
gateway4: 10.245.236.1
nameservers:
search: [ canonical.com ] addresses:
- "10.245.236.1"
# restart netplan / dry-run, to look for any potential config errors
ubuntu@zlin:~$ sudo netplan --debug generate
DEBUG:command generate: running ['/lib/netplan/generate']
** (generate:2472): DEBUG: 13:47:43.846: Processing input file //etc/netplan/01-netcfg.yaml..
** (generate:2472): DEBUG: 13:47:43.846: starting new processing pass
** (generate:2472): DEBUG: 13:47:43.846: encc000.2653: setting default backend to 2
** (generate:2472): DEBUG: 13:47:43.846: encc000: setting default backend to 2
** (generate:2472): DEBUG: 13:47:43.846: Generating output files..
** (generate:2472): DEBUG: 13:47:43.846: networkd: definition encc000.2653 is not for us (backend 2)
** (generate:2472): DEBUG: 13:47:43.846: networkd: definition encc000 is not for us (backend 2)
# restart netplan in case no error are detected
ubuntu@zlin:~$ sudo netplan apply
ubuntu@zlin:~$
Since networkmanager is a tool that is mainly used in the desktop space, I'm wondering what you are trying to do with nmcli and if the iproute2 tools (man ip) are a better alternative, since they can be used by default w/o the need of changing the renderer ...
So this is more a configuration thing, because with netplan the default renderer is networkd (and not NetworkManager):
ubuntu@zlin:~$ grep renderer /etc/netplan/ 01-netcfg. yaml
renderer: networkd
This leads to the fact that no connections are managed by nm by default:
ubuntu@zlin:~$ nmcli con show
NAME UUID TYPE DEVICE
ubuntu@zlin:~$ nmcli d s
DEVICE TYPE STATE CONNECTION
enP1p0s0 ethernet unmanaged --
enP1p0s0d1 ethernet unmanaged --
enP2p0s0 ethernet unmanaged --
enP2p0s0d1 ethernet unmanaged --
encc000 ethernet unmanaged --
lo loopback unmanaged --
encc000.2653 vlan unmanaged --
Changing the renderer from networkd to NetworkManager is probably what you are looking for:
# default: 01-netcfg. yaml
addresses:
ubuntu@zlin:~$ cat /etc/netplan/
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
encc000:
dhcp4: no
dhcp6: no
vlans:
encc000.2653:
link: encc000
id: 2653
addresses: [ 10.245.236.14/24 ]
gateway4: 10.245.236.1
nameservers:
search: [ canonical.com ]
- "10.245.236.1"
# change the renderer form 'networkd' to 'NetworkManager':
ubuntu@zlin:~$ cat /etc/netplan/ 01-netcfg. yaml
addresses:
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: NetworkManager
ethernets:
encc000:
dhcp4: no
dhcp6: no
vlans:
encc000.2653:
link: encc000
id: 2653
addresses: [ 10.245.236.14/24 ]
gateway4: 10.245.236.1
nameservers:
search: [ canonical.com ]
- "10.245.236.1"
# restart netplan / dry-run, to look for any potential config errors netplan/ generate' ] 01-netcfg. yaml..
ubuntu@zlin:~$ sudo netplan --debug generate
DEBUG:command generate: running ['/lib/
** (generate:2472): DEBUG: 13:47:43.846: Processing input file //etc/netplan/
** (generate:2472): DEBUG: 13:47:43.846: starting new processing pass
** (generate:2472): DEBUG: 13:47:43.846: encc000.2653: setting default backend to 2
** (generate:2472): DEBUG: 13:47:43.846: encc000: setting default backend to 2
** (generate:2472): DEBUG: 13:47:43.846: Generating output files..
** (generate:2472): DEBUG: 13:47:43.846: networkd: definition encc000.2653 is not for us (backend 2)
** (generate:2472): DEBUG: 13:47:43.846: networkd: definition encc000 is not for us (backend 2)
# restart netplan in case no error are detected
ubuntu@zlin:~$ sudo netplan apply
ubuntu@zlin:~$
# now nm / nmcli has control: encc000. 2653 p/NetworkManage r/ActiveCo fe33:b5dd/ 64
ubuntu@zlin:~$ nmcli dev show
GENERAL.DEVICE: encc000.2653
GENERAL.TYPE: vlan
GENERAL.HWADDR: 02:00:00:33:B5:DD
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: netplan-
GENERAL.CON-PATH: /org/freedeskto
IP4.ADDRESS[1]: 10.245.236.14/24
IP4.GATEWAY: 10.245.236.1
IP4.ROUTE[1]: dst = 10.245.236.0/24, nh = 0.0.0.0, mt
IP4.ROUTE[2]: dst = 0.0.0.0/0, nh = 10.245.236.1, mt =
IP4.DNS[1]: 10.245.236.1
IP6.ADDRESS[1]: fe80::ff:
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = ff00::/8, nh = ::, mt = 256, table
IP6.ROUTE[2]: dst = fe80::/64, nh = ::, mt = 256
GENERAL.DEVICE: encc000 8c33-3a09- 985f-54c65ed161 62 ethernet encc000 encc000. 2653 8aabaee8- 34fb-3808- b152-454ad49553 d3 vlan encc000.26 64bd-312a- bd46-6bbf9ce717 95 ethernet -- c93e-3441- be46-decf30bf22 f4 ethernet -- c16d-37d6- b8cb-dc38f4b8e3 e3 ethernet -- be8c-366e- 83b3-ab6a285e93 cd ethernet --
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 02:00:00:33:B5:DD
GENERAL.MTU: 1500
GENERAL.STATE: 100 (connected)
GENERAL.CONNECTION: netplan-encc000
ubuntu@zlin:~$ nmcli con show
NAME UUID TYPE DEVICE
netplan-encc000 abd74282-
netplan-
Wired connection 1 ce36d943-
Wired connection 2 fbc21b74-
Wired connection 3 07334b8f-
Wired connection 4 8f06587e-
Since networkmanager is a tool that is mainly used in the desktop space, I'm wondering what you are trying to do with nmcli and if the iproute2 tools (man ip) are a better alternative, since they can be used by default w/o the need of changing the renderer ...