diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-06-04 15:41:18 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-06-04 15:41:18 +0000 |
| commit | c4f354d38b84f3f2db4875470442db702c47edba (patch) | |
| tree | c802024e5009f5867f30a94d24eea3d8e9d237e9 | |
| parent | df525d7b40421cc20a349768cf6dfc1091130800 (diff) | |
| download | meta-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.bb | 2 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-yocto/container-net.cfg | 20 | ||||
| -rw-r--r-- | recipes-kernel/linux/linux-yocto_virtualization.inc | 1 |
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) | ||
| 2 | CONFIG_NF_TABLES=y | ||
| 3 | CONFIG_NF_TABLES_INET=y | ||
| 4 | CONFIG_NFT_CT=y | ||
| 5 | CONFIG_NFT_LOG=y | ||
| 6 | CONFIG_NFT_LIMIT=y | ||
| 7 | CONFIG_NFT_MASQ=y | ||
| 8 | CONFIG_NFT_NAT=y | ||
| 9 | CONFIG_NFT_REJECT=y | ||
| 10 | CONFIG_NFT_REJECT_INET=y | ||
| 11 | CONFIG_NFT_COMPAT=y | ||
| 12 | CONFIG_NFT_FIB=y | ||
| 13 | CONFIG_NFT_FIB_INET=y | ||
| 14 | CONFIG_NFT_FIB_IPV4=y | ||
| 15 | CONFIG_NFT_FIB_IPV6=y | ||
| 16 | |||
| 17 | # Connection tracking (required by nftables ct and masquerade) | ||
| 18 | CONFIG_NF_CONNTRACK=y | ||
| 19 | CONFIG_NF_NAT=y | ||
| 20 | CONFIG_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 |
| 114 | KERNEL_FEATURES:append = "${@distro_cond_feature('cfg/container.scc', 'vcontainer', d)}" | 114 | KERNEL_FEATURES:append = "${@distro_cond_feature('cfg/container.scc', 'vcontainer', d)}" |
| 115 | SRC_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 |
| 117 | SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'vxn', ' file://vxn.cfg', '', d)}" | 118 | SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'vxn', ' file://vxn.cfg', '', d)}" |
