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

Replace dhclient with systemd-networkd #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aofei
Copy link

@aofei aofei commented Nov 19, 2022

Fixes #45, #49

@skbeh

This comment was marked as resolved.

@aofei
Copy link
Author

aofei commented Nov 20, 2022

@skbeh That's weird. The reason why I used sysetmd-networkd in the first place was to solve the problem of dhclient not being able to assign IPv6 address and configure routes properly (see #45).

I've intentionally kept the provided configuration file as simple as possible, and in my tests it worked fine for IPv4-only, IPv6-only, and IPv4-IPv6 scenarios.

@toastwaffle
Copy link
Collaborator

@aofei thanks for the contribution. I'd like to do some testing before merging and building a public image.

@skbeh could you suggest any specific configurations we should test this with before merging

@toastwaffle toastwaffle self-assigned this Nov 27, 2022
@lcastelli
Copy link
Collaborator

I still see dhclient being documented as the recommended DHCP client for GCE. See https://cloud.google.com/compute/docs/import/configuring-imported-images:

  • To ensure high performance network capability, use the following recommended network configurations:

So I'm not sure whether it's a good idea to switch the default yet. Given the ISC DHCP client is end-of-life, I would expect GCE to move on to a different recommendation at some point. But probably we should only move when that happens (eg when the Debian GCE image switches to something else).

@skbeh
Copy link
Contributor

skbeh commented Feb 10, 2023

@aofei I reattempted using systemd-networkd with your provided config, and it works fine.

@hopkiw
Copy link

hopkiw commented Feb 10, 2023

I still see dhclient being documented as the recommended DHCP client for GCE.

It's just whatever the distro is using. For example Ubuntu has been using systemd-networkd for a while, including the official GCE images for Ubuntu. If arch is on systemd-networkd now it should be fine to update image builders accordingly.

@skbeh
Copy link
Contributor

skbeh commented Feb 19, 2023

@aofei There's no reason to only enable DHCP for eth0. If the instance has more than one interfaces, the more interfaces will be failed to get IP address.

It should be set to Name=eth* and the file should be renamed to "05-eth.network".

@hopkiw
Copy link

hopkiw commented Feb 19, 2023

@skbeh

i don't think that's true. the guest agent handles all secondary interfaces

@skbeh
Copy link
Contributor

skbeh commented Feb 19, 2023

I am not sure how the guest agent interacts with systemd-networkd. Does the guest agent configure the interfaces?

@hopkiw
Copy link

hopkiw commented Feb 19, 2023

@skbeh the guest agent uses a simple logic of invoking dhclient once for all secondary interfaces. this is configurable to an extent

@skbeh
Copy link
Contributor

skbeh commented Feb 19, 2023

If dhclient is not installed, there is no dhclient to invoke. Also I think it is not a good practice to depend on the guest agent to configure network.

@hopkiw
Copy link

hopkiw commented Feb 19, 2023

there's an argument to be made. the official supported distros (ubuntu, centos etc) all rely on the guest agent since arch is not officially supported by gcp i think it's up to this repo maintainers to make that decision. but if you want to differ from how the other distros do it, at least the dhclient behavior of the guest agent should be disabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IPv4 and IPv6 (dual-stack) support?
5 participants