Skip to contentSkip to conversation

Script problem

LARTC Alexandru Coseru 3 participants 7 messages May 4, 2003 – May 5, 2003

lore
Share & tools
lore
#0 lore raw

Can somebody tell me what's wrong in this script? I'm a begginer in traffic shaping and I can't figure it out

#!/bin/sh

DEV="dev eth1"

tc qdisc del $DEV root
tc qdisc add $DEV root handle 10: prio
tc qdisc add $DEV parent 10:1 handle 20: est 1sec 8sec bfifo
tc qdisc add $DEV parent 10:2 handle 30: est 1sec 8sec bfifo
tc qdisc add $DEV parent 10:3 handle 40: est 1sec 8sec bfifo

tc filter add $DEV parent 10: protocol ip prio 1 u32 match ip tos 0x10 0xff flowid 10:1
tc filter add $DEV parent 10: protocol ip prio 1 u32 match ip tos 0x06 0xff flowid 10:2
tc filter add $DEV parent 10: protocol ip prio 1 u32 match ip tos 0x0c 0xff flowid 10:3

Thanks a lot alexCOS

#1 lore raw
Quoted 2 lines · Alexandru Coseru

Can somebody tell me what's wrong in this script? I'm a begginer in
traffic shaping and I can't figure it out

But what's the problem? Is it not working? Do you get any errors if you execute this script?

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw
In reply to Alexandru Coseru

Yes.. this is the error part:

[root@alexcos root]# tc qdisc del dev eth1 root
[root@alexcos root]# tc qdisc add dev eth1 root handle 10: prio [root@alexcos root]# tc qdisc add dev eth1 parent 10:1 handle 20:est 1sec 8 sec bfifo
Unknown qdisc "1sec", hence option "8" is unparsable [root@alexcos root]# tc qdisc add dev eth1 parent 10:1 handle 20:est 1 sec 8 sec bfifo
Unknown qdisc "1", hence option "sec" is unparsable

Full source script:

tc qdisc del $DEV root
tc qdisc add $DEV root handle 10: prio
tc qdisc add $DEV parent 10:1 handle 20: est 1sec 8sec bfifo
tc qdisc add $DEV parent 10:2 handle 30: est 1sec 8sec bfifo
tc qdisc add $DEV parent 10:3 handle 40: est 1sec 8sec bfifo

tc filter add $DEV parent 10: protocol ip prio 1 u32 match ip tos 0x10 0xff flowid 10:1
tc filter add $DEV parent 10: protocol ip prio 1 u32 match ip tos 0x06 0xff flowid 10:2
tc filter add $DEV parent 10: protocol ip prio 1 u32 match ip tos 0x0c 0xff flowid 10:3

----- Original Message -----
From: "Stef Coene" <[email protected]>
To: "Alexandru Coseru" <[email protected]>; <[email protected]>
Sent: Monday, May 05, 2003 10:49 AM
Subject: Re: [LARTC] Script problem

Quoted 6 lines · Alexandru Coseru
Quoted 2 lines

Can somebody tell me what's wrong in this script? I'm a begginer in
traffic shaping and I can't figure it out

But what's the problem? Is it not working? Do you get any errors if you execute this script?

Quoted 9 lines

Stef

--

[email protected]
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#3 lore raw
In reply to Alexandru Coseru
Quoted 11 lines · Alexandru Coseru

Yes.. this is the error part:

[root@alexcos root]# tc qdisc del dev eth1 root
[root@alexcos root]# tc qdisc add dev eth1 root handle 10: prio [root@alexcos root]# tc qdisc add dev eth1 parent 10:1 handle 20:est 1sec 8 sec bfifo
Unknown qdisc "1sec", hence option "8" is unparsable [root@alexcos root]# tc qdisc add dev eth1 parent 10:1 handle 20:est 1 sec 8 sec bfifo
Unknown qdisc "1", hence option "sec" is unparsable

I don't know the syntac for the bfifo qdisc. But what if you simple remove some parameters :
tc qdisc add dev eth1 parent 10:1 handle 20: bfifo

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#4 lore raw
In reply to Alexandru Coseru

it worked... thanks..

I'm gonna test it later to see if it really works & shapes the traffic..

One more question though ...

Can I add more than 3 (three) bands ?

Like:

tc qdisc add dev eth1 parent 10:1 handle 20:bfifo tc qdisc add dev eth1 parent 10:2 handle 30:bfifo tc qdisc add dev eth1 parent 10:3 handle 40:bfifo tc qdisc add dev eth1 parent 10:4 handle 50:bfifo

of course , i get an error at the last line... but can I do it in another way ?

Thanks

Alex
----- Original Message -----
From: "Stef Coene" <[email protected]>
To: "Alexandru Coseru" <[email protected]>
Cc: <[email protected]>
Sent: Monday, May 05, 2003 10:08 PM
Subject: Re: [LARTC] Script problem

Quoted 7 lines · Alexandru Coseru
Quoted 6 lines

Yes.. this is the error part:

[root@alexcos root]# tc qdisc del dev eth1 root [root@alexcos root]# tc qdisc add dev eth1 root handle 10: prio [root@alexcos root]# tc qdisc add dev eth1 parent 10:1 handle 20:est

1sec 8

Quoted 3 lines
Quoted 3 lines

sec bfifo
Unknown qdisc "1sec", hence option "8" is unparsable [root@alexcos root]# tc qdisc add dev eth1 parent 10:1 handle 20:est 1

sec

Quoted 3 lines
Quoted 2 lines

8 sec bfifo
Unknown qdisc "1", hence option "sec" is unparsable

I don't know the syntac for the bfifo qdisc. But what if you simple

remove

Quoted 4 lines

some parameters :
tc qdisc add dev eth1 parent 10:1 handle 20: bfifo

Quoted 10 lines

Stef

--

[email protected]
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#5 lore raw
In reply to Alexandru Coseru
Quoted 12 lines · Alexandru Coseru

it worked... thanks..

I'm gonna test it later to see if it really works & shapes the traffic..

One more question though ...

Can I add more than 3 (three) bands ?

Like:

Quoted 8 lines

tc qdisc add dev eth1 parent 10:1 handle 20:bfifo tc qdisc add dev eth1 parent 10:2 handle 30:bfifo tc qdisc add dev eth1 parent 10:3 handle 40:bfifo tc qdisc add dev eth1 parent 10:4 handle 50:bfifo

of course , i get an error at the last line... but can I do it in another way ?

Isn't there an option if you add the prio qdisc to specify the number of bands?

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#6 lore raw
In reply to Alexandru Coseru

Hello,

: > One more question though ...
: > Can I add more than 3 (three) bands ?
: > of course , i get an error at the last line... but can I do it in another : > way ?
: Isn't there an option if you add the prio qdisc to specify the number of : bands?

Yes.

http://lartc.org/howto/lartc.qdisc.classful.html#AEN886

<snipped>

9.5.3.1. PRIO parameters & usage

The following parameters are recognized by tc:

bands

Number of bands to create. Each band is in fact a class. If you change this number, you must also change:

</snipped>

-Martin

Signature · 5 lines
Martin A. Brown --- SecurePipe, Inc. --- [email protected]

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/