From: "Stefano Mainardi" Date: Sat, 27 May 2006 22:11:10 +0000 Subject: Fwd: [LARTC] HTB shaping & borrowing info Message-Id: MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============1298562044==" List-Id: To: lartc@vger.kernel.org --===============1298562044== Content-Type: multipart/alternative; boundary="----=_Part_172014_13618291.1148767870102" ------=_Part_172014_13618291.1148767870102 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 2006/5/27, Andreas Klauer : > > If B don't make traffic, 7/8 of 20Mb/s must be assigned to A and all th= e > > rest at B > > Why would you assign traffic at B if it doesn't make traffic? Sorry, "all the rest at A" :) > > Post your HTB script and I (and probably others) will have a look at it. This is the script: // #!/bin/bash STEFANO=3D"00:0F:B0:5F:A6:AD" NEWDEV=3D"00:13:D4:20:3B:46" VPN3=3D"00:13:A1:60:3B:AA" MARK_STEFANO=3D1 MARK_PAOLO=3D2 MARK_VPN4=3D3 tc qdisc del dev eth1 root iptables -t mange -F iptables -t mangle -A PREROUTING -i eth0 -m mac -mac-source $STEFANO -j MAR= K -set-mark $MARK_STEFANO iptables -t mangle -A PREROUTING -i eth0 -m mac -mac-source $PAOLO -j MARK -set-mark $MARK_PAOLO iptables -t mangle -A PREROUTING -i eth0 -m mac -mac-source $VPN4 -j MARK -set-mark $MARK_VPN4 tc qdisc add dev eth1 root handle 11: htb tc class add dev eth1 parent 11:0 classid 11:1 htb rate 100Mbit ceil 100Mbi= t burst 6k cburst 64k quantum 1600 tc class add dev eth1 parent 11:1 classid 11:2 htb rate 70Mbit ceil 70Mbit burst 6k cburst 64k quantum 1600 tc class add dev eth1 parent 11:1 classid 11:3 htb rate 20Mbit ceil 20Mbit burst 6k cburst 64k quantum 1600 tc class add dev eth1 parent 11:1 classid 11:4 htb rate 10Mbit ceil 10Mbit burst 6k cburst 64k quantum 1600 tc qdisc add dev eth1 parent 11:2 handle 20: sfq preturb 10 tc qdisc add dev eth1 parent 11:3 handle 20: sfq preturb 10 tc qdisc add dev eth1 parent 11:4 handle 20: sfq preturb 10 tc filter add dev eth1 protocol ip handle $MARK_STEFANO fw flowid 11:2 tc filter add dev eth1 protocol ip handle $MARK_PAOLO fw flowid 11:3 tc filter add dev eth1 protocol ip handle $MARK_VPN4 fw flowid 11:2 \\ We have tested this script with CEIL=3DRATE, and CEIL=3D100Mbit, but i view= that the data-rate calculated for each PC is not proportional to the traffic assigned at Firewall. Many thanks. --=20 Stefano Mainardi Presidente Associazione ILDN - Italian Linux Distro Network Mobile: 349/3917212 Skype: mainardistefano IM (ICQ): 250-292-408 Blog: http://www.mainardistefano.org --=20 Stefano Mainardi Presidente Associazione ILDN - Italian Linux Distro Network Mobile: 349/3917212 Skype: mainardistefano IM (ICQ): 250-292-408 Blog: http://www.mainardistefano.org ------=_Part_172014_13618291.1148767870102 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 2006/5/27, Andreas Klauer <Andreas.Klauer@metamorpher.de>= ;:
> If B don't make traffic, 7/8 of 20Mb/s must be assigned to A and all t= he
> rest at B

Why would you assign traffic at B if it doesn't= make traffic?

Sorry, "all the = rest at A" :)

Post your HTB script and I (and probably others) = will have a look at it.


This is  the script:
//
#!/bin/ba= sh
STEFANO=3D"00:0F:B0:5F:A6:AD"
NEWDEV=3D"00:13:D4:20= :3B:46"
VPN3=3D"00:13:A1:60:3B:AA"
MARK_STEFANO=3D1MARK_PAOLO=3D2
MARK_VPN4=3D3

tc qdisc del dev eth1 root

iptables -t mange -F
iptables = -t mangle -A PREROUTING -i eth0 -m mac -mac-source $STEFANO -j MARK -set-ma= rk $MARK_STEFANO
iptables -t mangle -A PREROUTING -i eth0 -m mac -mac-so= urce $PAOLO -j MARK -set-mark $MARK_PAOLO
iptables -t mangle -A PREROUTING -i eth0 -m mac -mac-source $VPN4 -j MA= RK -set-mark $MARK_VPN4

tc qdisc add dev eth1 root handle 11: htbtc class add dev eth1 parent 11:0 classid 11:1 htb rate 100Mbit ceil 100Mb= it burst 6k cburst 64k quantum 1600
tc class add dev eth1 parent 11:1 classid 11:2 htb rate 70Mbit ceil 70Mbit = burst 6k cburst 64k quantum 1600
tc class add dev eth1 parent 11:1 class= id 11:3 htb rate 20Mbit ceil 20Mbit burst 6k cburst 64k quantum 1600
tc class add dev eth1 parent 11:1 classid 11:4 htb rate 10Mbit ceil 10Mbit = burst 6k cburst 64k quantum 1600

tc qdisc add dev eth1 parent 11:2 h= andle 20: sfq preturb 10
tc qdisc add dev eth1 parent 11:3 handle 20: sf= q preturb 10
tc qdisc add dev eth1 parent 11:4 handle 20: sfq preturb 10

tc filte= r add dev eth1 protocol ip handle $MARK_STEFANO fw flowid 11:2
tc filter= add dev eth1 protocol ip handle $MARK_PAOLO fw flowid 11:3
tc filter ad= d dev eth1 protocol ip handle $MARK_VPN4 fw flowid 11:2
\\

We have tested this script with CEIL=3DRATE, and CEIL= =3D100Mbit, but i view that the data-rate calculated for each PC is not pro= portional to the traffic assigned at Firewall.

Many thanks.
--=20
Stefano Mainardi
Presidente Associazio= ne ILDN - Italian Linux Distro Network
Mobile: 349/3917212
Skype: mai= nardistefano
IM (ICQ): 250-292-408
Blog: http://www.mainardistefano.org


--
Stefano Mainardi
Presidente As= sociazione ILDN - Italian Linux Distro Network
Mobile: 349/3917212
Sk= ype: mainardistefano
IM (ICQ): 250-292-408
Blog: http://www.mainardistefano.org ------=_Part_172014_13618291.1148767870102-- --===============1298562044== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc --===============1298562044==--