Skip to content

doc: Add "Disable the tables" way to "Prevent connectivity issues wit…#2392

Merged
stgraber merged 2 commits intolxc:mainfrom
anlexN:main
Aug 18, 2025
Merged

doc: Add "Disable the tables" way to "Prevent connectivity issues wit…#2392
stgraber merged 2 commits intolxc:mainfrom
anlexN:main

Conversation

@anlexN
Copy link
Copy Markdown
Contributor

@anlexN anlexN commented Aug 15, 2025

…h Incus and Docker", add nft command to "Allow egress network traffic flows"

Closes Why can I not ping and apt update?

@anlexN anlexN requested a review from stgraber as a code owner August 15, 2025 14:53
@github-actions github-actions bot added the Documentation Documentation needs updating label Aug 15, 2025
Comment on lines +326 to +327
nft insert rule ip filter DOCKER-USER iifname k8s-net counter accept
nft insert rule ip filter DOCKER-USER oifname k8s-net ct state related,established counter accept
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The example uses incusbr0 so this should be updated to match.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@stgraber Thanks for your reply. I have updated this pr, please reviewed again.

nft add table ip6 filter
nft add table inet incus { flags dormant\; }
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We definitely don't want to put a full nft ruleset dump in our documentation, this will never be kept up to date and will make things more confusing for everyone.

I also would prefer not to have those particular nft commands in there.
They don't just suspend the Docker rules, they suspend everything which would be very dangerous on a production system.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A better option that may be worth mentioning in here is "ip-forward-no-drop": true in Docker configuration which should also make it stop interfering on the system.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. I have reviewed nftables project from the scratch, nftables team have gived up iptables, recommend to use nft. iptables-translate can help user translate iptables command to nft command. In the big scale, nft is faster than iptables.
  2. flags dormant is table level, can not be chain level. However, in the big scale, docker will modify table level's rulesets. "ip-forward-no-drop": true is only focused on forward chain, but not others like nat. Incus also set nat rulesets at its ways by itself. Further, "Prevent connectivity issues with Incus and Docker" have many solutions, so what way user select should be decided by user. after all, those way is user command, not incus command. so You don't need to worry.
  3. many and many fresh people are misdirected to learn iptables, it is very unfair to them.

This removes the full nft dump from the previous commit as well as the
recommendation to mark specific tables as dormant since the tables used
by Docker are the same ones commonly used for local rules, marking them
dormant would in many cases completely disable firewalling in a
non-obvious way and could be quite dangerous.

Keep the manual nft example as that's in line with what's already there
for xtables.

Also expand the list of options to include `ip-forward-no-drop` in the
Docker configuration as we've seen that be sufficient in some cases.

Signed-off-by: Stéphane Graber <[email protected]>
@stgraber stgraber merged commit b23f976 into lxc:main Aug 18, 2025
33 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Documentation needs updating

Development

Successfully merging this pull request may close these issues.

2 participants