View connection from the Network Manager GUI in settings:



Another option is to type the following command:

$ nmcli con show
$ nmcli connection show --active

to create a bridge, named br0

$ sudo nmcli con add ifname br0 type bridge con-name br0
$ sudo nmcli con add type bridge-slave ifname eno1 master br0
$ nmcli connection show
You can disable STP too:

$ sudo nmcli con modify br0 bridge.stp no
$ nmcli con show
$ nmcli -f bridge con show br0

The last command shows the bridge settings including disabled STP:

bridge.mac-address:                     --
bridge.stp:                             no
bridge.priority:                        32768
bridge.forward-delay:                   15
bridge.hello-time:                      2
bridge.max-age:                         20
bridge.ageing-time:                     300
bridge.multicast-snooping:              yes

How to turn on the bridge interface

You must turn off “Wired connection 1” and turn on br0:

$ sudo nmcli con down "Wired connection 1"
$ sudo nmcli con up br0
$ nmcli con show



Use 
ip command to view the IP settings:

$ ip a s
$ ip a s br0


Optional: How to use br0 with KVM

Now you can connect VMs (virtual machine) created with KVM/VirtualBox/VMware workstation to a network directly without using NAT. Create a file named br0.xml for KVM using vi command or cat command:


$ cat /tmp/br0.xml

Append the following code:

<network>
  <name>br0</name>
  <forward mode="bridge"/>
  <bridge name="br0" />
</network>


Run virsh command as follows:



# virsh net-define /tmp/br0.xml
# virsh net-start br0
# virsh net-autostart br0
# virsh net-list --all

For more info read the following man page:

$ man ip
$ man nmcli


The last command shows the bridge settings including disabled STP:

 

Byla tato odpověď nápomocná? 2 Uživatelům pomohlo (2 Hlasů)