Show
Ignore:
Timestamp:
05/30/09 06:29:48 (3 years ago)
Author:
Neutron Soutmun <neo.neutron@…>
Children:
96808c5450804cf9cc6a590500ccce6131c2b937
Parents:
a0fbd8081aad14716555b28cab27c19b76973eea
git-committer:
Neutron Soutmun <neo.neutron@…> (05/30/09 06:29:48)
Message:

Adjust firewall script, handle bittorrent throttle

  • The firewall script now handle bittorrent throttle properly.
  • Adjust the priority of the throttle filter which more important over the users' session filter.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tools/bandwidth.sh.in

    rae7e7e4 r9679928  
    7979      $TC qdisc add dev $SHAPING_DOWN_INF parent 1:${BITTORRENT_ID} \ 
    8080        handle ${BITTORRENT_ID}: sfq perturb 10 
    81       $TC filter add dev $SHAPING_DOWN_INF parent 1: protocol ip prio 5 \ 
     81      $TC filter add dev $SHAPING_DOWN_INF parent 1: protocol ip prio 1 \ 
    8282        handle 0x3 fw classid 1:${BITTORRENT_ID} 
    8383 
     
    8787      $TC qdisc add dev $SHAPING_UP_INF parent 2:${BITTORRENT_ID} \ 
    8888        handle ${BITTORRENT_ID}: sfq perturb 10 
    89       $TC filter add dev $SHAPING_UP_INF parent 2: protocol ip prio 5 \ 
     89      $TC filter add dev $SHAPING_UP_INF parent 2: protocol ip prio 1 \ 
    9090        handle 0x3 fw classid 2:${BITTORRENT_ID} 
    9191      ;; 
     
    143143    classid 1:${ID} htb rate ${DOWNSPEED}bit ceil ${DOWNSPEED}bit 
    144144  $TC filter add dev $SHAPING_DOWN_INF parent 1: \ 
    145     protocol ip prio 1 u32 match ip dst ${IP}/32 flowid 1:${ID} 
     145    protocol ip prio 2 u32 match ip dst ${IP}/32 flowid 1:${ID} 
    146146 
    147147  # Uplink 
     
    149149    classid 2:${ID} htb rate ${UPSPEED}bit ceil ${UPSPEED}bit 
    150150  $TC filter add dev $SHAPING_UP_INF parent 2: \ 
    151     protocol ip prio 1 u32 match ip src ${IP}/32 flowid 2:${ID} 
     151    protocol ip prio 2 u32 match ip src ${IP}/32 flowid 2:${ID} 
    152152} 
    153153 
     
    161161  UP_HANDLE=`$TC filter show dev $SHAPING_UP_INF | grep -w "flowid 2:${ID} " | awk '{print $10}'` 
    162162  $TC filter del dev $SHAPING_DOWN_INF parent 1: \ 
    163     prio 1 handle ${DOWN_HANDLE} u32 
     163    prio 2 handle ${DOWN_HANDLE} u32 
    164164  $TC filter del dev $SHAPING_UP_INF parent 2: \ 
    165     prio 1 handle ${UP_HANDLE} u32 
     165    prio 2 handle ${UP_HANDLE} u32 
    166166 
    167167  # Class Removal