ControlScripts: fix problem of issuing multiple tc commands on same physical interfac...
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Sat, 31 Jul 2010 11:23:19 +0000 (14:23 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Sat, 31 Jul 2010 11:23:19 +0000 (14:23 +0300)
ControlScripts/bw_limit_ct.sh

index e61633f..939b776 100755 (executable)
@@ -89,8 +89,8 @@ start() {
        # For detailed configuration options, please consult Linux man
        # page.
        $SSH "$TC qdisc add dev $EGRESS_IF root handle 1: htb default 90"
-       $SSH "$TC class add dev $EGRESS_IF parent 1: classid 1:1 htb rate $UPLD ceil $UPLD burst $UP_BURST"
-       $SSH "$TC filter add dev $EGRESS_IF protocol ip parent 1:0 prio 1 u32 match ip src $IP_ADDRESS/32 flowid 1:1"
+       $SSH "$TC class add dev $EGRESS_IF parent 1: classid 1:$CTID htb rate $UPLD ceil $UPLD burst $UP_BURST"
+       $SSH "$TC filter add dev $EGRESS_IF protocol ip parent 1:0 prio 1 u32 match ip src $IP_ADDRESS/32 flowid 1:$CTID"
        
        # The first line creates the root qdisc, and next one creates a
        # child qdisc that are to be used to shape download and upload bandwidth.
@@ -100,8 +100,8 @@ start() {
        
        # Add the ingress limitation - use virtual Ethernet interface
        $SSH "$TC qdisc add dev $INGRESS_IF root handle 1: htb default 90"
-       $SSH "$TC class add dev $INGRESS_IF parent 1: classid 1:1 htb rate $DNLD ceil $DNLD burst $DL_BURST"
-       $SSH "$TC filter add dev $INGRESS_IF protocol ip parent 1:0 prio 1 u32 match ip dst $IP_ADDRESS/32 flowid 1:1"
+       $SSH "$TC class add dev $INGRESS_IF parent 1: classid 1:$CTID htb rate $DNLD ceil $DNLD burst $DL_BURST"
+       $SSH "$TC filter add dev $INGRESS_IF protocol ip parent 1:0 prio 1 u32 match ip dst $IP_ADDRESS/32 flowid 1:$CTID"
        #$SSH "$TC qdisc add dev $INGRESS_IF ingress handle ffff:0"
        # Attach a filter to the ingress qdisc
        #$SSH "$TC filter add dev $INGRESS_IF protocol ip parent ffff:0  prio 1 u32 match ip src 0.0.0.0/0 police rate $DNLD burst $DL_BURST action drop flowid 0:1"