From fe46f7703e6145af9d3c9eb43d6ded19b316c83c Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 25 Nov 2026 14:41:25 +0000 Subject: base/kernel.nix: what modules/host needs of nf_tables The cut-down kernel had nf_tables, with IPv4, NAT and conntrack (and bridges, taps and veths), but not the inet, IPv6 and bridge families, nor ct count, limit, log, reject, fib, redirect and masquerade, which modules/host's rules use, so a guest (with --nested, for KVM) couldn't run guests of its own, nor test modules/host. Now it has them, built in, like the rest of its netfilter. --- base/kernel.nix | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/base/kernel.nix b/base/kernel.nix index 16983c7..6646d33 100644 --- a/base/kernel.nix +++ b/base/kernel.nix @@ -1,8 +1,11 @@ # Cut-down guest kernel, based on Firecracker's recommended configuration, # as a module for the base system: # nix-build pkgs/run-firecracker-vm --arg base '[ base/kernel.nix ]' -# With erofs and 9P (for the store), and KVM as modules, which load when -# the VMM offers hardware virtualization (run-firecracker-vm --nested). +# With erofs and 9P (for the store), KVM as modules, which load when +# the VMM offers hardware virtualization (run-firecracker-vm --nested), +# and what modules/host needs of nf_tables (inet, IPv6 and bridge +# families, ct count, limit, log, reject, fib, redirect, masquerade), so +# a guest can run guests, too. { pkgs, ... }: let linux = pkgs.linux_6_18; @@ -26,6 +29,18 @@ let CONFIG_KVM=m CONFIG_KVM_AMD=m CONFIG_KVM_INTEL=m + CONFIG_NF_TABLES_INET=y + CONFIG_NF_TABLES_IPV6=y + CONFIG_NF_TABLES_BRIDGE=y + CONFIG_NFT_CONNLIMIT=y + CONFIG_NFT_LOG=y + CONFIG_NFT_LIMIT=y + CONFIG_NFT_MASQ=y + CONFIG_NFT_REDIR=y + CONFIG_NFT_REJECT=y + CONFIG_NFT_FIB_IPV4=y + CONFIG_NFT_FIB_IPV6=y + CONFIG_NFT_FIB_INET=y EOF make olddefconfig ''; -- cgit v1.3.1