Insert relevant meme here.
Let’s face it. When installing a new OVH box with Ubuntu 22.04, Netplan/networkd does a lousy job at setting it up with ipv4 and ipv6. One has to run through hoops of Ctrl+Alt+F2 and throw in some route add
voodoo for the IP address and default route to actually ‘talk’ outside, and God forbid you decide to set up IPv6 as well. Result? Duplicate or even triplicate domains in the search indent, the routes overlap each other and if you set one gateway as default you can kiss your other, different version, default gateway goodbye.
Back in the day I was pretty comfy with NetworkManager, but my interest in doing better with different tools drove me away from it, until recently, which I decided that NetworkManager would be again part of my toolset in the servers I manage. Along came nmtui
for its simplicity in just editing the relevant fields and keeping it all tidy, whereas nmcli
showed how it was all running, except for the dreaded “unmanaged” tag that seems to be so popular in networkd/Netplan. Ugh.
So, the task to get NetworkManager back in business began by stripping Netplan and its ominous yaml files off from the resources. For that I had this simple renderer: NetworkManager line added in the relevant yaml like this (as root/sudo):
vim /etc/netplan/01-NetworkManager.yaml
# Ditch netplan for NetworkManager
network:
version: 2
renderer: NetworkManager
<ESC>ZZ
>>
apt -y install network-manager
vim /etc/NetworkManager/conf.d/manage-all.conf
[keyfile]
unmanaged-devices=none
<ESC>ZZ
systemctl restart NetworkManager
At this point it was time to chime in with nmcli/nmtui
and do some housekeeping, but once all that was done and tested, it wsas time to banish the remnants of Netplan/networkd
.
systemctl disable --now systemd-networkd.service systemd-networkd.socket networkd-dispatcher.service && systemctl restart NetworkManager
apt -y purge netplan netplan.io
And that was it.
Leave a Reply