To create a network bridge called "br0" using nmcli on CentOS 8, you can use the following steps:
bridge-utils package, which provides the brctl utility that is required to create and manage bridge interfaces:sudo yum install bridge-utils
nmcli to create the bridge interface:sudo nmcli connection add type bridge con-name br0 ifname br0
nmcli command. For example, to add the eth0 interface to the bridge:sudo nmcli connection add type ethernet con-name eth0 ifname eth0 master br0
sudo nmcli connection up br0
autoconnect property of the bridge connection to yes:sudo nmcli connection modify br0 autoconnect yes
That's it! You should now have a working network bridge called "br0" that is composed of the physical interfaces you added to it. You can verify that the bridge is working by checking the output of the ip a command, which should show the bridge interface and the interfaces that are part of it.
Note: If you need to remove the bridge or any of its associated interfaces, you can use the
nmcli connection deletecommand to delete them. For example, to delete theeth0interface from the bridge:
sudo nmcli connection delete eth0