Skip to content

fix(embed): fall back to iptables-legacy when nft backend is unsupported#74

Merged
thejoeejoee merged 7 commits into
mainfrom
fix-iptables-legacy
Apr 16, 2026
Merged

fix(embed): fall back to iptables-legacy when nft backend is unsupported#74
thejoeejoee merged 7 commits into
mainfrom
fix-iptables-legacy

Conversation

@thejoeejoee

Copy link
Copy Markdown
Collaborator

Summary

  • Entrypoint now probes iptables (nft) first, falls back to iptables-legacy, and hard-aborts if neither works
  • Fixes container startup on Rancher Desktop with VZ virtualization (no Rosetta) where the kernel lacks CONFIG_NF_TABLES
  • Network isolation is never silently skipped

Root cause

Ubuntu 24.04's iptables package defaults to the nftables backend (iptables-nft). Rancher Desktop's VZ virtualization runs a minimal ARM64 Linux kernel without nf_tables kernel module support → iptables: Failed to initialize nft: Protocol not supported.

Both iptables-nft and iptables-legacy ship in the same Ubuntu package and provide identical rule semantics — only the kernel backend differs.

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.
Copilot AI review requested due to automatic review settings April 16, 2026 12:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (iptables first, then iptables-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.

Comment thread internal/embed/assets/entrypoint.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/how-to/installation.md
Comment thread docs/explanation/network-isolation.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@thejoeejoee thejoeejoee merged commit e403eb6 into main Apr 16, 2026
11 checks passed
This was referenced Apr 16, 2026
@thejoeejoee thejoeejoee added bug Something isn't working docker Container, compose, DinD, image resolution labels Apr 17, 2026
@thejoeejoee thejoeejoee deleted the fix-iptables-legacy branch April 26, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working docker Container, compose, DinD, image resolution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants