From: "Craig Bernstein" <cbernstein@cbernstein.com>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: netfilter@lists.netfilter.org
Subject: Re: Logging NAT Translations
Date: Tue, 5 Jun 2007 19:10:09 -0700 [thread overview]
Message-ID: <ae1f24730706051910o2538955drfc7ec59cf9aa3927@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0705222208440.4452@yvahk01.tjqt.qr>
On 5/22/07, Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
> iptables -t nat -N yes_do_me_1
> iptables -t nat -A yes_do_me_1 -j LOG ...
> iptables -t nat -A yes_do_me_1 -j SNAT ...
>
> iptables -t nat -s 134.76.0.0/16 -d whatever -p tcp -j yes_do_me_1
>
> Or you could use `conntrack -E`... or conntrack -L for a momentary
> state.
Jan, thank you for your suggestion, but setting it up that way gives
me the same results as before. The log entry looks like this:
IN= OUT=eth0 SRC=10.1.2.3 DST=209.85.139.147 LEN=48 TOS=0x00 PREC=0x00
TTL=125 ID=52743 DF PROTO=TCP SPT=1535 DPT=80 WINDOW=16384 RES=0x00
SYN URGP=0
"SRC" is the inside client address. "DST" is the outside server
address. I still need to log the outside address the client is SNATed
to, i.e. the public Internet address the server will see.
`cat /proc/net/ip_conntrack` will give me the momentary state, but I
want each connection syslogged at set-up and/or tear-down.
Petr recommended the conntrack tool, which may work but will require
upgrading a box that is currently running Debian Sarge. Is that my
only option?
Thanks,
Craig
next prev parent reply other threads:[~2007-06-06 2:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-19 3:15 Logging NAT Translations Craig Bernstein
2007-05-20 19:23 ` Petr Pisar
2007-05-22 20:09 ` Jan Engelhardt
2007-06-06 2:10 ` Craig Bernstein [this message]
2007-06-06 6:01 ` Jan Engelhardt
2007-06-06 7:15 ` Craig Bernstein
2007-06-07 8:09 ` Jan Engelhardt
2007-06-07 22:36 ` Pascal Hambourg
-- strict thread matches above, loose matches on Subject: below --
2008-08-28 14:10 Logging nat translations Carlos Sülz
2008-08-28 17:17 ` Eric Leblond
2008-08-29 10:50 ` 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=ae1f24730706051910o2538955drfc7ec59cf9aa3927@mail.gmail.com \
--to=cbernstein@cbernstein.com \
--cc=jengelh@linux01.gwdg.de \
--cc=netfilter@lists.netfilter.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