summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-06-04 15:41:18 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-06-04 15:41:18 +0000
commitc4f354d38b84f3f2db4875470442db702c47edba (patch)
treec802024e5009f5867f30a94d24eea3d8e9d237e9
parentdf525d7b40421cc20a349768cf6dfc1091130800 (diff)
downloadmeta-virtualization-c4f354d38b84f3f2db4875470442db702c47edba.tar.gz
vpdmn: switch to nftables and add kernel config for netavark
Netavark dropped iptables support entirely and now uses nft directly for firewall rules (masquerade, DNAT, connection tracking). The vpdmn rootfs had iptables installed but the vruntime kernel had CONFIG_NF_TABLES disabled, causing netavark to fail at runtime with "Protocol not supported" when trying to initialize the nftables Netlink socket. Replace iptables with nftables in vpdmn-rootfs-image IMAGE_INSTALL and add container-net.cfg kernel config fragment enabling NF_TABLES, NFT_MASQ, NFT_NAT, NFT_CT, NFT_FIB and related options required by netavark's nftables firewall driver. The fragment is gated on the vcontainer DISTRO_FEATURE so it only applies to vruntime/vcontainer kernels, not arbitrary builds that happen to include meta-virtualization. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/vcontainer/vpdmn-rootfs-image.bb2
-rw-r--r--recipes-kernel/linux/linux-yocto/container-net.cfg20
-rw-r--r--recipes-kernel/linux/linux-yocto_virtualization.inc1
3 files changed, 22 insertions, 1 deletions
diff --git a/recipes-containers/vcontainer/vpdmn-rootfs-image.bb b/recipes-containers/vcontainer/vpdmn-rootfs-image.bb
index cca9191f..909e1298 100644
--- a/recipes-containers/vcontainer/vpdmn-rootfs-image.bb
+++ b/recipes-containers/vcontainer/vpdmn-rootfs-image.bb
@@ -54,7 +54,7 @@ IMAGE_INSTALL = " \
54 aardvark-dns \ 54 aardvark-dns \
55 busybox \ 55 busybox \
56 iproute2 \ 56 iproute2 \
57 iptables \ 57 nftables \
58 util-linux \ 58 util-linux \
59 ca-certificates \ 59 ca-certificates \
60" 60"
diff --git a/recipes-kernel/linux/linux-yocto/container-net.cfg b/recipes-kernel/linux/linux-yocto/container-net.cfg
new file mode 100644
index 00000000..74b567d7
--- /dev/null
+++ b/recipes-kernel/linux/linux-yocto/container-net.cfg
@@ -0,0 +1,20 @@
1# nftables support for container networking (netavark)
2CONFIG_NF_TABLES=y
3CONFIG_NF_TABLES_INET=y
4CONFIG_NFT_CT=y
5CONFIG_NFT_LOG=y
6CONFIG_NFT_LIMIT=y
7CONFIG_NFT_MASQ=y
8CONFIG_NFT_NAT=y
9CONFIG_NFT_REJECT=y
10CONFIG_NFT_REJECT_INET=y
11CONFIG_NFT_COMPAT=y
12CONFIG_NFT_FIB=y
13CONFIG_NFT_FIB_INET=y
14CONFIG_NFT_FIB_IPV4=y
15CONFIG_NFT_FIB_IPV6=y
16
17# Connection tracking (required by nftables ct and masquerade)
18CONFIG_NF_CONNTRACK=y
19CONFIG_NF_NAT=y
20CONFIG_NF_NAT_MASQUERADE=y
diff --git a/recipes-kernel/linux/linux-yocto_virtualization.inc b/recipes-kernel/linux/linux-yocto_virtualization.inc
index 486e77ce..2cf1df74 100644
--- a/recipes-kernel/linux/linux-yocto_virtualization.inc
+++ b/recipes-kernel/linux/linux-yocto_virtualization.inc
@@ -112,6 +112,7 @@ KERNEL_FEATURES:append = "${@distro_cond_feature('cgl/features/selinux/selinux.c
112 112
113# vcontainer 113# vcontainer
114KERNEL_FEATURES:append = "${@distro_cond_feature('cfg/container.scc', 'vcontainer', d)}" 114KERNEL_FEATURES:append = "${@distro_cond_feature('cfg/container.scc', 'vcontainer', d)}"
115SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'vcontainer', ' file://container-net.cfg', '', d)}"
115 116
116# vxn: Xen PV guest support for vcontainer-on-Xen 117# vxn: Xen PV guest support for vcontainer-on-Xen
117SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'vxn', ' file://vxn.cfg', '', d)}" 118SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'vxn', ' file://vxn.cfg', '', d)}"