This is a multi-part message in MIME format.
------=_NextPart_000_001F_01C46E70.EF9C31C0
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
----- Original Message -----=20
From: Micha=B3 Joachimiak=20
To: lartc@mailman.ds9a.nl=20
Sent: Tuesday, July 20, 2004 3:45 PM
Subject: HTB - Really Big problem
Hello everybody!
Since week i dig lists and www and can't find solution for my problem.
I'm using HTB 3.13 kernel 2-4-25 smp iptables 1.2.9.
I've got situation like this:
LAN------Linux Box(routing only)------- Linux Box =
(HTB)--------------Hardware Router(say:HD)------Internet
When I start HTB it takes about 5 min. to start working and it works...
within this 5min starting i can't ping HD and after about 5min I start =
pinging. It works like this for cuple of hours, then something strange =
is happening. Ping stops, www doesn't work but radio (36kbps) works. =
There is no ping at all for about 1min and it starts pinging for about =
2-3min and it stops for 1-2min and so on.....
When I stop HTB ping starts. It's look like HTB is filled to much(sorry =
for my english :/)
All my children classes rate doesn't exceeds root classes. I have 50 =
classes on 900kbit-10kbit(for default class) - downstream and =
800-10kbit(for default) up.
I shape bandwidth matching ip. r2q is set to 1 . no erros during doing =
shape script.=20
I'm attaching this script
in ip1 ip2 and so on are files where are written ip's for C classes.
I'm including my script.
---------------------------------------------------cut here =
-------------------------------------------------------------------------=
----------
#!/bin/bash
#x=3D$[100/20]
#echo "$1" > /skrytpy/status
rxmax=3D900 #WAN max transfer -down (physically it is 960kbit/960kbit)
kbit=3Dkbit
rxmaxluser=3D250
txmax=3D800 #WAN max transfer - up=20
txmaxluser=3D100
#counting users
# ip1 file is like this:
# 11 #Somebody
# 23 #Somebody II
#EOF
licznik=3D0
for x in $(awk '{ print $1 }' /skrytpy/ip1); do
licznik=3D$[$licznik+1]
done
for x in $(awk '{ print $1 }' /skrytpy/ip2); do
licznik=3D$[$licznik+1]
done
for x in $(awk '{ print $1 }' /skrytpy/ip3); do
licznik=3D$[$licznik+1]
done
for x in $(awk '{ print $1 }' /skrytpy/ip128); do
licznik=3D$[$licznik+1]
done
for x in $(awk '{ print $1 }' /skrytpy/ip4); do
licznik=3D$[$licznik+1]
done
for x in $(awk '{ print $1 }' /skrytpy/ipzew); do
licznik=3D$[$licznik+1]
done
for x in $(awk '{ print $1 }' /skrytpy/ip6); do
licznik=3D$[$licznik+1]
done
#Server
licznik=3D$[$licznik+1]
#plus router
licznik=3D$[$licznik+1]
echo number of users to $licznik
#counting rate
rx1=3D$[$rxmax-10]
tx1=3D$[$txmax-10] # dla klasy domyslnej
rxmin=3D$[$rx1/$licznik]
txmin=3D$[$tx1/$licznik]
echo rx $rxmin tx $txmin
#echo $rxmin
#root classes
#rx
tc qdisc del root dev eth1
tc qdisc add dev eth1 root handle 1:0 htb r2q 1 default 2
tc class add dev eth1 parent 1:0 classid 1:1 htb rate $rxmax$kbit ceil =
$rxmax$kbit
#tx
tc qdisc del root dev eth0
tc qdisc add dev eth0 root handle 2:0 htb r2q 1 default 4
tc class add dev eth0 parent 2:0 classid 2:1 htb rate $txmax$kbit ceil =
$txmax$kbit
#r=3D"$rxmax$kbit"
#default classes
#rx
tc class add dev eth1 parent 1:1 classid 1:2 htb rate 10kbit ceil 10kbit =
#tx
tc class add dev eth0 parent 2:1 classid 2:4 htb rate 10kbit ceil 10kbit
#siec 1.0
siec=3D1
for ip in $(awk '{ print $1 }' /skrytpy/ip1); do
echo -n "$ip "
#rx
tc class add dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil =
$rxmaxluser$kbit
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst =
192.168.$siec.$ip flowid 1:$ip
tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
#tx
#marking packets
iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.$siec.$ip -j MARK =
--set-mark $ip
#tc
tc class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil =
$txmaxluser$kbit
#filtering by mark
tc filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw =
flowid 2:$ip
tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb 10
done
echo ""
#siec 2.0
siec=3D2
for ip in $(awk '{ print $1 }' /skrytpy/ip2); do
echo -n "$ip "=20
tc class add dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil =
$rxmaxluser$kbit
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst =
192.168.$siec.$ip flowid 1:$ip
tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
#mark
iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.$siec.$ip -j MARK =
--set-mark $ip
#tc
tc class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil =
$txmaxluser$kbit
tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb 10
#filtrowanie po marku
tc filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw =
flowid 2:$ip
done
#siec 3.0
siec=3D3
echo " "=20
for ip in $(awk '{ print $1 }' /skrytpy/ip3); do
echo -n "$ip "
tc class add dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil =
128kbit
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst =
192.168.$siec.$ip flowid 1:$ip
tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
#mark
iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.$siec.$ip -j MARK =
--set-mark $ip
#tc
tc class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil =
64kbit
tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb 10
#filtrowanie po marku
tc filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw =
flowid 2:$ip
done
echo " "
#Siec 4
siec=3D4
for ip in $(awk '{ print $1 }' /skrytpy/ip4); do
echo -n "$ip "
tc class add dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil =
128kbit
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst =
192.168.$siec.$ip flowid 1:$ip
tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
#mark
iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.$siec.$ip -j MARK =
--set-mark $ip
#tc
tc class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil =
64kbit
tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb 10
#filtrowanie po marku
tc filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw =
flowid 2:$ip
done
echo " "
#walas
siec=3D6
for ip in $(awk '{ print $1 }' /skrytpy/ip6); do
echo -n "$ip "
tc class add dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil =
128kbit
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst =
192.168.$siec.$ip flowid 1:$ip
tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
#mark
iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.$siec.$ip -j MARK =
--set-mark $ip
#tc
tc class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil =
64kbit
tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb 10
#filtrowanie po marku
tc filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw =
flowid 2:$ip
done
echo " "
#Siec ip zewnetrznych
siec=3D62.87.193
for ip in $(awk '{ print $1 }' /skrytpy/ipzew); do
echo -n "$ip "
tc class add dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil =
$rxmaxluser$kbit
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst $siec.$ip =
flowid 1:$ip
tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
#mark
iptables -t mangle -A MYSHAPER-OUT -p tcp -s $siec.$ip -j MARK =
--set-mark $ip
#tc
tc class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil =
$txmaxluser$kbit
tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb 10
#filtrowanie po marku
tc filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw =
flowid 2:$ip
done
echo " "
#Wyjatki z ip128
siec=3D1
ip=3D54
echo $ip
tc class add dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil =
64kbit
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst =
192.168.$siec.$ip flowid 1:$ip
tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.$siec.$ip -j MARK =
--set-mark $ip
#tc
tc class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil =
20kbit
tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb 10
#filtrowanie po marku
tc filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw =
flowid 2:$ip
siec=3D2
ip=3D53
echo $ip
tc class add dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil =
128kbit
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst =
192.168.$siec.$ip flowid 1:$ip
tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
#tx
iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.$siec.$ip -j MARK =
--set-mark $ip
#tc
tc class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil =
64kbit
tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb 10
#filtrowanie po marku
tc filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw =
flowid 2:$ip
siec=3D4
ip=3D138
echo $ip
tc class add dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil =
400kbit
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst =
62.87.193.$ip flowid 1:$ip
tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
#tx
iptables -t mangle -A MYSHAPER-OUT -p tcp -s 62.87.193.$ip -j MARK =
--set-mark $ip
#tc
tc class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil =
256kbit
tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb 10
#filtrowanie po marku
tc filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw =
flowid 2:$ip
#Serwer
siec=3D5
ip=3D3
echo "5.2/3" #nadle x:3 because x:3 are saved for default classess
tc class add dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil =
200kbit
tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst =
192.168.5.2 flowid 1:$ip
tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
#tx
iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.5.2 -j MARK =
--set-mark $ip
tc class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil =
256kbit
tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb 10
#filtrowanie po marku
tc filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw =
flowid 2:$ip
--------------------------------------------------------------------cut =
here ------------------------------------------------------------------
Please help - I have no idea why it's not works.
------=_NextPart_000_001F_01C46E70.EF9C31C0
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-2">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV> </DIV>
<DIV style=3D"FONT: 10pt arial">----- Original Message -----=20
<DIV style=3D"BACKGROUND: #e4e4e4; font-color:
black"><B>From:</B> <A=20
title=3Dmonster@aleksandrow.net =
href=3D"mailto:monster@aleksandrow.net">Micha=B3=20
Joachimiak</A> </DIV>
<DIV><B>To:</B> <A title=3Dlartc@mailman.ds9a.nl=20
href=3D"mailto:lartc@mailman.ds9a.nl">lartc@mailman.ds9a.nl</A>
</DIV>
<DIV><B>Sent:</B> Tuesday, July 20, 2004 3:45 PM</DIV>
<DIV><B>Subject:</B> HTB - Really Big
problem</DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT face=3DArial size=3D2>Hello
everybody!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Since week i dig lists and www and
=
can't find=20
solution for my problem.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I'm using HTB 3.13 kernel 2-4-25
smp =
iptables=20
1.2.9.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I've got situation like =
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>LAN------Linux Box(routing
only)------- =
Linux Box=20
(HTB)--------------Hardware
Router(say:HD)------Internet</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>When I start HTB it takes about 5
min. =
to start=20
working and it works...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>within this 5min starting i can't
ping =
HD and after=20
about 5min I start pinging. It works like this for cuple of hours, then=20
something strange is happening. Ping stops, www doesn't work but radio =
(36kbps)=20
works. There is no ping at all for about 1min and it starts pinging for =
about=20
2-3min and it stops for 1-2min and so on.....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>When I stop HTB ping starts. It's
look =
like HTB is=20
filled to much(sorry for my english :/)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>All my children classes rate
doesn't =
exceeds root=20
classes. I have 50 classes on 900kbit-10kbit(for default class) - =
downstream and=20
800-10kbit(for default) up.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I shape bandwidth matching ip. r2q
is =
set to 1 . no=20
erros during doing shape script. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I'm attaching this
script</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in ip1 ip2 and so on are
files =
where are=20
written ip's for C classes.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'm including my
script.</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>---------------------------------------------------cut here=20
-------------------------------------------------------------------------=
----------</FONT></DIV>
<DIV><FONT face=3DArial
size=3D2>#!/bin/bash<BR>#x=3D$[100/20]<BR>#echo =
"$1" >=20
/skrytpy/status<BR>rxmax=3D900 #WAN max transfer -down (physically it is =
960kbit/960kbit)<BR>kbit=3Dkbit<BR>rxmaxluser=3D250<BR>txmax=3D800
#WAN =
max transfer -=20
up <BR>txmaxluser=3D100<BR>#counting users<BR># ip1 file is
like =
this:<BR># 11=20
#Somebody<BR># 23 #Somebody
II<BR>#EOF<BR>licznik=3D0<BR>for =
x in=20
$(awk '{ print $1 }' /skrytpy/ip1);=20
do<BR>licznik=3D$[$licznik+1]<BR>done<BR>for
x in $(awk '{ =
print $1 }'=20
/skrytpy/ip2);
do<BR>licznik=3D$[$licznik+1]<BR>done<BR>for
=
x in $(awk=20
'{ print $1 }' /skrytpy/ip3);=20
do<BR>licznik=3D$[$licznik+1]<BR>done<BR>for
x in $(awk '{ =
print $1 }'=20
/skrytpy/ip128); =
do<BR>licznik=3D$[$licznik+1]<BR>done<BR>for
x in=20
$(awk '{ print $1 }' /skrytpy/ip4);=20
do<BR>licznik=3D$[$licznik+1]<BR>done<BR>for
x in $(awk '{ =
print $1 }'=20
/skrytpy/ipzew); =
do<BR>licznik=3D$[$licznik+1]<BR>done<BR>for
x in=20
$(awk '{ print $1 }' /skrytpy/ip6);=20
do<BR>licznik=3D$[$licznik+1]<BR>done</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial =
size=3D2>#Server<BR>licznik=3D$[$licznik+1]<BR>#plus=20
router<BR>licznik=3D$[$licznik+1]</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>echo number of users to =
$licznik<BR>#counting=20
rate<BR>rx1=3D$[$rxmax-10]<BR>tx1=3D$[$txmax-10] # dla klasy=20
domyslnej<BR>rxmin=3D$[$rx1/$licznik]<BR>txmin=3D$[$tx1/$licznik]<BR>echo=
rx $rxmin=20
tx $txmin<BR>#echo $rxmin<BR>#root classes<BR>#rx<BR>tc
qdisc del root =
dev=20
eth1<BR>tc qdisc add dev eth1 root handle 1:0 htb r2q 1 default
2<BR>tc =
class=20
add dev eth1 parent 1:0 classid 1:1 htb rate $rxmax$kbit ceil=20
$rxmax$kbit<BR>#tx<BR>tc qdisc del root dev eth0<BR>tc qdisc
add dev =
eth0 root=20
handle 2:0 htb r2q 1 default 4<BR>tc class add dev eth0 parent 2:0 =
classid 2:1=20
htb rate $txmax$kbit ceil
$txmax$kbit<BR>#r=3D"$rxmax$kbit"<BR>#default=20
classes<BR>#rx<BR>tc class add dev eth1 parent 1:1 classid 1:2 htb
rate =
10kbit=20
ceil 10kbit <BR>#tx<BR>tc class add dev eth0 parent 2:1 classid 2:4
htb =
rate=20
10kbit ceil 10kbit<BR>#siec 1.0<BR>siec=3D1<BR>for ip in $(awk
'{ print =
$1 }'=20
/skrytpy/ip1); do<BR>echo -n "$ip "<BR>#rx<BR>tc
class add dev eth1 =
parent 1:1=20
classid 1:$ip htb rate $rxmin$kbit ceil $rxmaxluser$kbit<BR>tc filter =
add dev=20
eth1 protocol ip parent 1:0 u32 match ip dst 192.168.$siec.$ip flowid=20
1:$ip<BR>tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
<BR>#tx<BR>#marking packets<BR>iptables -t mangle -A
MYSHAPER-OUT -p tcp =
-s=20
192.168.$siec.$ip -j MARK --set-mark $ip<BR>#tc<BR>tc class add dev
eth0 =
parent=20
2:1 classid 2:$ip htb rate $txmin$kbit ceil =
$txmaxluser$kbit<BR>#filtering by=20
mark<BR>tc filter add dev eth0 protocol ip preference 1 parent 2:0 =
handle $ip fw=20
flowid 2:$ip<BR>tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq =
perturb=20
10<BR>done<BR>echo ""<BR>#siec
2.0<BR>siec=3D2<BR>for ip in $(awk '{ =
print $1 }'=20
/skrytpy/ip2); do<BR>echo -n "$ip " <BR>tc class add dev
eth1 parent 1:1 =
classid=20
1:$ip htb rate $rxmin$kbit ceil $rxmaxluser$kbit<BR>tc filter add dev =
eth1=20
protocol ip parent 1:0 u32 match ip dst 192.168.$siec.$ip flowid =
1:$ip<BR>tc=20
qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
<BR>#mark<BR>iptables -t mangle -A MYSHAPER-OUT -p tcp -s =
192.168.$siec.$ip -j=20
MARK --set-mark $ip<BR>#tc<BR>tc class add dev eth0 parent 2:1
classid =
2:$ip htb=20
rate $txmin$kbit ceil $txmaxluser$kbit<BR>tc qdisc add dev eth0 parent =
2:$ip=20
handle $ip:1 sfq perturb 10<BR>#filtrowanie po marku<BR>tc filter
add =
dev eth0=20
protocol ip preference 1 parent 2:0 handle $ip fw flowid =
2:$ip<BR>done<BR>#siec=20
3.0<BR>siec=3D3<BR>echo " " <BR>for ip in $(awk '{
print $1 }' =
/skrytpy/ip3);=20
do<BR>echo -n "$ip "<BR>tc class add dev eth1 parent 1:1
classid 1:$ip =
htb rate=20
$rxmin$kbit ceil 128kbit<BR>tc filter add dev eth1 protocol ip parent =
1:0 u32=20
match ip dst 192.168.$siec.$ip flowid 1:$ip<BR>tc qdisc add dev eth1 =
parent=20
1:$ip handle $ip:0 sfq perturb 10 <BR>#mark<BR>iptables -t mangle
-A=20
MYSHAPER-OUT -p tcp -s 192.168.$siec.$ip -j MARK --set-mark =
$ip<BR>#tc<BR>tc=20
class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil=20
64kbit<BR>tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb=20
10<BR>#filtrowanie po marku<BR>tc filter add dev eth0 protocol ip =
preference 1=20
parent 2:0 handle $ip fw flowid 2:$ip<BR>done<BR>echo "
"<BR>#Siec=20
4<BR>siec=3D4<BR>for ip in $(awk '{ print $1 }' /skrytpy/ip4); =
do<BR>echo -n "$ip=20
"<BR>tc class add dev eth1 parent 1:1 classid 1:$ip htb rate
$rxmin$kbit =
ceil=20
128kbit<BR>tc filter add dev eth1 protocol ip parent 1:0 u32 match ip =
dst=20
192.168.$siec.$ip flowid 1:$ip<BR>tc qdisc add dev eth1 parent 1:$ip =
handle=20
$ip:0 sfq perturb 10 <BR>#mark<BR>iptables -t mangle -A MYSHAPER-OUT
-p =
tcp -s=20
192.168.$siec.$ip -j MARK --set-mark $ip<BR>#tc<BR>tc class add dev
eth0 =
parent=20
2:1 classid 2:$ip htb rate $txmin$kbit ceil 64kbit<BR>tc qdisc add dev =
eth0=20
parent 2:$ip handle $ip:1 sfq perturb 10<BR>#filtrowanie po
marku<BR>tc =
filter=20
add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw flowid=20
2:$ip<BR>done<BR>echo "
"<BR>#walas<BR>siec=3D6<BR>for ip in $(awk '{ =
print $1 }'=20
/skrytpy/ip6); do<BR>echo -n "$ip "<BR>tc class add dev
eth1 parent 1:1 =
classid=20
1:$ip htb rate $rxmin$kbit ceil 128kbit<BR>tc filter add dev eth1 =
protocol ip=20
parent 1:0 u32 match ip dst 192.168.$siec.$ip flowid 1:$ip<BR>tc qdisc =
add dev=20
eth1 parent 1:$ip handle $ip:0 sfq perturb 10 <BR>#mark<BR>iptables
-t =
mangle -A=20
MYSHAPER-OUT -p tcp -s 192.168.$siec.$ip -j MARK --set-mark =
$ip<BR>#tc<BR>tc=20
class add dev eth0 parent 2:1 classid 2:$ip htb rate $txmin$kbit ceil=20
64kbit<BR>tc qdisc add dev eth0 parent 2:$ip handle $ip:1 sfq perturb=20
10<BR>#filtrowanie po marku<BR>tc filter add dev eth0 protocol ip =
preference 1=20
parent 2:0 handle $ip fw flowid 2:$ip<BR>done<BR>echo "
"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>#Siec ip =
zewnetrznych<BR>siec=3D62.87.193<BR>for ip=20
in $(awk '{ print $1 }' /skrytpy/ipzew); do<BR>echo -n "$ip
"<BR>tc =
class add=20
dev eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil=20
$rxmaxluser$kbit<BR>tc filter add dev eth1 protocol ip parent 1:0 u32 =
match ip=20
dst $siec.$ip flowid 1:$ip<BR>tc qdisc add dev eth1 parent 1:$ip handle =
$ip:0=20
sfq perturb 10 <BR>#mark<BR>iptables -t mangle -A MYSHAPER-OUT -p
tcp -s =
$siec.$ip -j MARK --set-mark $ip<BR>#tc<BR>tc class add dev eth0
parent =
2:1=20
classid 2:$ip htb rate $txmin$kbit ceil $txmaxluser$kbit<BR>tc qdisc add =
dev=20
eth0 parent 2:$ip handle $ip:1 sfq perturb 10<BR>#filtrowanie po =
marku<BR>tc=20
filter add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw =
flowid=20
2:$ip<BR>done<BR>echo " "</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>#Wyjatki z =
ip128<BR>siec=3D1<BR>ip=3D54<BR>echo=20
$ip<BR>tc class add dev eth1 parent 1:1 classid 1:$ip htb rate =
$rxmin$kbit ceil=20
64kbit<BR>tc filter add dev eth1 protocol ip parent 1:0 u32 match ip dst =
192.168.$siec.$ip flowid 1:$ip<BR>tc qdisc add dev eth1 parent 1:$ip =
handle=20
$ip:0 sfq perturb 10 <BR>iptables -t mangle -A MYSHAPER-OUT -p tcp -s=20
192.168.$siec.$ip -j MARK --set-mark $ip<BR>#tc<BR>tc class add dev
eth0 =
parent=20
2:1 classid 2:$ip htb rate $txmin$kbit ceil 20kbit<BR>tc qdisc add dev =
eth0=20
parent 2:$ip handle $ip:1 sfq perturb 10<BR>#filtrowanie po
marku<BR>tc =
filter=20
add dev eth0 protocol ip preference 1 parent 2:0 handle $ip fw flowid=20
2:$ip</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial
size=3D2>siec=3D2<BR>ip=3D53<BR>echo $ip<BR>tc =
class add dev=20
eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil 128kbit<BR>tc =
filter add=20
dev eth1 protocol ip parent 1:0 u32 match ip dst 192.168.$siec.$ip =
flowid=20
1:$ip<BR>tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
<BR>#tx<BR>iptables -t mangle -A MYSHAPER-OUT -p tcp -s =
192.168.$siec.$ip -j=20
MARK --set-mark $ip<BR>#tc<BR>tc class add dev eth0 parent 2:1
classid =
2:$ip htb=20
rate $txmin$kbit ceil 64kbit<BR>tc qdisc add dev eth0 parent 2:$ip =
handle $ip:1=20
sfq perturb 10<BR>#filtrowanie po marku<BR>tc filter add dev eth0 =
protocol ip=20
preference 1 parent 2:0 handle $ip fw flowid 2:$ip</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial
size=3D2>siec=3D4<BR>ip=3D138<BR>echo $ip<BR>tc =
class add dev=20
eth1 parent 1:1 classid 1:$ip htb rate $rxmin$kbit ceil 400kbit<BR>tc =
filter add=20
dev eth1 protocol ip parent 1:0 u32 match ip dst 62.87.193.$ip flowid=20
1:$ip<BR>tc qdisc add dev eth1 parent 1:$ip handle $ip:0 sfq perturb 10=20
<BR>#tx<BR>iptables -t mangle -A MYSHAPER-OUT -p tcp -s
62.87.193.$ip -j =
MARK=20
--set-mark $ip<BR>#tc<BR>tc class add dev eth0 parent 2:1 classid
2:$ip =
htb rate=20
$txmin$kbit ceil 256kbit<BR>tc qdisc add dev eth0 parent 2:$ip handle =
$ip:1 sfq=20
perturb 10<BR>#filtrowanie po marku<BR>tc filter add dev eth0
protocol =
ip=20
preference 1 parent 2:0 handle $ip fw flowid 2:$ip</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial
size=3D2>#Serwer<BR>siec=3D5<BR>ip=3D3<BR>echo =
"5.2/3" #nadle=20
x:3 because x:3 are saved for default classess<BR>tc
class</FONT><FONT=20
face=3DArial size=3D2> add dev eth1 parent 1:1 classid 1:$ip htb rate =
$rxmin$kbit=20
ceil 200kbit<BR>tc filter add dev eth1 protocol ip parent 1:0 u32 match =
ip dst=20
192.168.5.2 flowid 1:$ip<BR>tc qdisc add dev eth1 parent 1:$ip handle =
$ip:0 sfq=20
perturb 10 <BR>#tx<BR>iptables -t mangle -A MYSHAPER-OUT -p tcp -s =
192.168.5.2=20
-j MARK --set-mark $ip<BR>tc class add dev eth0 parent 2:1 classid 2:$ip =
htb=20
rate $txmin$kbit ceil 256kbit<BR>tc qdisc add dev eth0 parent 2:$ip =
handle $ip:1=20
sfq perturb 10<BR>#filtrowanie po marku<BR>tc filter add dev eth0 =
protocol ip=20
preference 1 parent 2:0 handle $ip fw flowid=20
2:$ip<BR>----------------------------------------------------------------=
----cut=20
here=20
------------------------------------------------------------------</FONT>=
</DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Please help - I have no idea why
it's =
not=20
works.</FONT></DIV></BODY></HTML>
------=_NextPart_000_001F_01C46E70.EF9C31C0--