Last active
March 25, 2025 10:15
-
-
Save mss/7a8e048dd51e5ef928039f1450ba8f31 to your computer and use it in GitHub Desktop.
Migrate from ifupdown to netplan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.