banner
late autumn

lateautumn

一个什么都不会的职中生
github
email
telegram
bilibili

linux bridge

In a virtualized environment, you may have multiple virtual machines and network interfaces on the host machine. Using a bridge allows them to communicate on the same network. This facilitates direct communication between virtual machines and enables easy interaction with the physical network.

Choose one of the following options:

Command Line Configuration#

1.Create a bridge device

nmcli c add type bridge autoconnect yes con-name br0 ifname br0

2.Configure bridge IPv4

Dynamic allocation
nmcli c modify br0 ipv4.method auto 
Static allocation
nmcli c modify br0 ipv4.method manual ipv4.address 192.168.3.10 
nmcli c modify br0 ipv4.gateway 192.168.3.1
nmcli c modify br0 ipv4.dns 192.168.3.1

3.Delete the existing wired connection

nmcli c delete eno1

4.Bind the network card

nmcli c add type bridge-slave autoconnect yes con-name enp3s0f3u2c2 master br0

5.Restart Linux

image.png

GUI Configuration#

Wireless network card needs to be set to 4addr mode

# /etc/udev/rules.d/91-wifi-4addr-mode.rules
ACTION=="add", SUBSYSTEM=="net", ATTRS{address}=="04:cf:4b:21:76:0e", RUN+="/usr/bin/iw dev $name set 4addr on"

# Replace address with the MAC address of the network card

image.png

image.png
It is recommended to select "Automatically connect" in the general configuration
image.png

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.