0

My ubuntu18 hosted in Azure cloud. I tried setup bridge in netplan, but fail.

original 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

modified 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

as result - i lost my network, during restart i saw errors like that:

[  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'
0

Try this. Keep the exact same spacing, indentation, and no tabs.

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

| improve this answer | |
  • Yes, it works. Thank you – Andrey Rubanko May 21 at 5:45
  • @AndreyRubanko Glad it worked for you! – heynnema May 21 at 10:00
0

Thanks for quoting the error message from the log; this issue has been reported elsewhere but without that log message it's quite an opaque failure.

This looks like a bug in the cloud-init azure datasource. A bug has been opened for this issue at https://bugs.launchpad.net/cloud-init/+bug/1879737.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.