#!/bin/sh
#Simplebandwidthlimiter-
#Changethistoyourlinkbandwidth
#(forcablemodem,DSLlinks,etc.putthemaximalbandwidthyoucan
#get,notthespeedofalocalEthernetlink)
REAL_BW='10Mbit'
#ChangethistothebandwidthyouwanttoallocatetoWEB.
#We'retalkingaboutmegabits,notmegabytes,so80Kbitis
#10Kilobytes/s
WEB_BW='1000Kbit'
#Changethistoyourphysicalnetworkdevice(or'ppp0')
NIC='eth0'
tcqdiscdeldev"$NIC"root2>/dev/null
tcqdiscadddev"$NIC"roothandle1:cbq\
bandwidth"$REAL_BW"avpkt1000
tcclassadddev"$NIC"parent1:classid1:1cbqbandwidth"$REAL_BW"\
rate"$REAL_BW"maxburst1avpkt1000
tcclassadddev"$NIC"parent1:1classid1:10cbq\
bandwidth"$REAL_BW"rate"$WEB_BW"maxburst1avpkt1000bounded
tcqdiscadddev"$NIC"parent1:10sfqperturb10
tcfilteradddev"$NIC"parent1:protocoliphandle1fwclassid1:10
iptables-tmangle-AOUTPUT-ptcp——sport80-jMARK——set-mark1