Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Ethernet connection reverts to DHCP without specifying networkd as the renderer: cloud-init config files #1013

Open
1 task done
codecowboy opened this issue Feb 28, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@codecowboy
Copy link

codecowboy commented Feb 28, 2025

What happened?

If you add a static IP network interface config in the cloud-init network-config file using the netplan syntax as stated in the README on the system-boot partition created by the imager, this is not respected and reverts to a standard DHCP config for eth0 on first boot. There is something happening either during the handoff phase when the cloud-init config gets written to the writable partition, or when cloud-init comes to parse the file and write the network config files, that causes the OS to fall back to a DHCP default. Because this happens without any kind of notification or warning, it is almost impossible to debug. The issue can be confirmed by looking at the files written to /boot/firmware and also in cloud-init and netplan config directories.

Here's a working example:

network:
  version: 2
  **renderer: networkd**
  ethernets:
    eth0:
      dhcp4: false
      dhcp6: false
      addresses:
        - 10.10.1.5/24
      gateway4: 10.10.1.1
      nameservers:
        search: [home]
        addresses: [8.8.8.8, 8.8.4.4]

Other people have mentioned this issue on stackoverflow / the rpi forums and it seems the imager devs are at least aware of the networkd requirement:

cloudinitnetwork += " renderer: networkd\n"

There was also this issue raised some time ago:

#571

I would be grateful if somebody could explain:

a) Why this happens and
b) Why setting the renderer to networkd resolves it.

I'm not entirely sure of the interactions between NetworkManager, Netplan and networkd but suspect that networkd somehow takes priority during the boot process, and writes the necessary files which in turn prevents other processes from doing so.

The existing related issue was closed but I would urge you to at least note the requirement in the README as it has caused me and others endless frustration. Ideally it should also appear as a commented example in network-config. Even better would be for the ethernet adapter to also be configurable in the imager gui.

I've taken the time to log this as it caused me so much frustration. I hope you'll consider addressing it. Thanks!

Version

1.9.2 (Default)

What host operating system were you using?

macOS

Host OS Version

Sequoia 15.3.1

Selected OS

Ubuntu 24.04.02 but the issue is at least partly caused by the imager

Which Raspberry Pi Device are you using?

Raspberry Pi 5

What kind of storage device are you using?

microSD Card in an internal reader

OS Customisation

  • Yes, I was using OS Customisation when the bug occurred.

Relevant log output

Happy to provide further details on request. 

@codecowboy codecowboy added the bug Something isn't working label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant