Blame extensions/libxt_connbytes.man

Packit 7b22a4
Match by how many bytes or packets a connection (or one of the two
Packit 7b22a4
flows constituting the connection) has transferred so far, or by
Packit 7b22a4
average bytes per packet.
Packit 7b22a4
.PP
Packit 7b22a4
The counters are 64-bit and are thus not expected to overflow ;)
Packit 7b22a4
.PP
Packit 7b22a4
The primary use is to detect long-lived downloads and mark them to be
Packit 7b22a4
scheduled using a lower priority band in traffic control.
Packit 7b22a4
.PP
Packit 7b22a4
The transferred bytes per connection can also be viewed through
Packit 7b22a4
`conntrack \-L` and accessed via ctnetlink.
Packit 7b22a4
.PP
Packit 7b22a4
NOTE that for connections which have no accounting information, the match will
Packit 7b22a4
always return false. The "net.netfilter.nf_conntrack_acct" sysctl flag controls
Packit 7b22a4
whether \fBnew\fP connections will be byte/packet counted. Existing connection
Packit 7b22a4
flows will not be gaining/losing a/the accounting structure when be sysctl flag
Packit 7b22a4
is flipped.
Packit 7b22a4
.TP
Packit 7b22a4
[\fB!\fP] \fB\-\-connbytes\fP \fIfrom\fP[\fB:\fP\fIto\fP]
Packit 7b22a4
match packets from a connection whose packets/bytes/average packet
Packit 7b22a4
size is more than FROM and less than TO bytes/packets. if TO is
Packit 7b22a4
omitted only FROM check is done. "!" is used to match packets not
Packit 7b22a4
falling in the range.
Packit 7b22a4
.TP
Packit 7b22a4
\fB\-\-connbytes\-dir\fP {\fBoriginal\fP|\fBreply\fP|\fBboth\fP}
Packit 7b22a4
which packets to consider
Packit 7b22a4
.TP
Packit 7b22a4
\fB\-\-connbytes\-mode\fP {\fBpackets\fP|\fBbytes\fP|\fBavgpkt\fP}
Packit 7b22a4
whether to check the amount of packets, number of bytes transferred or
Packit 7b22a4
the average size (in bytes) of all packets received so far. Note that
Packit 7b22a4
when "both" is used together with "avgpkt", and data is going (mainly)
Packit 7b22a4
only in one direction (for example HTTP), the average packet size will
Packit 7b22a4
be about half of the actual data packets.
Packit 7b22a4
.TP
Packit 7b22a4
Example:
Packit 7b22a4
iptables .. \-m connbytes \-\-connbytes 10000:100000 \-\-connbytes\-dir both \-\-connbytes\-mode bytes ...