feat(config): enable netfilter, bridge, VLAN and VXLAN for container networking#6
Merged
Merged
Conversation
…networking Turn on the kernel primitives needed for container runtimes (Docker, Podman, CNI) and Tailscale to function inside the guest. Applied to all three architecture configs (x86_64, aarch64, riscv64) so behavior is uniform across builds. Netfilter: - Core framework, conntrack, NAT (with REDIRECT and MASQUERADE) - nftables engine with inet and bridge families, plus CT/LOG/LIMIT/ MASQ/REDIR/NAT/REJECT/COMPAT verbs and bridge conntrack - Legacy iptables/ip6tables (filter, mangle, nat) with REJECT, MASQUERADE and REDIRECT targets - xtables matches (addrtype, comment, conntrack, limit, multiport, state) and shared MARK/LOG/CHECKSUM/SET targets - ipset with the four common hash shapes (ip, ipport, net, netport) L2 networking: - CONFIG_BRIDGE + CONFIG_BRIDGE_NETFILTER so docker0-style bridges can have iptables/nftables rules applied to bridged traffic - CONFIG_VLAN_8021Q for 802.1Q VLAN tagging - CONFIG_VXLAN for L2-over-UDP overlay networks used by Docker Swarm, Flannel, Weave and Cilium Since CONFIG_MODULES is off, every option is built-in (=y); olddefconfig will resolve any remaining dependencies at build time.
|
Following up on the discussion in superradcompany/microsandbox#598: All other flags I have in my local config are included in the PR already. I very quickly tested the config changes locally and docker seems to run fine. |
…SIX mqueue Round out the netfilter surface and enable POSIX message queues: - CONFIG_IP_NF_RAW + CONFIG_IP6_NF_RAW for the raw table (NOTRACK rules and pre-conntrack mangling) - CONFIG_NF_CT_NETLINK so userspace tools (conntrack-tools, conntrackd, systemd-networkd, libnetfilter_conntrack) can read and modify the conntrack table over netlink - CONFIG_NETFILTER_XT_MATCH_IPVS for matching IPVS connections via iptables/nftables - CONFIG_POSIX_MQUEUE on x86_64 (already on for aarch64 and riscv64) for POSIX message queue IPC Applied uniformly across all three architecture configs where relevant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CONFIG_BRIDGE+CONFIG_BRIDGE_NETFILTERso docker0-style bridges can have iptables/nftables rules applied to bridged traffic, plusCONFIG_NF_CONNTRACK_BRIDGEfor modern userland-proxy-free port publishing.CONFIG_VLAN_8021Q(802.1Q tagging) andCONFIG_VXLAN(L2-over-UDP overlay used by Docker Swarm, Flannel, Weave and Cilium).config-libkrunfw_x86_64,_aarch64,_riscv64) so guest behavior is uniform across builds.Motivation: the previous configs had
CONFIG_NETFILTER is not set, which blocks any container runtime or Tailscale (outside userspace-networking mode) from working inside the guest. SinceCONFIG_MODULESis off, every option is built-in (=y) andmake olddefconfigresolves any remaining dependencies at build time. The curated scope is intentionally tighter than a full netfilter dump — legacy helpers (FTP/IRC/H323 ALGs), flow offload, SYNPROXY/TPROXY, IPVS, XFRM-backed matches, raw/security tables, and most niche xtables matches are omitted to keep the embedded kernel bundle size increase modest (estimated ~400–700 KB added kernel text baked into the shipped.so/.dylib).Test Plan
make -j"$(nproc)"produceslibkrunfw.so.5.2.1without kconfig errors frommake olddefconfig.ubuntu-24.04-armproduces the aarch64.so..sosize delta vs. the previous build is within expected range (~400–700 KB of added kernel text).cat /proc/net/nf_conntrackexists,iptables -L -nworks (viaiptables-nftcompat),nft list rulesetworks.dockerdstarts without errors, defaultdocker0bridge comes up,docker run --rm -p 8080:80 nginxpublishes a port (exercises MASQUERADE + bridge-netfilter + conntrack).ip link add vxlan0 type vxlan id 42 dev eth0 dstport 4789succeeds.ip link add link eth0 name eth0.100 type vlan id 100succeeds.tailscaledin default mode successfully programsts-input/ts-forward/ts-postroutingchains;tailscale upbrings the node online.libkrunfw-linux-x86_64.so.5.2.1,libkrunfw-linux-aarch64.so.5.2.1,libkrunfw-macos-x86_64.5.dylib,libkrunfw-macos-aarch64.5.dylib) on a test release tag.