Skip to content

Conversation

@l0rd
Copy link
Member

@l0rd l0rd commented Nov 5, 2025

Removal of the source code and documentation that supported iptables as a firewall driver.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 5, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: l0rd
Once this PR has been reviewed and has the lgtm label, please assign luap99 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

Thanks, overall this looks right but I didn't look super carefully. But note the testing comment, we need to make sure we do not remove important test cases that do not directly relate to iptables.

@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM, though reading this accept dns by default rules I really think our ruleset isn't exactly ideal for nftables usage but this will be for another time.

Comment on lines +412 to +416
run_in_host_netns nft add chain inet netavark INPUT \{ type filter hook input priority 0 \; policy drop \; \}
run_in_host_netns nft add rule inet netavark INPUT ip saddr 10.89.3.0/24 meta l4proto \{ tcp, udp \} th dport $dns_port accept
run_in_host_netns nft add rule inet netavark INPUT ip6 saddr fd10:88:a::/64 meta l4proto \{ tcp, udp \} th dport $dns_port accept
run_in_host_netns nft add rule inet netavark INPUT ct state related,established accept
run_in_host_netns nft add rule inet netavark INPUT meta l4proto ipv6-icmp accept # allow ICMPv6, required for DNS resolution
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure what value this adds practically, you are basically adding the accept rule for dns manually which is not what we want to test but also...

In general there is a big difference between how iptables and nftables work. In iptables all shared the same rule namespace so the default drop there caused us to not be able to get dns packages, so we just add to inject one accept rule before the the final drop happens.
With nftables it is different however because generally each tool uses its own unique table like we do with netavark. So no user should ever touch our INPUT rule and set to to drop as we "own" it.

What is more likely to happen is that a user has another table with an INPUT chain that drops our packages and in the that case it doesn't matter that we accept it in our table. As long as one chain in another table drops the package it gets dropped here so really I don't think us adding these rules even provides much purpose atm.

So now that I thought about all that I guess the answer is our current ruleset doesn't really makes sense and it needs to be rework for 2.0 so I guess we can keep this in for now. It doesn't do any harm either.
cc @mheon

Copy link
Member

Choose a reason for hiding this comment

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

I'm generally going to say that, if it's not doing harm, is it worth changing? It doesn't cost us anything, and we're running out of time before 2.0

Copy link
Member

Choose a reason for hiding this comment

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

well overall I would still love set based nftables ruleset but yeah given the timelines maybe something we can make happen at a later point

@Luap99
Copy link
Member

Luap99 commented Nov 13, 2025

@mheon PTAL

@Luap99
Copy link
Member

Luap99 commented Nov 17, 2025

(needs a rebase)

l0rd added 3 commits November 17, 2025 19:02
Code and documentation changes to remove the support of
iptables as a firewall driver.

Signed-off-by: Mario Loriedo <[email protected]>
l0rd added a commit to l0rd/podman-machine-os that referenced this pull request Nov 19, 2025
Podman 6.0 won't support iptables anymore. It's a
good opportunity to remove iptables from machine-os
too.

This is a follow-up of

containers/netavark#1353
containers/podman#27555

and related to

https://issues.redhat.com/browse/RUN-3723

Signed-off-by: Mario Loriedo <[email protected]>
l0rd added a commit to l0rd/containers-common that referenced this pull request Nov 19, 2025
l0rd added a commit to l0rd/container-libs that referenced this pull request Nov 19, 2025
l0rd added a commit to l0rd/podman-machine-os that referenced this pull request Nov 21, 2025
Podman 6.0 won't support iptables anymore. It's a
good opportunity to remove iptables from machine-os
too.

This is a follow-up of

containers/netavark#1353
containers/podman#27555

and related to

https://issues.redhat.com/browse/RUN-3723

Signed-off-by: Mario Loriedo <[email protected]>
l0rd added a commit to l0rd/podman-machine-os that referenced this pull request Nov 21, 2025
Podman 6.0 won't support iptables anymore. It's a
good opportunity to remove iptables from machine-os
too. iptables kernel modules are kept to avoid
breaking containers that requires them (e.g. docker
in docker).

This is a follow-up of

containers/netavark#1353
containers/podman#27555

and related to

https://issues.redhat.com/browse/RUN-3723

Signed-off-by: Mario Loriedo <[email protected]>
@Luap99
Copy link
Member

Luap99 commented Nov 25, 2025

@mheon @baude PTAL

@mheon
Copy link
Member

mheon commented Nov 25, 2025

LGTM

@Luap99 Luap99 merged commit 553d638 into containers:main Nov 25, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants