Skip to content

Instantly share code, notes, and snippets.

@VeloAddict
Forked from poltpolt/netplan2NM.sh
Created March 24, 2022 20:06
Show Gist options
  • Save VeloAddict/760a43f124590667a2f0246d0abd88b8 to your computer and use it in GitHub Desktop.
Save VeloAddict/760a43f124590667a2f0246d0abd88b8 to your computer and use it in GitHub Desktop.
Change Ubuntu 20.04 server netplan to use NetworkManager instead of networkd
#!/usr/bin/env bash
# netplan2NM.sh
# Ubuntu server 20.04 Change from netplan to NetworkManager for all interfaces
echo 'Changing netplan to NetowrkManager on all interfaces'
# backup existing yaml file
cd /etc/netplan
cp 00-installer-config.yaml 00-installer-config.yaml.orig
apt update
apt -y install network-manager
# re-write the yaml file
cat << EOF > /etc/netplan/00-installer-config.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: NetworkManager
EOF
# setup netplan for NM
netplan generate
netplan apply
# make sure NM is running
systemctl enable NetworkManager.service
systemctl restart NetworkManager.service
echo 'Done!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment