-
-
Save mss/7a8e048dd51e5ef928039f1450ba8f31 to your computer and use it in GitHub Desktop.
# Tested on an upgraded Ubuntu 20.04 | |
apt install netplan.io | |
systemctl unmask systemd-networkd.service | |
systemctl unmask systemd-resolved.service | |
ENABLE_TEST_COMMANDS=1 netplan migrate | |
netplan try | |
reboot | |
apt purge ifupdown resolvconf | |
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf |
@slippers you're welcome. IIRC the (missing) last step was the one which originally broke my neck.
Thanks! I am migrating all my Ubuntu systems to this nice combination. Please note that removing resolvconf created the symbolic link /etc/resolv.conf as desired:
% ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 29 Sep 29 2017 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
% sudo apt remove resolvconf
...
resolvconf.postrm: Reboot recommended
...
% ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 39 Jun 28 17:23 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
%
Never got ENABLE_TEST_COMMANDS=1 netplan migrate
to work.
From the documentation it says netplan ifupdown-migrate
.
EDIT: That didn't work either.
EDIT2: It needs to be Ubuntu 20.04 for it to work. 22.04 doesn't work from my testing.
Thank you, this helped a lot! I never would have remembered to do that last symlink!
It's really strange but I could not find any official documentation for the netplan migrate
command. It used a couple of depreciated things like gateway4
but overall it worked really well!
A couple of things I discovered it does:
- Uses
/etc/network/interfaces
to generate a netplan config file named/etc/netplan/10-ifupdown.yaml
- Renames
/etc/network/interfaces
to/etc/network/interfaces.netplan-converted
Note sure if it does anything else, those are just the things I noticed.
Thanks for the author!
On Debian 12 I got couple of issues when I ran netplan try
. I'll share my solutions:
- "Cannot call Open vSwitch: ovsdb-server.service is not running."
apt-get install openvswitch-switch
https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/2041727
- "gateway4 has been deprecated, use default routes instead."
replaced:
gateway4: 192.168.10.1
with:
routes:
- to: default
via: 192.168.10.1
https://unix.stackexchange.com/a/681221
- My /etc/resolv.conf was emptied by NetworkManager somehow when turning WiFi off, so my eth0 wasn't resolving hostnames.
apt install systemd-resolved
thanks