cockpit
cockpit copied to clipboard
cockpit-networkmanager not working for Ubuntu's default netplan configuration
Explain what happens
After Cockpit installation on Ubuntu 2x.xx there are still many tasks which need to be performed manulally and do not guarantee working solution.
- Network manager not set up out of the box => https://gist.github.com/Xantios/cb26cfd4f1cd3c8f5bb720ec0e553728
network-manager.service is not enabled during setup. "renderer: NetworkManager" is not being written to netplan config
Althoug these steps are perfomed, changes are not saved to netplan if e.g IP is changed via Cockpit UI. Once machine is rebooted they're gone.
- Cockpit does not seem to work with ufw. There is no hint during setup, nor in the documentation to replace uwf with firewalld in order to have a working setup. Proposal - Offer a uwf => firewalld "reinstall" via UI
Version of Cockpit
cockpit-networkmanager 252-1
Where is the problem in Cockpit?
Networking
Server operating system
Ubuntu
Server operating system version
20.04, 21.10
What browsers are you using?
Chrome
System log
No response
Indeed that page talks to NetworkManager, by design. There is indeed this impedance mismatch that Ubuntu server does not actually use NM by default, but systemd-networkd (Desktop does use NM). networkd is a much harder API to work with (no notifications, no D-Bus interface, no machine readable configuration), so we don't currently plan to work on this.
I.e. the status quo is that you just can't use Cockpit's NM page on Ubuntu in the default configuration.
Can you propose a solution/workaround? I'm fine with everything as long it is confirmed working :)
"Althoug these steps are perfomed, changes are not saved to netplan if e.g IP is changed via Cockpit UI. Once machine is rebooted they're gone."
There's no "workaround" -- if you want to keep networkd as a backend, then there is simply no way to manage that through cockpit (it's really not an API that is meant for an interactive UI).
If you do want to use the page, and you don't mind using NM, then telling netplan to use NM is "the" way.
i'm seeing a lot of those, changing IP and network settings from web is one of the primary reasons that allowed me to use cockpit in the first place, infact when i create auto install for ubuntu i switch the network manager first thing and do a sed. from POV i see no difference in using either, because i only need basic functionality . the day ubuntu stops using network manager will be very bad.
but i do some suggestions if you can recognize you don't have networkmanager, you could add a small remark on the networking tab informing the user what they should do (or refer them to page of FAQ on cockpit site)
if a user does change the IP succesfully it would be wise the see if that same IP is used in the browser, and refer the browser to that new IP.
This is pretty much a "wontfix". netplan's config is very complex to parse, and it does not provide any API to read the current state. Especially the later makes it incompatible with Cockpit's goals. If someone wants to write a cockpit-netplan project, that's fine -- but we aren't going to do it in the Cockpit team, I'm afraid.
Hello, Is it not possible to make a separate page for systemd-networkd ? Thank you.
@rpg-hub : networkd does not have a good API for Cockpit. If anyone wants to make a cockpit UI for netplan or cockpit, that'd be appreciated of course -- but we won't do that ourselves in the Cockpit team, we don't have the capacity/interest in that.
@rpg-hub : networkd does not have a good API for Cockpit. If anyone wants to make a cockpit UI for netplan or cockpit, that'd be appreciated of course -- but we won't do that ourselves in the Cockpit team, we don't have the capacity/interest in that. i'm just curious is there anything wrong with using network-manager for ubuntu server LTS ? i keep hearing there's a "division"where networkd is considered for server machines, and network-manager is considered for client desktop machines. but doesnt' network-manager come from redhat which uses it in server editions as well?
we create a vm which houses a single standard java server for TCP/UDP/Rest/Websocket sockets. so we only have a single inet interface and that's it. no fancy routing or bridges or anything else. so i have to wonder if network-manager is as good as networkd reliability wise. (assuming networkd is reliable)
additionally should we remvoe networkd completley, cause i've discovered that in recent versions even if network-manager is used, behind the scenes the dhcp client is of systemd origins.
Nothing wrong with using NM, it's just overkill for a single static interface which basically never changes. That's not saying that NM is bad, just that it will take a few more resources. Indeed NM can use systemd's DHCP client library, which is a lot faster than the traditional dhcpv3-client -- that part is fine.
NM is overkill ? i thought networkd would be the over kill as it has more features.
Oh no, networkd is fairly simple, and was meant exactly for the "simple server/cloud" use case.
networkd is a much harder API to work with (no notifications, no D-Bus interface, no machine readable configuration)
It does seem to have a D-Bus API now, although I haven't confirmed that it's enough to cover what is currently needed from NetworkManager
https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.network1.html