Ubuntu 20.04 add network bridge (br0) with nmcli command

In Ubuntu 20.04, you can add a network bridge (br0) using the nmcli command-line tool. Here are the steps you can follow:

  1. Start by making sure that the network-manager package is installed by running the following command:
sudo apt-get install network-manager
  1. Next, you can create a new bridge by running the following command:
nmcli connection add type bridge con-name br0 ifname br0
  1. To add an interface to the bridge, you can run the following command:
nmcli connection add type bridge-slave con-name br0-slave ifname interface-name master br0

Replace interface-name with the actual name of the interface you want to add to the bridge, e.g. eth0.

  1. To activate the bridge, you can run the following command:
nmcli connection up br0
  1. To check the status of the bridge, you can run the following command:
nmcli connection show br0
  1. If you want to remove the bridge, you can run the following command:
nmcli connection delete br0
  1. It’s important to keep in mind that creating a bridge may disrupt network connectivity, so it’s a good idea to test the bridge in a non-production environment before applying it to production.
  2. Also, note that creating a bridge will also require you to configure the IP address, mask and gateway for the bridge interface.
  3. You may also need to configure DNS server and DHCP server if they are needed.

Leave a Comment