Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cockpit-networkmanager not working with networkd, for Ubuntu's default netplan configuration #17040

Closed
JohnnyElvis opened this issue Feb 23, 2022 · 12 comments

Comments

@JohnnyElvis
Copy link

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.

  1. 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.

  1. 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

@JohnnyElvis JohnnyElvis changed the title cockpit-networkmanager now working out of the box on Ubuntu 2x.xx cockpit-networkmanager not working out of the box on Ubuntu 2x.xx Feb 23, 2022
@martinpitt martinpitt changed the title cockpit-networkmanager not working out of the box on Ubuntu 2x.xx cockpit-networkmanager not working for Ubuntu's default netplan configuration Feb 24, 2022
@martinpitt
Copy link
Member

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.

@JohnnyElvis
Copy link
Author

JohnnyElvis commented Feb 24, 2022

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."

@martinpitt
Copy link
Member

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.

@emaayan
Copy link

emaayan commented Mar 23, 2022

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.

@martinpitt
Copy link
Member

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.

@rpg-hub
Copy link

rpg-hub commented Feb 2, 2023

Hello,
Is it not possible to make a separate page for systemd-networkd ?
Thank you.

@martinpitt
Copy link
Member

@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.

@emaayan
Copy link

emaayan commented Feb 3, 2023

@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.

@martinpitt
Copy link
Member

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.

@emaayan
Copy link

emaayan commented Feb 3, 2023

NM is overkill ? i thought networkd would be the over kill as it has more features.

@martinpitt
Copy link
Member

Oh no, networkd is fairly simple, and was meant exactly for the "simple server/cloud" use case.

@martinpitt martinpitt changed the title cockpit-networkmanager not working for Ubuntu's default netplan configuration cockpit-networkmanager not working with networkd, for Ubuntu's default netplan configuration Sep 29, 2023
@jokeyrhyme
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants