【问题标题】:Create netplan bridge at Azure Ubuntu在 Azure Ubuntu 上创建 netplan 网桥
【发布时间】:2020-05-19 05:12:10
【问题描述】:

我的 ubuntu18 托管在 Azure 云中。 我尝试在 netplan 中设置网桥,但失败了。

原始 50-cloud-init.yaml

    network:
    ethernets:
      eth0:
        dhcp4: true
        addresses:
          - 10.0.20.6/24
        dhcp6: false
        match:
          macaddress: 00:0d:3a:83:44:a1
    version: 2

修改 50-cloud-init.yaml

network:
    ethernets:
      eth0:
        dhcp4: false
        dhcp6: false
        match:
          macaddress: 00:0d:3a:83:44:a1
    bridges:
      br0:
        interfaces: [eth0]
        dhcp4: true
        addresses:
          - 10.0.20.6/24
    version: 2

结果 - 我失去了我的网络,在重新启动期间我看到了这样的错误:

[  134.947548] cloud-init[902]: 2020-05-19 04:33:09,786 - azure.py[ERROR]: Failed to read /var/lib/dhcp/dhclient.eth0.leases: [Errno 2] Nosuch file or directory: '/var/lib/dhcp/dhclient.eth0.leases'

【问题讨论】:

    标签: azure ubuntu netplan


    【解决方案1】:

    @heynnema 在这里给了我答案https://askubuntu.com/questions/1241624/create-netplan-bridge-at-azure-ubuntu

    答案副本: 试试这个。保持完全相同的间距、缩进和没有制表符。

    network:
      version: 2
      renderer: networkd
      ethernets:
        eth0:
          match:
            macaddress: 00:0d:3a:83:44:a1
      bridges:
        br0:
          dhcp4: true
          interfaces:
            - eth0
          macaddress: 00:0d:3a:83:44:a1
    
    sudo netplan --debug generate
    
    sudo netplan apply
    
    reboot
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-06-17
      • 2013-07-09
      • 1970-01-01
      • 2017-12-09
      • 2021-07-17
      • 2015-09-14
      • 2021-08-17
      相关资源
      最近更新 更多