Hi Bas
The real good thing about CBQ is that does not require the use of proxy (which i hate!, they are too complicated

, and explain to my users to set them correctly will lead me to some extra headache that i prefer to avoid hehe.
Yesterday I connect my 3rd neighbour to my intranet and, so far, everything works great, iptraf reports a good and balanced usage of bandwidth, I still can't believe
how good it works, the outgoing problem (not limiting BW for outgoing packets) was not serious since none of them tryed yet to instal any p2p software, but
i need to find out how to control outgoing data just before than anyone installs
some kazaa or similar

well here it is, please no flames

, I'm just a newbie that i'm learning how
to do it, and wrote this also to remember how I did it in the first place

.
suggestions and corrections of my errors are very well welcome hehe.
Seeyou
Lightman
----------------------------------------
Title: Bandwidth Limiting in SME server V 5 for newbies (like me)
Creator: Lightman
applies to: SME Server V 5.0 - CBQ usage
Thanks to: All the guys of the SME Board that indirectly teach me
so much, the SME team for developing such great distro
and the Bandwidth-Limiting-HOWTO creators.
intro:
------
If you are reading this probably is because you wanna do it as I wanted to,
at first sight seems deadly difficult, however, SME guys did an excellent
job simplifying the whole thing.
There are others documents that explains how to do bandwidth limiting using
squid proxy and other method's, however what I wanted was a easy way to do
it, I will sacrifice features in order to keep as easy as possible.
After reading 4 months of postings related ot it and some HOWTOS I decide
to use CBQ, because I thought that this method was the more clear to
implement, and since SME comes with CBQ ready to use, the choice was clear.
my particular requirement:
--------------------------
First, a little of intro of why I'm doing this, due to the economical
difficult's in my country, and as consecuence of this, in the people, high
speed internet access is expensive, and very few people can afford it,
due to the nature of my job, i need 24 hs internet access, but it's not
mandatory to have all the bandwidth available, so after talking with my
condo's neighbours that they will love to be online 24hs, we decide to
share the internet access, since I was using SME server for my personal
local network, I will extend my local network to the others appartments.
as a result of this, i believe that my network will suffer the motorway
effect, pretty soon i will see how my neighbours eat all my bandwidth
with programs like KaZaA, audiogalaxy, Edonkey (without limitating
the bandwidth adecuately) and very quickly what once was a fast
access it may be turn slower than a dial up one, aaaaahhhhgggg!!!.
Something must be done NOW, before it happens.
So my network: 192.168.1.0/24 ,LAN interfase was eth0 (100Mbit)
WAN interfase is a DSL router Cisco 667 (ppp0) connected to eth1
my total bandwidth is 256K downstream and about 128Kbit upstream.
(i will upgrade the service to 512K when more than 4 neigbours decide
to connect to my lan).
my local computers won't be limited

, only the neigbours.
neighbour computers are in the range of 192.168.1.50 to 192.168.1.60
the procedure:
--------------
go to: /etc/sysconfig/cbq
there is only one file there, for demo only, i moved these to my home dir
then copy and edit (to preserve the original).
two files are necessary since I need to limit the total bandwidth
(regardless the port used), and do it not just for download but for upload
as well, so programs like KaZaA don't eat it all

create 2 files the first one will limit the DOWNLOAD capability of my
loved bandwidth hungry neighbour's

named 'cbq-20.clients' contains:
DEVICE=eth0,100Mbit,10Mbit
RATE=35kbit
WEIGHT=4Kbit
PRIO=5
# 8.A.
RULE=192.168.1.50
# 7.A.
RULE=192.168.1.51
# 7.B.
RULE=192.168.1.52
# 6.A.
RULE=192.168.1.53
# and keep going, and going, just add the
# IP numbers you want to limit as the 4
# ones up here.
now the UPLOAD file 'cbq-21.clients'
DEVICE=ppp0,256Kbit,12kbit
RATE=28Kbit
WEIGHT=3Kbit
PRIO=5
# 8.A.
RULE=192.168.1.50
# 7.A.
RULE=192.168.1.51
# 7.B.
RULE=192.168.1.52
# 6.A.
RULE=192.168.1.53
# same as cbq-20.clients this will
# continue with the same data
now put them on /etc/sysconfig/cbq
and go to /sbin
type cbq start , this command will start the CBQ and inmediately
start's to limitate the bandwidth, if you want to stoppet just
type cbq stop
now this is some how, done by hand, we must to automatize it.
go to
/etc/rc.d/rc.local
add at the very end of the file
/sbin/cbq start
this will start cbq when all the loading process was completed.
(the last thing to load).
well that's it! , simple isn't it?.
now you can play a little more, since CBQ can do a lot more things
than just that, it can limit bandwidth by a specific port or even
in a programmed time.
look on the net for bandwidth-limiting-HOWTO and take a look
at the CBQ part of this file, there are several options discussed
there (except the one i explained here

.
------------UPDATE------------
the setting: DEVICE=ppp0,256Kbit,12kbit
in file 'cbq-21.clients' don't work in my SME, don't know why
(that's why i post here in the first place

, so try instead
the following settings for the file 'cbq-21.clients'
DEVICE=eth1,10Mbit,1Mbit
RATE=28Kbit
WEIGHT=3Kbit
not sure if it will work, but I let you know soon when I test it
see you
Lightman