aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-25 14:41:25 +0000
committertv <tv@krebsco.de>2026-11-25 14:44:08 +0000
commitfe46f7703e6145af9d3c9eb43d6ded19b316c83c (patch)
tree2922c210b86f8e015e2b7d9cdd4e3a91fb1f3487
parentdb8771df6809be57362477395bc4450b32dd3e74 (diff)
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.
-rw-r--r--base/kernel.nix19
1 files 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
'';