Skip to content

Instantly share code, notes, and snippets.

@kopwei
Last active December 29, 2023 07:05
Show Gist options
  • Save kopwei/738e9f9a9e0b47e5b82ef388a8da6b3b to your computer and use it in GitHub Desktop.
Save kopwei/738e9f9a9e0b47e5b82ef388a8da6b3b to your computer and use it in GitHub Desktop.
Ubuntu Bionic netplan config for Openvswitch bridged interface

Preparation

  • System ubuntu18.04.2 desktop
  • Internet interface name eth0 with dhcp.

Steps

  1. Disable network-manager:
sudo systemctl stop NetworkManager.service
sudo systemctl disable NetworkManager.service

sudo systemctl stop NetworkManager-wait-online.service
sudo systemctl disable NetworkManager-wait-online.service

sudo systemctl stop NetworkManager-dispatcher.service
sudo systemctl disable NetworkManager-dispatcher.service

sudo systemctl stop network-manager.service
sudo systemctl disable network-manager.service
  1. Install netplan
sudo apt install netplan.io
  1. Remove old network
sudo mv /etc/netplan/01-network-manager-all.yaml /etc/netplan/01-network-manager-all.yaml.orig
  1. Create file /etc/netplan/02-manual-network-conf.yaml with following content:
network:
  version: 2
  renderer: networkd
  ethernets:
   eth0:
     dhcp4: no
  bridges:
    brctrl:
      interfaces: [eth0]
      dhcp4: true
  1. Apply the network
sudo netplan generate
sudo netplan apply
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment