When I change the ethernet connection via nmcli (from my application) the new settings are taken over in the network-manager (I see the right settings afterwards via nmcli c …) but I get the following error and the connection is not established.
nmcli return 1 code. STDERR='Error: Failed to modify connection 'netplan-eth0': error writing to file '/run/NetworkManager/system-connections/netplan-eth0': Failed to create file '/run/NetworkManager/system-connections/netplan-eth0.ZVRATZ': Permission denied
Afterwards the network-manager is trying to connect my ethernet connection without success. Here some information from the logs:
Nov 30 07:26:11 localhost NetworkManager[1251]: <info> [1543562771.9049] dhcp4 (eth0): state changed unknown -> timeout
Nov 30 07:26:11 localhost NetworkManager[1251]: <info> [1543562771.9159] dhcp4 (eth0): canceled DHCP transaction
Nov 30 07:26:11 localhost NetworkManager[1251]: <info> [1543562771.9161] dhcp4 (eth0): state changed timeout -> done
Nov 30 07:26:11 localhost NetworkManager[1251]: <info> [1543562771.9174] device (eth0): state change: ip-config -> failed (reason 'ip-config-unavailable') [70 120 5]
Nov 30 07:26:11 localhost NetworkManager[1251]: <warn> [1543562771.9197] device (eth0): Activation: failed for connection 'netplan-eth0'
Nov 30 07:26:11 localhost NetworkManager[1251]: <info> [1543562771.9232] device (eth0): state change: failed -> disconnected (reason 'none') [120 30 0]
Nov 30 07:26:11 localhost NetworkManager[1251]: <info> [1543562771.9294] policy: Device 'eth0' has no connection; scheduling activate_check in 0 seconds.
Nov 30 07:26:11 localhost NetworkManager[1251]: <warn> [1543562771.9322] device (eth0): failed to find device 2 'eth0' with udev
Nov 30 07:26:11 localhost NetworkManager[1251]: <info> [1543562771.9385] policy: auto-activating connection 'netplan-eth0'
Nov 30 07:26:11 localhost NetworkManager[1251]: <info> [1543562771.9460] device (eth0): Activation: starting connection 'netplan-eth0' (04d79829-8fbf-3091-8dac-4378e0daab6d)
Nov 30 07:26:11 localhost NetworkManager[1251]: <info> [1543562771.9471] device (eth0): state change: disconnected -> prepare (reason 'none') [30 40 0]
Nov 30 07:26:11 localhost NetworkManager[1251]: <info> [1543562771.9506] device (eth0): state change: prepare -> config (reason 'none') [40 50 0]
Nov 30 07:26:11 localhost NetworkManager[1251]: <info> [1543562771.9536] device (eth0): state change: config -> ip-config (reason 'none') [50 70 0]
Nov 30 07:26:11 localhost NetworkManager[1251]: <info> [1543562771.9562] dhcp4 (eth0): activation: beginning transaction (timeout in 45 seconds)
Nov 30 07:26:11 localhost NetworkManager[1251]: <warn> [1543562771.9612] device (eth0): failed to find device 2 'eth0' with udev
Nov 30 07:26:42 localhost rsyslogd-2007: action 'action 10' suspended, next retry is Fri Nov 30 07:27:12 2018 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
Nov 30 07:26:56 localhost NetworkManager[1251]: <warn> [1543562816.9013] dhcp4 (eth0): request timed out
Nov 30 07:26:56 localhost NetworkManager[1251]: <info> [1543562816.9015] dhcp4 (eth0): state changed unknown -> timeout
Nov 30 07:26:56 localhost NetworkManager[1251]: <info> [1543562816.9159] dhcp4 (eth0): canceled DHCP transaction
Nov 30 07:26:56 localhost NetworkManager[1251]: <info> [1543562816.9161] dhcp4 (eth0): state changed timeout -> done
Nov 30 07:26:56 localhost NetworkManager[1251]: <info> [1543562816.9175] device (eth0): state change: ip-config -> failed (reason 'ip-config-unavailable') [70 120 5]
I’ve connected all necessary snap interfaces.
My snap versions:
snap 2.36.1
snapd 2.36.1
series 16
kernel 4.4.0-1100-raspi2
If I change the ethernet connection manually via nmcli from console (and not from an application) I get the same error and after a restart of the rpi my setting is gone.
sudo nmcli c mod netplan-eth0 ipv4.method manual
Error: Failed to modify connection 'netplan-eth0': error writing to file '/run/NetworkManager/system-connections/netplan-eth0': Failed to create file '/run/NetworkManager/system-connections/netplan-eth0.5KNFTZ': Permission denied
NetworkManager will reuse existing configurations files from /etc/netplan when ethernet support is enabled. Those will marked as immutable inside NetworkManager and any changes need to be written manually into the relevant files in /etc/netplan.
My netplan files look as follows:
00-snapd-config.yaml:
# This is the network config written by 'console_conf'
network:
ethernets:
eth0:
addresses: []
dhcp4: true
version: 2
00-default-nm-renderer.yaml :
network:
renderer: NetworkManager
I am bit puzzled regarding the ethernet settings via network-manager. Maybe someone has an idea what my issue is.
Thanks
DEVICE TYPE STATE CONNECTION
eth0 ethernet connected netplan-eth0
wlan0 wifi connected FRITZ!Box 7312
lo loopback unmanaged --
And networkctl:
WARNING: systemd-networkd is not running, output will be incomplete.
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback n/a unmanaged
2 eth0 ether n/a unmanaged
3 wlan0 wlan n/a unmanaged
3 links listed.
What is interesting is that after I have executed the nmcli command to set the ethernet method to manual, my ethernet connection is actually working. So somehow he is picking up the setting but after a restart the setting is gone again.
The denial when writing to /run/NetworkManager/system-connections/netplan-eth0.IK0QTZ is the problem here (you can safely ignore the other denials). Writing there is not allowed by the network-manager interface. This can be an interface bug, but usually connections are stored in
I think this is happening because the connection was created by netplan. What happens if you remove 00-snapd-config.yaml and re-start? Can you then configure as you wish the eth0 interface connection?
Thanks a lot, you made my day . After removing the 00-snapd-config.yaml it is working fine.
Though what is the best way from network setup perspective for my target scenario:
I just want to create a device image which I do not have to configure but which is starting with an access point and via a webpage (or app) I can pass the wifi credentials. I have the AP and webserver running and this is working but I am wondering how I can skip the initiate phase of Ubuntu core (where I setup wifi and register the device with my Ubuntu user)?