From c12cc5a78f0b4b153fbe71c2ea3d5ff06d8cde2d Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 20 Nov 2026 11:04:12 +0000 Subject: host: IPv6 for the guests' tcp:// and udp:// rules The guests get IPv6: fcbr0 has fdfc:fc::1/64 (module argument prefix6), the host's dnsmasq sends router advertisements, and each guest takes the address from its MAC (SLAAC with EUI-64; the guest's networkd is set up for that, without privacy addresses), so the host knows each tap's address, as with IPv4. The rules take IPv6 addresses in brackets, tcp://[42::1]:22 or udp://[42::/16]:5000-5100, and names now resolve to both families (and get AAAA records for the guests). Forwarded connections get NATed to the host's address, like IPv4. Like IPv4 everything else is refused: the bridge only lets a tap send from its own addresses (or :: for duplicate address detection), the host only answers neighbour and router discovery, denyDestinations and the per-guest limits apply. HTTPS stays IPv4, through the proxy: IPv6 port 443 is refused. --- pkgs/run-firecracker-vm/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkgs/run-firecracker-vm') diff --git a/pkgs/run-firecracker-vm/default.nix b/pkgs/run-firecracker-vm/default.nix index 855b43c..6df6222 100644 --- a/pkgs/run-firecracker-vm/default.nix +++ b/pkgs/run-firecracker-vm/default.nix @@ -217,6 +217,12 @@ let # The default client identifier is derived from the machine-id, # which is the same in every VM, so they'd all get the same lease. dhcpV4Config.ClientIdentifier = "mac"; + # IPv6: the address from the MAC, which the host expects (see + # modules/host), and DNS stays the host's IPv4 address. + networkConfig.IPv6AcceptRA = true; + networkConfig.IPv6PrivacyExtensions = "no"; + ipv6AcceptRAConfig.Token = "eui64"; + ipv6AcceptRAConfig.UseDNS = false; }; boot.bcache.enable = false; -- cgit v1.3.1