fix(embed): fall back to iptables-legacy when nft backend is unsupported#74
Conversation
Rancher Desktop with VZ virtualization (no Rosetta) runs a minimal ARM64 kernel that lacks CONFIG_NF_TABLES. The entrypoint now probes iptables-nft first, falls back to iptables-legacy, and aborts if neither works — network isolation is never silently skipped.
There was a problem hiding this comment.
Pull request overview
This PR updates the embedded container entrypoint to reliably enforce outbound network isolation across environments where the default iptables backend (nft) may be unsupported (e.g., kernels without nf_tables).
Changes:
- Add a startup probe to select a working iptables implementation (
iptablesfirst, theniptables-legacy). - Abort container startup if no functional iptables implementation is available (to avoid silently skipping isolation).
- Route all subsequent firewall rule insertions/appends through the selected iptables variant.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
iptables(nft) first, falls back toiptables-legacy, and hard-aborts if neither worksCONFIG_NF_TABLESRoot cause
Ubuntu 24.04's
iptablespackage defaults to the nftables backend (iptables-nft). Rancher Desktop's VZ virtualization runs a minimal ARM64 Linux kernel withoutnf_tableskernel module support →iptables: Failed to initialize nft: Protocol not supported.Both
iptables-nftandiptables-legacyship in the same Ubuntu package and provide identical rule semantics — only the kernel backend differs.