apiv1

eno1→eno2 桥接笔记

简要说明:br0 = {eno1, eno2} 是纯二层交换机,把上级局域网透传给下级路由器 WAN 口(无路由/NAT,桥无方向性)。主机 IP 在 br0 上。

配置(/etc/netplan/50-cloud-init.yaml):

network:
  version: 2
  ethernets:
    eno1: {dhcp4: false, dhcp6: false}
    eno2: {dhcp4: false, dhcp6: false}
  bridges:
    br0:
      interfaces: [eno1, eno2]
      macaddress: xxx
      dhcp4: true
      parameters: {stp: false, forward-delay: 0}

命令

netplan generate && netplan apply   # 应用
ip -br addr show br0                # 验证桥 IP
bridge link show master br0         # 验证 eno1/eno2 是桥口

本机注意:eno1 上如有子接口会阻塞入桥(EBUSY),先 ip link del 子接口