Bug 16300

Summary: iptables in core-image-full-cmdline doesn't work
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Henrik Lindström <henrik>
Component: oe-core otherAssignee: Randy MacLeod <randy.macleod>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium+ CC: paul, randy.macleod, yoann.congal
Version: 6.0.1   
Target Milestone: 6.1   
Hardware: x86   
OS: x86_64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Henrik Lindström 2026-05-31 07:08:42 UTC
I built core-image-full-cmdline with poky 6.0.1 as distro and qemux86-64 as machine. After booting and logging in as root, running the simple command "iptables -A INPUT -i lo -j ACCEPT" fails with error "modprobe: FATAL: Module ip_tables not found in directory /lib/modules/6.18.24-yocto-standard".

One solution/workaround i found is to enable CONFIG_NETFILTER_XTABLES_LEGACY.
Comment 1 Randy MacLeod 2026-06-04 14:37:20 UTC
Randy to find a person to work on this.
Paul is available for consult as needed.
Comment 2 Paul Barker 2026-06-04 15:56:57 UTC
@Henrik, does it work with the default kernel config if you add `PACKAGECONFIG += "libnftnl"` for iptables? That will require the meta-networking layer.

If that works, we may want to bring libnftnl into OE-core and enable that by default going forward.
Comment 3 Paul Barker 2026-06-04 15:59:05 UTC
Moving this to needinfo.
Comment 4 Henrik Lindström 2026-06-06 08:54:38 UTC
Adding meta-networking and libnftnl to iptables PACKAGECONFIG does indeed work.

I did notice a quirk though, that it only works as long as the "ptest" distro feature is enabled. If i add `DISTRO_FEATURES_OPTED_OUT += "ptest"` to local.conf both iptables and nft stop working. Further adding `KERNEL_EXTRA_FEATURES:append = " features/nf_tables/nf_tables.scc"` to local.conf made it work again.
Comment 5 Randy MacLeod 2026-06-11 15:11:16 UTC
This may be design intent in how the nftables cfg work was done. 
I'll have someone investigate.