To add a network bridge (br0) on a CentOS 8 system using the nmcli
command, you can use the following steps:
- Check the available network interfaces by running the command:
nmcli device
- Create a new bridge interface by running the command:
nmcli connection add type bridge con-name br0 ifname br0
- Add an IP address to the bridge interface by running the command:
nmcli connection modify br0 ipv4.addresses 192.168.1.10/24 ipv4.method manual
- Add the physical interface to the bridge by running the command:
nmcli connection add type bridge-slave con-name eth0 ifname eth0 master br0
- Enable the bridge interface by running the command:
nmcli connection up br0
- Make sure the bridge interface is up and running by running the command:
nmcli device status
Note: replace “eth0” and IP address “192.168.1.10/24” with the appropriate interface and IP address you would like to use. Also, make sure to check your firewall settings and configure it accordingly.
It’s important to note that the above steps will create a bridge interface called br0 and add the physical interface eth0 to it. This effectively bridges the two interfaces together, allowing traffic to flow between them. It also assigns the IP address 192.168.1.10/24 to the bridge interface. Also, it’s important to keep in mind that the changes made above will not persist after reboot, so if you want the bridge to persist reboot you will have to configure it properly on network manager.