No edit summary |
(Add a known issue when docker and podman are used on the same machine, https://github.com/containers/podman/issues/24486) |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
= Netavark Nftables Default <!-- The name of your change proposal --> = | = Netavark Nftables Default <!-- The name of your change proposal --> = | ||
== Summary == | == Summary == | ||
Line 16: | Line 7: | ||
Netavark should use nftables by default to create/manage the firewall rules for the Podman containers. | Netavark should use nftables by default to create/manage the firewall rules for the Podman containers. | ||
== Owner == | |||
* Name: [[User:luap99 | Paul Holzinger]] (luap99) | |||
* Email: <pholzing@redhat.com> | |||
* Name: [[User:mheon | Matthew Heon]] (mheon) | |||
* Name: [[User: | |||
* Email: <pholzing | |||
* Name: Matthew Heon | |||
* Email: <mheon@redhat.com> | * Email: <mheon@redhat.com> | ||
== Current status == | == Current status == | ||
[[Category: | [[Category:ChangeAcceptedF41]] | ||
<!-- When your change proposal page is completed and ready for review and announcement --> | <!-- When your change proposal page is completed and ready for review and announcement --> | ||
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler --> | <!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler --> | ||
Line 39: | Line 21: | ||
<!-- After review, the Wrangler will move your page to Category:ChangeReadyForFesco... if it still needs more work it will move back to Category:ChangePageIncomplete--> | <!-- After review, the Wrangler will move your page to Category:ChangeReadyForFesco... if it still needs more work it will move back to Category:ChangePageIncomplete--> | ||
[[Category:SelfContainedChange]] | [[Category:SelfContainedChange]] | ||
* Targeted release: [https://docs.fedoraproject.org/en-US/releases/f41/ Fedora Linux 41] | * Targeted release: [https://docs.fedoraproject.org/en-US/releases/f41/ Fedora Linux 41] | ||
Line 51: | Line 31: | ||
ON_QA -> change is fully code complete | ON_QA -> change is fully code complete | ||
--> | --> | ||
* [Announced] | * [https://lists.fedoraproject.org/archives/list/devel-announce@lists.fedoraproject.org/thread/A7ZVLT2JMLQT5YVTCFGHQVYQ5WIBFQML/ Announced] | ||
* [ | * [https://discussion.fedoraproject.org/t/f41-change-proposal-netavark-nftables-default-self-contained/125528 Discussion thread] | ||
* FESCo issue: | * FESCo issue: [https://pagure.io/fesco/issue/3253 #3253] | ||
* Tracker bug: | * Tracker bug: [https://bugzilla.redhat.com/show_bug.cgi?id=2304176 #2304176] | ||
* Release notes tracker: | * Release notes tracker: [https://gitlab.com/fedora/docs/fedora-linux-documentation/release-notes/-/issues/121 #121] | ||
== Detailed Description == | == Detailed Description == | ||
Netavark is used by Podman to configure networking for the containers. It manages interfaces and firewall rules. Currently it uses iptables by default to create the firewall rules for the containers but it can also be configured to use nftables (nft). The goal is to switch the default over to nftables. We also expect a small speed up for the container start-up times as nftables allows us to batch insert rules at once which makes it more performant and robust compared to iptables. | Netavark is used by Podman to configure networking for the containers. It manages interfaces and firewall rules. Currently it uses iptables by default to create the firewall rules for the containers but it can also be configured to use nftables (nft). The goal is to switch the default over to nftables. We also expect a small speed up for the container start-up times as nftables allows us to batch insert rules at once which makes it more performant and robust compared to iptables. | ||
Line 66: | Line 45: | ||
== Benefit to Fedora == | == Benefit to Fedora == | ||
* netavark no longer requires iptables | * netavark no longer requires iptables | ||
Line 100: | Line 52: | ||
== Scope == | == Scope == | ||
* Proposal owners: Paul Holzinger, Matthew Heon | * Proposal owners: Paul Holzinger, Matthew Heon | ||
** Using nftables is already supported in netavark as of version v1.10 (already included in fedora). Set a build option in the specfile to change the default driver from iptables to nftables | ** Using nftables is already supported in netavark as of version v1.10 (already included in fedora). Set a build option in the specfile to change the default driver from iptables to nftables | ||
* Other developers: | * Other developers: N/A | ||
* Release engineering: | * Release engineering: N/A | ||
* Policies and guidelines: N/A (not needed for this Change) | * Policies and guidelines: N/A (not needed for this Change) | ||
* Trademark approval: N/A (not needed for this Change) | * Trademark approval: N/A (not needed for this Change) | ||
* Alignment with the Fedora Strategy: | * Alignment with the Fedora Strategy: | ||
== Upgrade/compatibility impact == | == Upgrade/compatibility impact == | ||
Line 124: | Line 70: | ||
<!-- REQUIRED FOR SYSTEM WIDE CHANGES --> | <!-- REQUIRED FOR SYSTEM WIDE CHANGES --> | ||
Existing containers will automatically use the new firewall driver on the next start/stop, they will not have to be recreated. | |||
One problem that can happen is if there are running containers before the update and then it switches to use the new nftables driver it will leak the old iptables rules and not clear them up. | |||
So in this case a manually cleanup might be needed (reboot clears it as well). Given that the dnf system-upgrade requires a reboot anyway it is not something users need to worry about (except maybe on rawhide). | |||
== Early Testing (Optional) == | == Early Testing (Optional) == | ||
Do you require 'QA Blueprint' support? | Do you require 'QA Blueprint' support? N | ||
== How To Test == | == How To Test == | ||
The change can be tested by setting the firewall driver to nftables in containers.conf: | The change can be tested by setting the firewall driver to nftables in containers.conf: | ||
Line 156: | Line 93: | ||
$ sudo nft list table inet netavark | $ sudo nft list table inet netavark | ||
== Known Issue with docker == | |||
When using both rootful podman and docker together the podman containers will not have external network connectivity. This is because docker adds a iptables rule to block all forwarding. | |||
https://docs.docker.com/network/packet-filtering-firewalls/#docker-on-a-router | |||
Users either need to add a iptables rule to allow the podman traffic or revert to iptables driver via the containers.conf file option shown under "How To Test" above. | |||
== User Experience == | == User Experience == | ||
There should no change in behavior for end users unless they manually messed with the netavark firewall rules. | There should no change in behavior for end users unless they manually messed with the netavark firewall rules. | ||
== Dependencies == | == Dependencies == | ||
N/A | N/A | ||
== Contingency Plan == | == Contingency Plan == | ||
* Contingency mechanism: Keep using iptables as default. | * Contingency mechanism: Keep using iptables as default. | ||
* Contingency deadline: beta freeze | * Contingency deadline: beta freeze | ||
* Blocks release? N/A | * Blocks release? N/A | ||
== Documentation == | == Documentation == | ||
N/A (not a System Wide Change) | N/A (not a System Wide Change) | ||
Latest revision as of 18:09, 8 November 2024
Netavark Nftables Default
Summary
Netavark should use nftables by default to create/manage the firewall rules for the Podman containers.
Owner
- Name: Paul Holzinger (luap99)
- Email: <pholzing@redhat.com>
- Name: Matthew Heon (mheon)
- Email: <mheon@redhat.com>
Current status
- Targeted release: Fedora Linux 41
- Last updated: 2024-11-08
- Announced
- Discussion thread
- FESCo issue: #3253
- Tracker bug: #2304176
- Release notes tracker: #121
Detailed Description
Netavark is used by Podman to configure networking for the containers. It manages interfaces and firewall rules. Currently it uses iptables by default to create the firewall rules for the containers but it can also be configured to use nftables (nft). The goal is to switch the default over to nftables. We also expect a small speed up for the container start-up times as nftables allows us to batch insert rules at once which makes it more performant and robust compared to iptables.
Feedback
Benefit to Fedora
- netavark no longer requires iptables
- all rules are now part of the netavark table so there are less conflicts with other tools/users who manage firewall rules
- slightly faster container start-up time
Scope
- Proposal owners: Paul Holzinger, Matthew Heon
- Using nftables is already supported in netavark as of version v1.10 (already included in fedora). Set a build option in the specfile to change the default driver from iptables to nftables
- Other developers: N/A
- Release engineering: N/A
- Policies and guidelines: N/A (not needed for this Change)
- Trademark approval: N/A (not needed for this Change)
- Alignment with the Fedora Strategy:
Upgrade/compatibility impact
Existing containers will automatically use the new firewall driver on the next start/stop, they will not have to be recreated.
One problem that can happen is if there are running containers before the update and then it switches to use the new nftables driver it will leak the old iptables rules and not clear them up. So in this case a manually cleanup might be needed (reboot clears it as well). Given that the dnf system-upgrade requires a reboot anyway it is not something users need to worry about (except maybe on rawhide).
Early Testing (Optional)
Do you require 'QA Blueprint' support? N
How To Test
The change can be tested by setting the firewall driver to nftables in containers.conf:
$ sudo mkdir -p /etc/containers/containers.conf.d $ echo $'[network]\nfirewall_driver="nftables"' | sudo tee /etc/containers/containers.conf.d/50-netavark-nftables.conf
Changing the firewall driver while you have running containers will likely cause some conflicting rules so it is best to reboot when this option is changed.
Now start the containers and make sure the network works as usual. The rules can be checked with
$ sudo nft list table inet netavark
Known Issue with docker
When using both rootful podman and docker together the podman containers will not have external network connectivity. This is because docker adds a iptables rule to block all forwarding. https://docs.docker.com/network/packet-filtering-firewalls/#docker-on-a-router
Users either need to add a iptables rule to allow the podman traffic or revert to iptables driver via the containers.conf file option shown under "How To Test" above.
User Experience
There should no change in behavior for end users unless they manually messed with the netavark firewall rules.
Dependencies
N/A
Contingency Plan
- Contingency mechanism: Keep using iptables as default.
- Contingency deadline: beta freeze
- Blocks release? N/A
Documentation
N/A (not a System Wide Change)