From: George Shuklin <george.shuklin@gmail.com>
To: netfilter@vger.kernel.org
Subject: Re: coexistence between nftables and iptables ?
Date: Thu, 6 Nov 2025 14:13:52 +0200 [thread overview]
Message-ID: <203843c7-371e-4e5d-9624-c3e00db722c0@gmail.com> (raw)
In-Reply-To: <6842094.MDQidcC6GM@topolinux>
There is DOCKER-USER chain for those things.
Don't try to use 'iptables for docker, nftables for filtering, it will
cause a lot of bugs and issues.
See ready-made template which allow to add firewall rules into nftables
to filter ports for both local (non-docker) and docker-hosted applications.
https://github.com/lidofinance/ansible-collection-server/blob/master/roles/docker_iptables/templates/iptables.rules.j2
(If you use Ansible, you can grab ready-made collection from Galaxy
https://galaxy.ansible.com/ui/repo/published/lidofinance/server/docs/)
On 11/6/25 11:44 AM, PierluigiFrullani wrote:
> Hello all,
> first post here so please be indulgent.
> I was wandering if I those two "technologies" can coexist.
> My problem is: I have a small machine that does firewalling for my home net, and on this machine there is also a docker environment.
> Docker use iptables for his internal stuff and for forwarding traffic between host ( and his net ) and dockers themselves. It does this by creating a quite complex number of rules and tables, which btw are handled by docker daemon and scripts.
>
> So far so good you might say. Well... no.
> being that also my iptables rules are quite comples I used, when in need of modify them in some way, to flush all iptables and start all over again.
> This will flush also all other docker rules so that the docker environment does not work anymore unless I stop and restart the daemon ( which obviously is not always acceptable ).
>
> If I can use nftables for my firewalling and routing needs, and leave iptables only for docker, then I can flush my nftables whenever I want, without impacting docker environment.
>
> Is that true ?
> Is that possible ?
>
>
> Thanks in advance and sorry for my poor english.
>
> Pierluigi ( from Italy )
>
>
>
next prev parent reply other threads:[~2025-11-06 12:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 9:44 coexistence between nftables and iptables ? PierluigiFrullani
2025-11-06 12:13 ` George Shuklin [this message]
2025-11-06 13:08 ` PierluigiFrullani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=203843c7-371e-4e5d-9624-c3e00db722c0@gmail.com \
--to=george.shuklin@gmail.com \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).