Skip to content

Replace dhclient with systemd-networkd - #50

Open
aofei wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
aofei:master
Open

Replace dhclient with systemd-networkd#50
aofei wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
aofei:master

Conversation

@aofei

@aofei aofei commented Nov 19, 2022

Copy link
Copy Markdown

Fixes #45, #49

@skbeh

This comment was marked as resolved.

@aofei

aofei commented Nov 20, 2022

Copy link
Copy Markdown
Author

@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
Copy Markdown
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
Copy Markdown
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

skbeh commented Feb 10, 2023

Copy link
Copy Markdown
Contributor

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

@hopkiw

hopkiw commented Feb 10, 2023

Copy link
Copy Markdown

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

skbeh commented Feb 19, 2023

Copy link
Copy Markdown
Contributor

@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

hopkiw commented Feb 19, 2023

Copy link
Copy Markdown

@skbeh

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

@skbeh

skbeh commented Feb 19, 2023

Copy link
Copy Markdown
Contributor

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

@hopkiw

hopkiw commented Feb 19, 2023

Copy link
Copy Markdown

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

@skbeh

skbeh commented Feb 19, 2023

Copy link
Copy Markdown
Contributor

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

hopkiw commented Feb 19, 2023

Copy link
Copy Markdown

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