Koozali.org: home of the SME Server

CBQ help ... again!

Paulo Paiva

CBQ help ... again!
« on: February 09, 2003, 02:44:04 PM »
Hi,

I've been reading all of the posts about CBQ and bandwidth throttle... and I still can't get it to work.
I've also tried 2 panels, but none seems to work.

Can anyone give me some advice?

Here's my config:

                                     192.168.76.1
BACKBONE -----eth1-----|  SME linux  |----eth0------*-[client]

I want to limit Uploads to 5KB and downloads to 25KB, so I created 2 files:

# cbq-050.SME-internet
# UPLOAD
# ----------------------
DEVICE=eth1,10Mbit,1Mbit
RATE=50Kbit
WEIGHT=5Kbit
PRIO=5
RULE=192.168.76.1,


# cbq-250.internet-SME
# DOWNLOAD
# ----------------------
DEVICE=eth0,10Mbit,1Mbit
RATE=250Kbit
WEIGHT=25Kbit
PRIO=5
RULE=192.168.76.1


Then when I type 'cbq start' I get the following errors:

[root@server files]# cbq start
Illegal "weight"
Illegal "weight"
Illegal "rate"
Illegal "rate"
Illegal "rate"
Illegal "rate"


I've tried different configurations (swapping interfaces, changing numbers, etc...) but I admit I'm lost!! And I keep assuming that 250Kbit = 25KB, and that WEIGHT should be 10% of RATE...

Can anyone help ?

Thanks in advance,


Paulo

Andrej

Re: CBQ help ... again!
« Reply #1 on: February 11, 2003, 01:09:10 PM »
Read out ma scenario (be very carefull "," after IP means from IP adress) You must config two NICs NOT just one as you did.

1. For DOWNLOAD you must config ETH1

DEVICE=eth1,100Mbit,10Mbit
RATE=250Kbit
WEIGHT=25Kbit
PRIO=5
RULE=192.168.76.0/24  ;(for all IPs on LAN) CAREFULL without COMMA after IP

2. For UPLOAD you must config ETH0

DEVICE=eth0,100Mbit,10Mbit
RATE=50Kbit
WEIGHT=5Kbit
PRIO=5
RULE=192.168.76.1,   ; COMMA after IP means from which IP


About COMMA etc... You are always configurin OUTGOING traffic from NIC !!! So for DOWNLOAD >> ETH1 for UPLOAD >> ETH0

I hope tis helps ;)

Cheers,

Andrej

Paulo Paiva

Re: CBQ help ... again!
« Reply #2 on: February 11, 2003, 11:17:43 PM »
Hey Andrej,

Thank you very much!!! It works...

Keep up the good work,

Paulo

Pat Erler

Re: CBQ help ... again!
« Reply #3 on: February 27, 2003, 11:51:02 AM »
Andrej wrote:
> 1. For DOWNLOAD you must config ETH1
>
> DEVICE=eth1,100Mbit,10Mbit
> RATE=250Kbit
> WEIGHT=25Kbit
> PRIO=5
> RULE=192.168.76.0/24  ;(for all IPs on LAN) CAREFULL without
> COMMA after IP
ok, but how do i configure this with dynamic IPs. i'm connected via PPP to the internet..

>
> 2. For UPLOAD you must config ETH0
>
> DEVICE=eth0,100Mbit,10Mbit
> RATE=50Kbit
> WEIGHT=5Kbit
> PRIO=5
> RULE=192.168.76.1,   ; COMMA after IP means from which IP
so this would be 192.168.0.0/24 if my local address range is 192.168.0.1 to 254, right?



PAT

Andrej

Re: CBQ help ... again!
« Reply #4 on: February 27, 2003, 12:18:51 PM »
NO WAY !!! It DOES NOT work with dynamic IP !!!

Cheers,

Andrej

Pat Erler

Re: CBQ help ... again!
« Reply #5 on: February 27, 2003, 12:22:59 PM »
Andrej wrote:
>
> NO WAY !!! It DOES NOT work with dynamic IP !!!
not even with a restart of the CBQ engine after each dialup? i think i'll try to write a script for this, but i need to know if my other assumption (regarding the ip-range for the local network) is correct, could you have a look into my previous message again?

regards,

PAT

Andrej

Re: CBQ help ... again!
« Reply #6 on: February 27, 2003, 12:52:02 PM »
Pat Erler wrote:
>
> Andrej wrote:
> > 1. For DOWNLOAD you must config ETH1
> >
> > DEVICE=eth1,100Mbit,10Mbit
> > RATE=250Kbit
> > WEIGHT=25Kbit
> > PRIO=5
> > RULE=192.168.76.0/24  ;(for all IPs on LAN) CAREFULL without
> > COMMA after IP
> ok, but how do i configure this with dynamic IPs. i'm
> connected via PPP to the internet..
>
> >
> > 2. For UPLOAD you must config ETH0
> >
> > DEVICE=eth0,100Mbit,10Mbit
> > RATE=50Kbit
> > WEIGHT=5Kbit
> > PRIO=5
> > RULE=192.168.76.1,   ; COMMA after IP means from which IP
> so this would be 192.168.0.0/24 if my local address range is
> 192.168.0.1 to 254, right?

Yes it is right !!! Idea to change cbq files and restart CBQ after each reconect may work. Let us know how to, if ?!?
>
>
>
> PAT

Pat Erler

Re: CBQ help ... again!
« Reply #7 on: February 27, 2003, 01:17:07 PM »
Andrej wrote:

> Yes it is right !!! Idea to change cbq files and restart CBQ
> after each reconect may work. Let us know how to, if ?!?
i'll do it like in the dyndns scripts. something like this:

#!/usr/bin/perl
 chop($ip = /sbin/ifconfig ppp0 | /bin/grep inet | /usr/bin/cut -f2 -d: | /usr/bin/cut -c1-15) &&
   $ip =~ s/\s+//g

but first i try to get it to work by hand - and that's still a problem..
maybe you can help me again:

my LAN has the IP range 192.168.0.1-254 on eth0 100 Mbit NIC
my Internet has dynIP (rigt now it's 212.185.245.35) on eth1 10 Mbit NIC
(which is used by ppp0)

i'd like to have full download speed (768 kbit)
on the upload side ideally i would like to have for ssh and http together 20 kbit left.. (of 128 kbit upload rate)

i have now a file /etc/sysconfig/cbq-eth0:

DEVICE=eth0,100Mbit,10Mbit
RATE=128Kbit
WEIGHT=5Kbit
PRIO=5
RULE=192.168.0.0/24,

which is definitely wrong ;)

the file for download seems right to me:

/etc/sysconfig/cbq-eth1:

DEVICE=eth1,10Mbit,1Mbit
RATE=768Kbit
WEIGHT=768Kbit
PRIO=5
RULE=212.185.245.35

in the end, a cbq start brings

**CBQ: can't discover eth0 bandwidth or weight.
**CBQ: Setup DEVICE field!

what's wrong?

PAT