libxt_rateest.man revision b1c768168ef1f79c4bdd02f6e681e6e1fbb8d533
1The rate estimator can match on estimated rates as collected by the RATEEST
2target. It supports matching on absolute bps/pps values, comparing two rate
3estimators and matching on the difference between two rate estimators.
4.TP
5\fB\-\-rateest1\fP \fIname\fP
6Name of the first rate estimator.
7.TP
8\fB\-\-rateest2\fP \fIname\fP
9Name of the second rate estimator (if difference is to be calculated).
10.TP
11\fB\-\-rateest\-delta\fP
12Compare difference(s) to given rate(s)
13.TP
14\fB\-\-rateest\-bps1\fP \fIvalue\fP
15.TP
16\fB\-\-rateest\-bps2\fP \fIvalue\fP
17Compare bytes per second.
18.TP
19\fB\-\-rateest\-pps1\fP \fIvalue\fP
20.TP
21\fB\-\-rateest\-pps2\fP \fIvalue\fP
22Compare packets per second.
23.TP
24[\fB!\fP] \fB\-\-rateest\-lt\fP
25Match if rate is less than given rate/estimator.
26.TP
27[\fB!\fP] \fB\-\-rateest\-gt\fP
28Match if rate is greater than given rate/estimator.
29.TP
30[\fB!\fP] \fB\-\-rateest\-eq\fP
31Match if rate is equal to given rate/estimator.
32.PP
33Example: This is what can be used to route outgoing data connections from an
34FTP server over two lines based on the available bandwidth at the time the data
35connection was started:
36.PP
37# Estimate outgoing rates
38.PP
39iptables \-t mangle \-A POSTROUTING \-o eth0 \-j RATEEST \-\-rateest\-name eth0
40\-\-rateest\-interval 250ms \-\-rateest\-ewma 0.5s
41.PP
42iptables \-t mangle \-A POSTROUTING \-o ppp0 \-j RATEEST \-\-rateest\-name ppp0
43\-\-rateest\-interval 250ms \-\-rateest\-ewma 0.5s
44.PP
45# Mark based on available bandwidth
46.PP
47iptables \-t mangle \-A balance \-m conntrack \-\-ctstate NEW \-m helper \-\-helper ftp
48\-m rateest \-\-rateest\-delta \-\-rateest1 eth0 \-\-rateest\-bps1 2.5mbit \-\-rateest\-gt
49\-\-rateest2 ppp0 \-\-rateest\-bps2 2mbit \-j CONNMARK \-\-set\-mark 1
50.PP
51iptables \-t mangle \-A balance \-m conntrack \-\-ctstate NEW \-m helper \-\-helper ftp
52\-m rateest \-\-rateest\-delta \-\-rateest1 ppp0 \-\-rateest\-bps1 2mbit \-\-rateest\-gt
53\-\-rateest2 eth0 \-\-rateest\-bps2 2.5mbit \-j CONNMARK \-\-set\-mark 2
54.PP
55iptables \-t mangle \-A balance \-j CONNMARK \-\-restore\-mark
56