banner
late autumn

lateautumn

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

linux bridge

In a virtualized environment, you may have multiple virtual machines and host machine network interfaces, using a bridge can allow 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
  1. 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
  1. Delete the existing wired connection
nmcli c delete eno1
  1. Bind the network card
nmcli c add type bridge-slave autoconnect yes con-name enp3s0f3u2c2 master br0
  1. 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"

# address is the MAC address of the network card

image.png

image.png
It is recommended to select automatic connection in general configuration
image.png

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