From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Kerin Millar <kfm@plushkava.net>
Cc: Jan Kasprzak <kas@fi.muni.cz>, netfilter@vger.kernel.org
Subject: Re: Logging SNAT'ed connections
Date: Wed, 10 Jun 2026 13:18:00 +0200 [thread overview]
Message-ID: <ailH6MomrFCvxH8Q@chamomile> (raw)
In-Reply-To: <90d53169-3ae6-40a6-a01d-7fae27d24c8f@app.fastmail.com>
On Mon, Jun 08, 2026 at 06:53:30PM +0100, Kerin Millar wrote:
> On Mon, 8 Jun 2026, at 5:38 PM, Jan Kasprzak wrote:
> > Hi all,
> >
> > how do you log SNAT'ed connections for further forensic purposes,
> > when somebody complains about your public IP address and you want to be
> > able to find a local user behind NAT?
> >
> > I used to run something like
> >
> > conntrack --event --buffer-size 1600000 -o id,timestamp --src-nat >> $LOGFILE
> >
> > which did what I want. But now I tried to run the same on AlmaLinux9 host,
> > and it seems that --src-nat filter does not get applied - it shows
> > even connections which are not SNAT'ed at all, because they are for my
> > own IP address:
> >
> > [1780936563.343940] [NEW] icmp 1 30 src=128.1.227.61
> > dst=xx.yy.zz.13 type=8 code=0 id=8724 [UNREPLIED] src=xx.yy.zz.13
> > dst=128.1.227.61 type=0 code=0 id=8724 id=2525400839
> > [1780936563.343994] [UPDATE] icmp 1 30 src=128.1.227.61
> > dst=xx.yy.zz.13 type=8 code=0 id=8724 src=xx.yy.zz.13 dst=128.1.227.61
> > type=0 code=0 id=8724 id=2525400839
> > [1780936565.281121] [NEW] icmp 1 30 src=128.1.227.61
> > dst=xx.yy.zz.11 type=8 code=0 id=8724 [UNREPLIED] src=xx.yy.zz.11
> > dst=128.1.227.61 type=0 code=0 id=8724 id=2574615308
> > [1780936565.281167] [UPDATE] icmp 1 30 src=128.1.227.61
> > dst=xx.yy.zz.11 type=8 code=0 id=8724 src=xx.yy.zz.11 dst=128.1.227.61
> > type=0 code=0 id=8724 id=2574615308
> >
> > Here xx.yy.zz.11 and .13 are my public IP addresses. Why do these connections
> > show up in the conntrack --event --src-nat output? Thanks!
>
> Unfortunately, it appears to be a bug affecting ICMP. Possibly here:
>
> https://git.netfilter.org/libnetfilter_conntrack/tree/src/conntrack/objopt.c?id=7e5397b9167bdd7597be809b8f088ff333e1ad31#n189
Maybe then this helps?
https://patchwork.ozlabs.org/project/netfilter-devel/patch/20260610103039.167819-1-pablo@netfilter.org/
next prev parent reply other threads:[~2026-06-10 11:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 16:38 Logging SNAT'ed connections Jan Kasprzak
2026-06-08 17:53 ` Kerin Millar
2026-06-08 20:11 ` Jan Kasprzak
2026-06-08 20:47 ` Kerin Millar
2026-06-09 6:17 ` Jan Kasprzak
2026-06-10 11:18 ` Pablo Neira Ayuso [this message]
2026-06-10 12:04 ` Kerin Millar
2026-06-10 15:31 ` Pablo Neira Ayuso
2026-06-10 16:16 ` Kerin Millar
2026-06-10 11:28 ` Pablo Neira Ayuso
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=ailH6MomrFCvxH8Q@chamomile \
--to=pablo@netfilter.org \
--cc=kas@fi.muni.cz \
--cc=kfm@plushkava.net \
--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