From: Pablo Neira Ayuso <pablo@netfilter.org>
To: "G.W. Haywood" <netfilter@jubileegroup.co.uk>
Cc: netfilter@vger.kernel.org
Subject: Re: Documentation.
Date: Sun, 7 Jun 2020 23:23:47 +0200 [thread overview]
Message-ID: <20200607212347.GA24054@salvia> (raw)
In-Reply-To: <alpine.DEB.2.21.2006061631470.11442@piplus.local.jubileegroup.co.uk>
Hi,
On Sat, Jun 06, 2020 at 06:09:22PM +0100, G.W. Haywood wrote:
[...]
> Ideally I'd like to know which process ID is using which connection.
> Because there may be simultaneous connections, if I don't know which
> one is which, then I have to wait for all of them to go away before
> cleaning up, and this can sometimes take hours. When a connection is
> first created I could mark it from user space. Then I can look for
> the mark when it's time to clean up, but I'd prefer not to have to do
> that if there's a way of identifying it which does not involve this
> separate marking operation. Is there such a way?
>
> Secondly, I wanted to get conntrackd to log via syslog using facility
> 'mail'. It won't do it. It will log using 'local0' etc., but claims
> that facility 'mail' is not a known syslog facility (even though I am
> using it extensively in my milters). This is my configuration, it is
> only very slightly edited from the Debian original:
>
> 8<----------------------------------------------------------------------
> mail6:/etc/conntrackd# >>> cat conntrackd.conf
> General {
> HashSize 8192
> HashLimit 65535
>
> Syslog mail
>
> LockFile /var/lock/conntrackd.lock
>
> UNIX {
> Path /var/run/conntrackd.sock
> # Backlog 20
> }
>
> SocketBufferSize 262142
> SocketBufferSizeMaxGrown 655355
>
> # default debian service unit file is of Type=notify
> Systemd on
> }
>
> Stats {
> LogFile on
> Syslog mail
> }
> 8<----------------------------------------------------------------------
> mail6:/etc/conntrackd# >>> service conntrackd restart
> [....] Stopping conntrackd[Sat Jun 6 17:22:07 2020] (pid=6268) [warning] 'mail' is not a known syslog facility, ignoring
> [Sat Jun 6 17:22:07 2020] (pid=6268) [warning] 'mail' is not a known syslog facility, ignoring.
> . ok [....] Starting conntrackd[Sat Jun 6 17:22:09 2020] (pid=6292)
> [warning] 'mail' is not a known syslog facility, ignoring
> [Sat Jun 6 17:22:09 2020] (pid=6292) [warning] 'mail' is not a known syslog facility, ignoring.
> . ok
> 8<----------------------------------------------------------------------
>
> The man page is not clear on what facilities I can use; if I change
> facility 'mail' (for example) to 'local1' the warnings go away, but of
> course I don't want to do that. It isn't a show-stopper, I can do it
> some other way, but it's a nuisance.
Probably you may use ulogd2 instead for this use-case? Use the NFLOG
input driver which includes the process UID and GID. You could match
on the first packet new packet based on the conntrack information.
conntrackd only supports a limited number of syslog facilities (only
daemon, local0 to local7), although it should be relatively easy to
extend it to support for other facilities.
> Thirdly, it seems that
>
> http://conntrack-tools.netfilter.org/
>
> and
>
> http://conntrack-tools.netfilter.org/manual.html
>
> haven't been updated since 2012. Am I expected to be reading these,
> or is there something else more recent which replaces it? The latest
> release of conntrack-tools mentioned on the site is 1.4.0, although my
> version of conntrack is 1.4.5 (- and it's a Debian package! -) and the
> man page does refer me to the conntrack-tools.netfilter.org Website.
The manual mostly focuses on conntrackd for state synchronization (high
availability) and the userspace conntrack helper mode.
> Examples in chapter 5, "Using conntrack: the command line interface":
>
> [QUOTE]
> # conntrack -U -p tcp --dport 3486 --mark 10
> tcp 6 431982 ESTABLISHED src=192.168.2.100 dst=123.59.27.117\
> sport=34846 dport=993 packets=169 bytes=14322 src=123.59.27.117\
> dst=192.168.2.100 sport=993 dport=34846 packets=113 bytes=34787\
> [ASSURED] mark=1 secmark=0 use=1
> conntrack v0.9.7 (conntrack-tools): 1 flow entries has been updated.
> [/QUOTE]
>
> (1) The mark in the command line is '10', not '1'.
> (2) The dport in the example is '993', not '3486' and not '34846'.
Fixed upstream, thanks.
> Point (2) applies to other examples in the same section. All give me
> the impression of having been hand-crafted, rather than cut-n-pasted,
> for example because on updates and deletes the tool does not print the
> text "has been deleted"; it prints "have been deleted".
>
> If the documents I'm reading are obsolete, I would suggest that they
> should be taken down, and that the man pages for conntrack, conntrackd
> and conntrackd.conf should be updated. I'd be very happy to produce a
> few patches if I can get the right information.
I made a quick revamp:
http://git.netfilter.org/conntrack-tools/log/
There is information which is not included in the manpage,
specifically for the state synchronization (HA) and the userspace
connection tracking helpers.
The statistics mode, which is the one you're interested in, is not
documented there though.
Thanks.
next prev parent reply other threads:[~2020-06-07 21:23 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-06 17:09 Documentation G.W. Haywood
2020-06-07 21:23 ` Pablo Neira Ayuso [this message]
2020-06-10 12:55 ` Documentation G.W. Haywood
-- strict thread matches above, loose matches on Subject: below --
2017-03-27 5:53 documentation Julia Lawall
2011-04-13 23:33 Documentation Eugene Shatsky
2011-04-14 4:44 ` Documentation Jonáš Vidra
2011-04-14 13:54 ` Documentation Edward Shishkin
2011-01-31 21:39 documentation Roberto Spadim
2011-01-31 21:43 ` documentation Mathias Burén
2011-01-31 21:58 ` documentation NeilBrown
2011-01-31 22:14 ` documentation Roberto Spadim
2011-02-01 9:37 ` documentation hansbkk
2011-02-01 13:49 ` documentation Roberto Spadim
2010-12-01 18:00 Documentation David Lambert
2010-12-01 18:06 ` Documentation Stefan Schmidt
2010-12-01 18:39 ` Documentation David Lambert
2010-12-01 18:54 ` Documentation Stefan Schmidt
2010-12-01 22:46 ` Documentation Robert Foerster
2010-12-02 20:37 ` Documentation David Lambert
2010-12-02 20:52 ` Documentation Robert Foerster
2010-12-03 7:35 ` Documentation Christophe Aeschlimann
2010-03-14 0:17 Documentation Giuseppe Macrì
2006-02-10 8:20 Documentation Nico -telmich- Schottelius
2005-10-24 19:05 Documentation Vagin Andrey S.
2004-06-24 17:10 Documentation Tomas Ebenlendr
2004-06-24 22:03 ` Documentation Yoshinori K. Okuji
2004-06-25 13:17 ` Documentation Jeroen Dekkers
2004-06-26 15:05 ` Documentation Yoshinori K. Okuji
2004-05-27 13:12 Documentation Alexander E. Patrakov
2004-05-28 23:25 ` Documentation Greg KH
2004-06-02 6:11 ` Documentation Niko Sauer
2004-05-15 14:28 Documentation Jody
2004-05-17 13:35 ` Documentation Andrey Romanenko
2004-05-17 13:40 ` Documentation Miguel Bolanos
2003-06-06 13:20 Documentation Matthew Wilcox
2002-08-29 9:39 documentation vandana mehtani
2002-08-29 15:46 ` documentation Dave Wilhardt
2002-04-24 14:26 documentation Guilhem Tardy
2002-04-24 16:58 ` documentation Takashi Iwai
2002-04-24 19:32 ` documentation Guilhem Tardy
2002-04-26 17:54 ` documentation Takashi Iwai
2002-05-03 16:11 ` documentation Guilhem Tardy
2002-05-03 16:22 ` documentation Paul Davis
2002-05-03 16:28 ` documentation Takashi Iwai
2002-03-22 15:32 Documentation Gopakumar.C.E
2002-03-30 7:42 ` Documentation Ralf Baechle
2002-02-02 9:18 Documentation Guillaume Chamberland-Larose
2002-02-02 10:39 ` Documentation Yven J. Leist
2002-02-05 18:18 ` Documentation Randy.Dunlap
2001-11-15 18:03 Documentation war
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=20200607212347.GA24054@salvia \
--to=pablo@netfilter.org \
--cc=netfilter@jubileegroup.co.uk \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.