From 5b9200463727fe7dfd84e4e8fbc7570f373fe436 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Tue, 14 May 2024 10:22:59 +0200 Subject: [PATCH 1/2] enable network on ipv6-only hosts The networkd template explicitly disables IPv6-connectivity. When connecting to a host, the attempt to use IPv6 results in -ENETUNREACH from the guest kernel. If the host is IPv6-only, the host kernel likewise makes attempts to use IPv4 result in -ENETUNREACH. Hence fakemachine has dysfunctional network when invoked on an IPv6-only host. Closes: #207 Signed-off-by: Helmut Grohne --- machine.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/machine.go b/machine.go index 5ae5bcb..917d2d6 100644 --- a/machine.go +++ b/machine.go @@ -301,9 +301,6 @@ Type=ether [Network] DHCP=ipv4 -# Disable link-local address to speedup boot -LinkLocalAddressing=no -IPv6AcceptRA=no ` const networkdLinkTemplate = ` From 42bacc88715223457aea3330ab94083648839067 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Mon, 18 Nov 2024 23:20:56 +0100 Subject: [PATCH 2/2] fakemachine.service should wait for network-online.target Just because systemd-networkd has been started does not mean it has configured any interfaces (even when they are static). The subsequent unit systemd-network-wait-online.service will wait for at least one interface to be configured (and in fakemachine, there is only one). This is being ordered before network-online.target. Signed-off-by: Helmut Grohne --- machine.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/machine.go b/machine.go index 917d2d6..d7cc51c 100644 --- a/machine.go +++ b/machine.go @@ -337,8 +337,8 @@ Description=fakemachine runner Conflicts=shutdown.target Before=shutdown.target Requires=basic.target -Wants=systemd-resolved.service binfmt-support.service systemd-networkd.service -After=basic.target systemd-resolved.service binfmt-support.service systemd-networkd.service +Wants=systemd-resolved.service binfmt-support.service network-online.target +After=basic.target systemd-resolved.service binfmt-support.service network-online.target OnFailure=poweroff.target [Service]