4

Netfilter's conntrack docs show an example output of conntrack -L that contains bytes= and packets= counters, but when I run it I only see IP and port information.

I'm aware that the docs are really out of date, and specifically mention ip_conntrack, which has since been replaced with nf_conntrack, but I'm hoping there's some way to enable the counters again.

Is there a way to get that information, or have these counters been removed?

I'm using ubuntu 14.04, with kernel 3.13

3
  • Try iptables -vnL
    – Jenos
    Commented May 8, 2017 at 17:26
  • Will ifconfig give you the trackers you want?
    – cutrightjm
    Commented May 8, 2017 at 17:55
  • 1
    The counters you guys mention are per interface, but I'm interested in counters per connection.
    – itsadok
    Commented May 8, 2017 at 17:58

1 Answer 1

6

Turns out I just needed to enable accounting by doing (as root):

/bin/echo "1" > /proc/sys/net/netfilter/nf_conntrack_acct

After this, byte and packet counts appear in the conntrack output.

1
  • I wonder why they are not enable per default... memory contraints? performance impacts?
    – PlasmaHH
    Commented Jan 30, 2018 at 15:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .