From: Laimis Date: Tue, 21 Feb 2006 14:03:53 +0000 Subject: [LARTC] Best internet traffic shaping for small lan Message-Id: <20060221140353.7F0F961D0F@wind.delfi.lt> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org I'm admin of 50 clients. Sometimes I upgrading my internet traffic=20 shaping script. I think rules of inetrnet traffic shaping is very important thing! I would like to ask some help from=20 people, who understand something about SQUID ZPH and TC, to aim beter internet traffic shaping scripts. Squid has ZPH suport, becouse its responds to such commands as: zph_tos_local 8 zph_tos_peer 0 zph_tos_parent off Next 2 comands SQUID is not responding ( I think it's becouse of=20 KERNEL..). As I readed about it on ZPH site, I think those 2 comands are not valued for my idea. :) zph_preserve_miss_tos on zph_preserve_miss_tos_mask 255 With help of TC I tried to configurate flow of SQUID packets, but I=20 failed. I want with TC configurate eth0(lan) SQUID packets exept SQUID CACHE packet. I asking Your help!!! How must look=20 like the TC script, wich could control all clients speed to internet? ZPH shapes I want to use with my IPShapig script. 1IP could get limit=20 KB/S + SQUID CACHE. My IPShaping script controls every IP adress kbit/sec exept traffic to server: #!/bin/bash TC=3D/sbin/tc HOSTS_LIST=3D"192.168.1.3 192.168.1.4 192.168.1.5 192.168.1.6 192.168.1. 7 192.168.1.8 192.168.1.9 192.168.1.10 192.168.1.11... DEV=3Deth0 # ethLAN IMQ=3Dimq0 # --todev 0 NM=17 DN_BANDWIDTHv0Kbit # DN=105Kbit DN_RATEpKbit UP_BANDWIDTH`0Kbit # UPpKbit UP_RATEPKbit $TC qdisc add dev $DEV root handle 1: htb #default 50 $TC class add dev $DEV parent 1: classid 1:1 htb rate=20 ${DN_BANDWIDTH} quantum 1500 iptables -t mangle -N DN_SHAPING ip link set $IMQ up $TC qdisc add dev $IMQ root handle 1: htb $TC class add dev $IMQ parent 1: classid 1:1 htb rate=20 ${UP_BANDWIDTH} quantum 1500 iptables -t mangle -N UP_SHAPING for i in $HOSTS_LIST do IP=3D$(echo $i | awk -F '.' '{print $4}') # Download MARK tc class add dev $DEV parent 1:1 classid 1:$NM$IP htb=20 rate ${DN_RATE} ceil ${DN} prio 0 quantum 1500 tc qdisc add dev $DEV parent 1:$NM$IP handle $NM$IP:=20 sfq perturb 6 tc filter add dev $DEV parent 1:0 prio 0 protocol ip=20 handle $NM$IP fw flowid 1:$NM$IP tc class add dev $IMQ parent 1:1 classid 1:$NM$IP htb=20 rate ${UP_RATE} ceil ${UP} prio 0 quantum 1500 tc qdisc add dev $IMQ parent 1:$NM$IP handle $NM$IP:=20 sfq perturb 6 tc filter add dev $IMQ parent 1:0 prio 0 protocol ip=20 handle $NM$IP fw flowid 1:$NM$IP iptables -t mangle -A DN_SHAPING -s ! 192.168.1.2 -d=20 $i -j MARK --set-mark $NM$IP iptables -t mangle -A UP_SHAPING -s $i -d ! 192.168.1. 2 -j MARK --set-mark $NM$IP done iptables -t mangle -I POSTROUTING -o $DEV -j DN_SHAPING iptables -t mangle -I PREROUTING -i $DEV -j UP_SHAPING iptables -t mangle -A UP_SHAPING -j IMQ --todev 0 <--------------------=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= --------------------> DELFI mail pa=F0to sistema http://www.mail.lt _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc