Ubuntu 18.04 netplan多VLAN多网桥配置

网络配置

要点: 仅主网桥配置网关,其他不要配置,可以设置默认路由

以下是一个可行的配置方案

network:
  version: 2
  renderer: networkd
  ethernets:
    enp6s0:
      dhcp4: false
      dhcp6: false
  vlans:
    vlan10:
      accept-ra: no
      id: 10
      link: enp6s0
    vlan20:
      accept-ra: no
      id: 20
      link: enp6s0
    vlan30:
      accept-ra: no
      id: 30
      link: enp6s0
  bridges:
    br-mgmt:
      addresses: [192.168.0.2/24]
      interfaces: [enp6s0]
      gateway4: 192.168.0.1
      nameservers: 
        addresses: [202.202.96.33,223.5.5.5]
      parameters:
        stp: false
        forward-delay: 0
        # wait-port: 0 该参数未找到interface对应项
        # https://bugs.launchpad.net/netplan/+bug/1671544
    br-mgmt0:
      addresses: [192.168.0.21/24]
    br-vxlan:
      addresses: [192.168.4.2/24]
      interfaces: [vlan30]
      parameters:
        stp: false
        forward-delay: 0
    br-vlan:
      interfaces: [vlan10]
      parameters:
        stp: false
        forward-delay: 0
    br-storage:
      addresses: [192.168.8.2/24]
      interfaces: [vlan20]
      parameters:
        stp: false
        forward-delay: 0

你可能感兴趣的:(Ubuntu 18.04 netplan多VLAN多网桥配置)