Quality of service
U
SER
G
UIDE
279
filter parent 1: protocol ip pref 1 fw
filter parent 1: protocol ip pref 1 fw handle 0x64 classid RT
filter parent 1: protocol ip pref 2 fw
filter parent 1: protocol ip pref 2 fw handle 0x12c classid DATA2
filter parent 1: protocol ip pref 2 fw handle 0xc8 classid DATA1
In order to display the filters and the relative statics:
iptables
–
t mangle
–
L -v
root@Imola>
iptables –t mangle –L -v
Chain PREROUTING (policy ACCEPT 1190 packets, 103K bytes)
pkts bytes target prot opt in
out source
destination
0
0
MARK
all -- any any anywhere anywhere
DSCP match 0x05 MARK set 0x64
0
0
ACCEPT all -- any any anywhere anywhere
DSCP match 0x05
0
0
MARK all -- any any anywhere 13.13.13.0/24 MARK set 0xc8
0 0
ACCEPT all -- any any anywhere 13.13.13.0/24
0
0
DSCP
all -- any any anywhere anywhere
MARK match 0xc8 DSCP set 0x10
0
0
ACCEPT all -- any any anywhere anywhere
MARK match 0xc8
386 32154 MARK
all -- any any anywhere anywhere
MARK set 0x12c
386 32154 ACCEPT all -- any any anywhere anywhere
0 0 DSCP all -- any
any anywhere anywhere
MARK match 0x12c DSCP set 0x00
0 0 ACCEPT all -- any
any anywhere anywhere
MARK match 0x12c
Chain INPUT (policy ACCEPT 4792 packets, 407K bytes)
pkts bytes target prot opt in
out source
destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in
out source
destination
Chain OUTPUT (policy ACCEPT 1966 packets, 166K bytes)
pkts bytes target prot opt in
out source
destination
Chain POSTROUTING (policy ACCEPT 1966 packets, 166K bytes)
pkts bytes target prot opt in
out source
destination
Examples:
In the following example a RT class is defined, with its policy:
set qos-ext class RT
set qos-ext class RT policy ...
To the
RT class
is guarantee at least the 50% of the available bandwith:
set qos-ext class RT bandwidth percent 50
In the
RT class
flow packets whose source address belongs to the network 172.151.1.0:
set qos-ext class RT filter match src-ip 172.151.1.0/24
The packets that flow through the class are highlighted with a IP precedence value equal to 4:
set qos-ext class RT filter set ipp 4
If the packets are routed in a GRE tunnel, it is necessary that the marking is made before routing
traffic. It must then be defined a filter group: