Networking Forums

Networking Forums > Computer Networking > Linux Networking > Limit speed for shared Internet connection

Reply
Thread Tools Display Modes

Limit speed for shared Internet connection

 
 
Yvan@office
Guest
Posts: n/a

 
      10-14-2005, 12:05 PM
I have ISDN connection to Internet that I share with few other offices
at work.

Sometimes someone starts downloading big files, and all of the other
users can not do anything.

How can I put some speed limit to such users? Say 1/3 of a full speed,
or 2000 bytes/sec or something?

I found something on the Internet, and tried to adapt for my situation,
but no luck. Hire:

/sbin/tc class add dev eth0 parent 1: classid 1:1 htb rate 16kbps\
ceil 16kbps
/sbin/tc class add dev eth0 parent 1:1 classid 1:10 htb rate 1kbps\
ceil 1kbps
/sbin/tc class add dev eth0 parent 1:1 classid 1:11 htb rate 1kbps\
ceil 1kbps
/sbin/tc class add dev eth0 parent 1:1 classid 1:12 htb rate 1kbps\
ceil 1kbps
/sbin/tc class add dev eth0 parent 1:1 classid 1:13 htb rate 1kbps\
ceil 1kbps
/sbin/tc class add dev eth0 parent 1:1 classid 1:15 htb rate 8kbps\
ceil 16kbps

/sbin/tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32\
match ip src 192. 168.0.9 match ip dport 80 0xffff flowid 1:10
/sbin/tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32\
match ip src 192. 168.0.14 match ip dport 80 0xffff flowid 1:11
/sbin/tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32\
match ip src 192. 168.0.15 match ip dport 80 0xffff flowid 1:12
/sbin/tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32\
match ip src 192. 168.0.28 match ip dport 80 0xffff flowid 1:13

/sbin/tc qdisc add dev eth0 parent 1:10 handle 20: pfifo limit 5
/sbin/tc qdisc add dev eth0 parent 1:11 handle 30: pfifo limit 5
/sbin/tc qdisc add dev eth0 parent 1:12 handle 40: pfifo limit 5
/sbin/tc qdisc add dev eth0 parent 1:13 handle 50: pfifo limit 5
/sbin/tc qdisc add dev eth0 parent 1:15 handle 60: sfq perturb 10

Any ides how to fix this, or any other way I can limit speed for some
users? I am not linux expert, so gui tool would be great :-)

--
___ ____
/__/ / \ ** Registrovani korisnik Linuksa #291606 **
/ / \/ /\ \ ** Registered Linux user #291606 **
/__/\____/--\__\ ** http://counter.li.org/ **

 
Reply With Quote
 
 
 
 
buck
Guest
Posts: n/a

 
      10-14-2005, 06:15 PM
On Fri, 14 Oct 2005 14:05:25 +0200, "Yvan@office" <(E-Mail Removed)>
wrote:

>I have ISDN connection to Internet that I share with few other offices
>at work.
>
>Sometimes someone starts downloading big files, and all of the other
>users can not do anything.
>
>How can I put some speed limit to such users? Say 1/3 of a full speed,
>or 2000 bytes/sec or something?
>
>I found something on the Internet, and tried to adapt for my situation,
>but no luck. Hire:
>
>/sbin/tc class add dev eth0 parent 1: classid 1:1 htb rate 16kbps\
> ceil 16kbps


That is for OUTBOUND traffic. It does nothing about inbound.

>Any ides how to fix this, or any other way I can limit speed for some
>users? I am not linux expert, so gui tool would be great :-)


Trickle?
http://monkey.org/~marius/trickle

You could also police incoming by IP or port, dropping overlimit.
LINE WRAP NOTICE: Two lines follow.
tc qdisc add dev $IDEV handle ffff: ingress
tc filter add dev $IDEV parent ffff: protocol ip prio 50 u32 match ip
src $BADIP/$MASK police rate $RATEkbit burst $BURSTk drop flowid :1

--or something --

I recommend you go here and do some reading:
http://www.shurdix.org

And then there's iptables, which has some flow control stuff.
--
buck

 
Reply With Quote
 
Antoine EMERIT
Guest
Posts: n/a

 
      10-15-2005, 07:56 PM
"Yvan@office" <(E-Mail Removed)> écrivait newsan.2005.10.14.12.05.13.929069
@privacy.net:

> I have ISDN connection to Internet that I share with few other offices
> at work.
>
> Sometimes someone starts downloading big files, and all of the other
> users can not do anything.


May I sugest you to test the WonderShaper script, witch "oxygenize" a
congestionned bandwidth (by allowing short ACK packet to pass more easily):

http://lartc.org/wondershaper/


And for a full understanding of the Linux QOS features :

http://lartc.org


Regards
 
Reply With Quote
 
Yvan@office
Guest
Posts: n/a

 
      11-29-2005, 11:06 AM
Nedavno Yvan@office pi¹e:

> I have ISDN connection to Internet that I share with few other offices
> at work.
>
> Sometimes someone starts downloading big files, and all of the other
> users can not do anything.
>
> How can I put some speed limit to such users?



I found a working setup. Hire:

-----------------------------------------------------------------
# Deleting previous settings
# /sbin/tc qdisc del dev eth0 root

/sbin/tc qdisc add dev eth0 root handle 1: htb default 10

/sbin/tc class add dev eth0 parent 1: classid 1:1 htb rate 64kbit
/sbin/tc class add dev eth0 parent 1:1 classid 1:10 htb rate 32kbit
/sbin/tc class add dev eth0 parent 1:1 classid 1:11 htb rate 8kbit
/sbin/tc class add dev eth0 parent 1:1 classid 1:12 htb rate 8kbit
/sbin/tc class add dev eth0 parent 1:1 classid 1:13 htb rate 8kbit
/sbin/tc class add dev eth0 parent 1:1 classid 1:15 htb rate 8kbit

/sbin/tc filter add dev eth0 protocol ip parent 1: prio 0 u32\
match ip src 192.168.0.1 flowid 1:10
/sbin/tc filter add dev eth0 protocol ip parent 1: prio 1 u32\
match ip src 192.168.0.9 flowid 1:11
/sbin/tc filter add dev eth0 protocol ip parent 1: prio 1 u32\
match ip src 192.168.0.14 flowid 1:12
/sbin/tc filter add dev eth0 protocol ip parent 1: prio 1 u32\
match ip src 192.168.0.15 flowid 1:13
/sbin/tc filter add dev eth0 protocol ip parent 1: prio 1 u32\
match ip src 192.168.0.28 flowid 1:15
-----------------------------------------------------------------

Of course I am at 192.168.0.1 :-)


--
___ ____
/__/ / \ ** Registrovani korisnik Linuksa #291606 **
/ / \/ /\ \ ** Registered Linux user #291606 **
/__/\____/--\__\ ** http://counter.li.org/ **
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
shared internet connection SteveK14 Wireless Networks 2 08-01-2006 11:58 PM
Applications cannot use shared Internet Connection simonstevens35 Wireless Networks 0 02-27-2005 05:01 PM
Shared Internet Connection Problem William J. Burlingame Wireless Internet 2 01-28-2005 04:46 PM
How to get beyond a shared internet connection marby Wireless Networks 0 01-04-2005 02:33 AM
Shared internet - Control (limit) bandwitdth based on users mACKnIFE Windows Networking 0 09-19-2004 12:23 AM



1 2 3 4 5 6 7 8 9 10 11