3 # sample script on using the ingress capabilities
4 # This script just tags on the ingress interfac using Ipchains
5 # the result is used for fast classification and re-marking
6 # on the egress interface
8 #path to various utilities;
9 #change to reflect yours.
11 IPROUTE=/root/DS-6-beta/iproute2-990530-dsing
14 IPCHAINS=/root/DS-6-beta/ipchains-1.3.9/ipchains
18 # tag all incoming packets from host 10.2.0.24 to value 1
19 # tag all incoming packets from host 10.2.0.3 to value 2
20 # tag the rest of incoming packets from subnet 10.2.0.0/24 to value 3
21 #These values are used in the egress
23 ############################################################
24 $IPCHAINS -A input -s 10.2.0.4/24 -m 3
25 $IPCHAINS -A input -i $INDEV -s 10.2.0.24 -m 1
26 $IPCHAINS -A input -i $INDEV -s 10.2.0.3 -m 2
28 ######################## Egress side ########################
33 $TC qdisc add $EGDEV handle 1:0 root dsmark indices 64 set_tc_index
35 # values of the DSCP to change depending on the class
38 $TC class change $EGDEV classid 1:1 dsmark mask 0x3 \
41 $TC class change $EGDEV classid 1:2 dsmark mask 0x3 \
44 $TC class change $EGDEV classid 1:3 dsmark mask 0x3 \
50 $TC filter add $EGDEV parent 1:0 protocol ip prio 4 handle 1 fw classid 1:1
51 $TC filter add $EGDEV parent 1:0 protocol ip prio 4 handle 2 fw classid 1:2
52 $TC filter add $EGDEV parent 1:0 protocol ip prio 4 handle 3 fw classid 1:3
56 echo "---- qdisc parameters Ingress ----------"
57 $TC qdisc ls dev $INDEV
58 echo "---- Class parameters Ingress ----------"
59 $TC class ls dev $INDEV
60 echo "---- filter parameters Ingress ----------"
61 $TC filter ls dev $INDEV parent 1:0
63 echo "---- qdisc parameters Egress ----------"
65 echo "---- Class parameters Egress ----------"
67 echo "---- filter parameters Egress ----------"
68 $TC filter ls $EGDEV parent 1:0