From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Phill" Date: Thu, 18 Sep 2003 06:47:15 +0000 Subject: [LARTC] HTB - shaping services and IP MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0026_01C37DC1.75DEED50" Message-Id: List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_0026_01C37DC1.75DEED50 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Hello all, I am trying to solve this problem for more than a month and can not = still find a way how to do it.=20 If you could please help me and many other people interested in the same = problem. Lets say, I got this configuration _____________________________________________ 160kbps/96kbps = _____ |imq0(eth1, eth2) Linux router with = NAT>ppp0|------------------------|ISP| --------------------------------------------- = ----- +|Roman| - 192.168.1.10 on eth1 +|Phill| - 192.168.2.10 on eth2 + ... The point is, that I want to shape the speed of each client=20 and I want to shape the speed of the services the client uses. I don't use iptables to mark the packets, because the use of IMQ,=20 but I know that there is a patch for this. So for ex. I want to do if the user is downloading something from FTP,=20 that he would be able to use the other services like websurfing=20 or playing games at the same speed as if he didn't download. Roman - Rate 80 Ceil 160 +FTP Rate 1 Ceil 160 +Other Traffic Rate 79 Ceil 160 Then I got Phill with the same settings,=20 but that if Roman is downloading something from FTP it will slow down=20 while Phill is surfing the web.=20 There will be some clients, whoose services I dont want to shape,=20 that's why I want to do it this way. Please help me any way, I tried almost everything to get this working Thank you very much, Phill ---This is my latest idea--- LOCAL=3D"imq0" NET=3D"ppp0"=20 IPT=3D/sbin/iptables=20 modprobe imq numdevs=3D1 ip link set imq0 up=20 $IPT -t mangle -A PREROUTING -i ppp0 -j IMQ=20 tc qdisc add dev $LOCAL root handle 1: htb default 999 tc class add dev $LOCAL parent 1:0 classid 1:1 htb rate 160kbit ceil = 160kbit #Roman tc class add dev $LOCAL parent 1:1 classid 1:110 htb rate 80kbit = ceil 160kbit tc class add dev $LOCAL parent 1:110 classid 1:1101 htb rate = rate 79kbit ceil 160kbit tc class add dev $LOCAL parent 1:110 classid 1:1102 htb rate = 1kbit ceil 160kbit tc filter add dev $LOCAL parent 1:0 protocol ip u32 match ip dst = 192.168.1.10 flowid 1:110 tc filter add dev $LOCAL parent 1:110 protocol ip u32 match ip = dst 192.168.1.10 flowid 1:1101 tc filter add dev $LOCAL parent 1:110 protocol ip u32 match ip = dport 20 0xffff flowid 1:1102=20 tc filter add dev $LOCAL parent 1:110 protocol ip u32 match ip = dport 21 0xffff flowid 1:1102=20 #Phill tc class add dev $LOCAL parent 1:1 classid 1:210 htb rate 80kbit = ceil 160kbit=20 tc class add dev $LOCAL parent 1:210 classid 1:2101 htb rate = rate 79kbit ceil 160kbit tc class add dev $LOCAL parent 1:210 classid 1:2102 htb rate = 1kbit ceil 160kbit tc filter add dev $LOCAL parent 1:0 protocol ip u32 match ip dst = 192.168.1.10 flowid 1:210 tc filter add dev $LOCAL parent 1:210 protocol ip u32 match ip = dst 192.168.1.10 flowid 1:2101 tc filter add dev $LOCAL parent 1:210 protocol ip u32 match ip = dport 20 0xffff flowid 1:2102=20 tc filter add dev $LOCAL parent 1:210 protocol ip u32 match ip = dport 21 0xffff flowid 1:2102 =20 ------=_NextPart_000_0026_01C37DC1.75DEED50 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable
Hello all,
    I am = trying to=20 solve this problem for more than a month and can not still find a way = how to do=20 it.
If you could please help me and many other people interested in = the same=20 problem.

Lets say, I got this=20 configuration
_____________________________________________  = ;   =20 160kbps/96kbps    _____
|imq0(eth1, eth2) Linux router with=20 NAT>ppp0|------------------------|ISP|
----------------------------= -----------------=20             &= nbsp;         =20 -----
    +|Roman| - = 192.168.1.10 on=20 eth1
    +|Phill| - 192.168.2.10 on = eth2
        = +=20 ...

The point is, that I want to shape the speed of each client=20
and I want to shape the speed of the = services the=20 client uses.
I don't use iptables to mark the packets, because the = use of=20 IMQ,
but I know that there is a patch for=20 this.

So for ex. I want to do if the user is downloading = something from=20 FTP,
that he would be able to use the = other services=20 like websurfing
or playing games at the same speed as = if he=20 didn't download.

Roman -  Rate 80 Ceil = 160
   +FTP=20 Rate 1 Ceil 160
   +Other Traffic Rate 79 Ceil = 160

Then=20 I got Phill  with the same settings,
but that if Roman is downloading = something=20 from FTP it will slow down
while Phill is surfing the web.=20
There will be some clients, whoose = services I=20 dont want to shape,
that's why I want to do it this = way.

Please help me any way, I = tried almost=20 everything to get this working
 
Thank you very much,
    Phill
 
---This is my latest = idea---
 
LOCAL=3D"imq0"
NET=3D"ppp0" =
 
IPT=3D/sbin/iptables
 
modprobe imq numdevs=3D1
ip link = set imq0 up=20
$IPT -t mangle -A PREROUTING -i ppp0 = -j IMQ=20
 
tc qdisc add dev $LOCAL root handle = 1: htb=20 default 999
 
tc class add dev $LOCAL parent = 1:0  classid=20 1:1  htb rate 160kbit ceil 160kbit
 
#Roman
    tc class = add dev=20 $LOCAL parent 1:1 classid 1:110 htb rate 80kbit=20 ceil 160kbit
        tc=20 class add dev $LOCAL parent 1:110 classid 1:1101 htb rate = rate 79kbit=20 ceil 160kbit
        tc class = add dev=20 $LOCAL parent 1:110 classid 1:1102 htb rate 1kbit=20 ceil 160kbit
    tc filter add dev $LOCAL parent = 1:0=20 protocol ip u32 match ip dst 192.168.1.10 flowid=20 1:110
        tc filter add dev = $LOCAL=20 parent 1:110 protocol ip u32 match ip dst 192.168.1.10 flowid=20 1:1101
        tc filter add dev = $LOCAL=20 parent 1:110 protocol ip u32 match ip dport 20 0xffff flowid=20 1:1102 
        = tc filter=20 add dev $LOCAL parent 1:110 protocol ip u32 match ip dport = 21 0xffff flowid=20 1:1102 
#Phill
    tc class add = dev $LOCAL=20 parent 1:1 classid 1:210 htb rate 80kbit ceil 160kbit
        tc=20 class add dev $LOCAL parent 1:210 classid 1:2101 htb rate = rate 79kbit=20 ceil 160kbit
        tc class = add dev=20 $LOCAL parent 1:210 classid 1:2102 htb rate 1kbit=20 ceil 160kbit
    tc filter add dev $LOCAL parent = 1:0=20 protocol ip u32 match ip dst 192.168.1.10 flowid=20 1:210
        tc filter add dev = $LOCAL=20 parent 1:210 protocol ip u32 match ip dst 192.168.1.10 flowid=20 1:2101
        tc filter add dev = $LOCAL=20 parent 1:210 protocol ip u32 match ip dport 20 0xffff flowid=20 1:2102 
        = tc filter=20 add dev $LOCAL parent 1:210 protocol ip u32 match ip dport = 21 0xffff flowid=20 1:2102 =20
------=_NextPart_000_0026_01C37DC1.75DEED50-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/