From eef3e88d3ae63b0f2c11644b5ec4130d739469b5 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 4d6e6c2..8cde1c4 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 1cc4fd85059c83cf48448faba3abd1b30bfc1c38 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 8cde1c4..167718b 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]