Penguin
Diff: TrafficShaping
EditPageHistoryDiffInfoLikePages

Differences between version 12 and predecessor to the previous major change of TrafficShaping.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 12 Last edited on Friday, October 29, 2004 2:37:22 pm by PatrickGrant Revert
Older page: version 11 Last edited on Monday, September 22, 2003 11:27:17 pm by AristotlePagaltzis Revert
@@ -77,10 +77,40 @@
  
 !!Tag data in the right direction 
 I use "dst $IP" for 'traffic destined to $IP', if you want traffic *from* an IP use 'src $IP' instead. 
  
+----  
  
+I made some adjustments to the above script to split up the ADSL upload in my flat network. This was to ensure that no one person can whore the upload, thus making everything laggy. (I found the wondershaper disappointing)  
  
+Notes:  
+This will not work with masquerading  
+  
+#!/bin/sh  
+# List of IPs to have upload throttled  
+IPS=`seq 114 117 | awk '{print "1.2.3."$1}'`  
+  
+LINERATE=2mbit  
+THROTTLERATE=14kbps  
+  
+tc qdisc del dev ppp0 root 2>/dev/null  
+  
+tc qdisc add dev ppp0 root handle 1: cbq avpkt 1000 bandwidth $LINERATE  
+  
+for IP in $IPS;  
+do  
+ echo throttling $IP  
+  
+ LASTTHING=`echo $IP | cut -d . -f 4`  
+  
+ tc class add dev ppp0 parent 1: classid 1:$LASTTHING cbq rate \  
+ $THROTTLERATE allot 1500 prio 5 bounded isolated  
+  
+ tc filter add dev ppp0 parent 1: protocol ip prio 16 u32 \  
+ match ip src $IP flowid 1:$LASTTHING  
+  
+ tc qdisc add dev ppp0 parent 1:$LASTTHING sfq perturb 10  
+done;  
  
 ---- 
 After a bit of fiddling I've managed to get TrafficShaping working on a per protocol (read port) basis