安装桥接依赖包

sudo apt  install bridge-utils

创建br0桥接

静态方式

auto br0
iface br0 inet static
    address 172.16.31.207
    broadcast 172.16.31.255
    netmask 255.255.254.0
    gateway 172.16.30.1
    # If the resolvconf package is installed, you should not edit
        # the resolv.conf configuration file manually. Set name server here
        #dns-nameservers 192.168.2.254
        # If you have muliple interfaces such as eth0 and eth1
        # bridge_ports eth0 eth1
    bridge_ports ens3
    bridge_stp off       # disable Spanning Tree Protocol
        bridge_waitport 0    # no delay before a port becomes available
        bridge_fd 0          # no forwarding delay

动态方式

## DHCP ip config file for br0 ##
auto br0
# Bridge setup
iface br0 inet dhcp
bridge_ports eno1
作者:admin  创建时间:2023-01-30 14:50
最后编辑:admin  更新时间:2023-08-21 16:19