ubuntu server 20.04 netplan 更改 vlan mac 地址

ubuntu server 20.04 netplan 更改 vlan mac 地址

是否可以使用 netplan.io .yaml 更改 vlan 的 mac 地址?

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: true
      dhcp6: true
  vlans:
    vlan10:
      dhcp4: true
      dhcp6: true
      id: 10
      link: eno1
      macaddress: XX:XX:XX:XX:XX:XX

不起作用。

编辑:问题解决。好像是错误的 mac 地址。我的错,抱歉。现在一切正常。

对于其他用户,这里有完整的 01-eno1.yaml 可供使用。

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: true
      dhcp4-overrides:
          route-metric: 500
  vlans:
    vlan10:
      dhcp4: true
      dhcp4-overrides:
          route-metric: 200
      id: 10
      link: eno1
      macaddress: 00:00:00:00:00:10
    vlan20:
      dhcp4: true
      dhcp4-overrides:
          route-metric: 400
      id: 20
      link: eno1
      macaddress: 00:00:00:00:00:20
    vlan30:
      dhcp4: true
      dhcp4-overrides:
          route-metric: 100
      id: 30
      link: eno1
      macaddress: 00:00:00:00:00:30
    vlan100:
      dhcp4: true
      dhcp4-overrides:
          route-metric: 300
      id: 100
      link: eno1
      macaddress: 00:00:00:00:01:00
    vlan200:
      dhcp4: true
      dhcp4-overrides:
          route-metric: 600
      id: 200
      link: eno1
      macaddress: 00:00:00:00:02:00

相关内容