?
Solved

HTB dynamic configuration

Posted on 2003-02-25
5
Medium Priority
?
439 Views
Last Modified: 2010-03-17
Lets have this example:

10 users sharing 1Mbit connection to Internet.
I want an example configuration of HTB (using tc) to implement this task:
When one user is downloading it must use the whole bandwidth, when there are two users they must share the link equally (500Kbit each) and so on.
0
Comment
Question by:CyberGod
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 6

Expert Comment

by:mbarbos
ID: 8015452
Here is the manual. the example is a little bit more complicated than you requested, but I hope it'll do.

If there is anything unclear, please say so.
0
 
LVL 6

Expert Comment

by:mbarbos
ID: 8015539
0
 

Accepted Solution

by:
Gilmor earned 1000 total points
ID: 8787721
Here is my litle sample, but better is use htb.init
http://sourceforge.net/projects/htbinit

This sample is only for one way (download/upload). for both way is need this apply to other interface.

tc qdisc del dev eth1 root
tc qdisc add dev eth1 root handle 1 htb default 999

tc class add dev eth1 parent 1: classid 1:2 htb rate 1024Kbit ceil 1024Kbit

tc class add dev eth1 parent 1:2 classid 1:10 htb rate 100Kbit ceil 1024Kbit burst 2K
tc qdisc add dev eth1 parent 1:10 handle 10 sfq perturb 10
tc filter add dev eth1 parent 1:0 protocol ip prio 100 u32 match ip dst 10.10.10.10 classid 1:10

tc class add dev eth1 parent 1:2 classid 1:11 htb rate 100Kbit ceil 1024Kbit burst 2K
tc qdisc add dev eth1 parent 1:11 handle 11 sfq perturb 10
tc filter add dev eth1 parent 1:0 protocol ip prio 100 u32 match ip dst 10.10.10.11 classid 1:11

tc class add dev eth1 parent 1:2 classid 1:12 htb rate 100Kbit ceil 1024Kbit burst 2K
tc qdisc add dev eth1 parent 1:12 handle 12 sfq perturb 10
tc filter add dev eth1 parent 1:0 protocol ip prio 100 u32 match ip dst 10.10.10.12 classid 1:12

.
.
.
.

tc class add dev eth1 parent 1:2 classid 1:20 htb rate 100Kbit ceil 1024Kbit burst 2K
tc qdisc add dev eth1 parent 1:20 handle 20 sfq perturb 10
tc filter add dev eth1 parent 1:0 protocol ip prio 100 u32 match ip dst 10.10.10.20 classid 1:20


tc class add dev eth1 parent 1:2 classid 1:999 htb rate 32Kbit burst 2K
tc qdisc add dev eth1 parent 1:999 handle 999 sfq perturb 10
0
 

Expert Comment

by:CleanupPing
ID: 9077785
CyberGod:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question