View previous topic :: View next topic |
Author |
Message |
keschrich n00b

Joined: 09 Apr 2002 Posts: 69 Location: Branford, CT
|
Posted: Tue Dec 17, 2002 4:23 pm Post subject: iproute2/QoS for network service prioritizing |
|
|
I'm setting up a dsl router at my fraternity house, and wish to configure it so that services such as http and ssh will not be affected much by people running kazaa, etc.
Looking at an example in the Linux Advanced Routing & Traffic Control HOWTO that seems to match my needs, it tells me to execute the following commands to start:
Code: |
CEIL=240
tc qdisc add dev eth0 root handle 1: htb default 15
tc class add dev eth0 parent 1: classid 1:1 htb rate ${CEIL}kbit ceil ${CEIL}kbit
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 80kbit ceil 80kbit prio 0
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 80kbit ceil ${CEIL}kbit prio 1
tc class add dev eth0 parent 1:1 classid 1:12 htb rate
20kbit ceil ${CEIL}kbit prio 2
tc class add dev eth0 parent 1:1 classid 1:13 htb rate
20kbit ceil ${CEIL}kbit prio 2
tc class add dev eth0 parent 1:1 classid 1:14 htb rate
10kbit ceil ${CEIL}kbit prio 3
tc class add dev eth0 parent 1:1 classid 1:15 htb rate
30kbit ceil ${CEIL}kbit prio 3
tc qdisc add dev eth0 parent 1:12 handle 120: sfq pertu
rb 10
tc qdisc add dev eth0 parent 1:13 handle 130: sfq pertu
rb 10
tc qdisc add dev eth0 parent 1:14 handle 140: sfq pertu
rb 10
tc qdisc add dev eth0 parent 1:15 handle 150: sfq pertu
rb 10
|
my CEIL is different, as well as the rates, but that doesn't make a difference. On executing the second command, I get the following error:
Quote: | RTNETLINK answers: Invalid argument |
I compiled my kernel with everything in the QoS section built as modules, and after running the command I notice that "sch_htb" was loaded..
If anybody has any suggestions as to why this isn't working, I would greatly appreciate it. |
|
Back to top |
|
 |
sputnik1969 Guru


Joined: 08 Aug 2002 Posts: 401 Location: Berlin / Germany
|
Posted: Tue Dec 17, 2002 4:50 pm Post subject: |
|
|
Try another Version of tc, i've tried multiple versions until i got it to run... _________________ 'Cynic' is a word invented by optimists to criticize realists. - Nigel. In the ocean of Night by Gregory Benford
"Zyniker" ist ein Wort das Optimisten erfunden haben um Realisten zu kritisieren. - Nigel. Im Meer der Nacht von Gregory Benford |
|
Back to top |
|
 |
Gaidin n00b

Joined: 18 Apr 2002 Posts: 9
|
Posted: Tue Dec 17, 2002 5:53 pm Post subject: |
|
|
To get HTB queues to work you must use a patched kernel (or one of the newest ones I think) AND a patched tc from the iproute2 toolkit. If you go to the HTB homepage they have all the info. However I think the Gentoo sources have the HTB patch applied already, and possibly even the Gentoo iproute2 package is patched.
I had a lot of problems getting HTB to work so I just settled for CBQ, until I updated to the newest gentoo sources and iproute2 and my HTB script magically started working.
I'd highly suggest taking a look at the HTB sample script the HOWTO at www.lartc.org has. That's basically what I'm using right now and SSH and RDP traffic in to my cable modem is highly responsive even though 90% of the link is saturated most of the time. |
|
Back to top |
|
 |
dreamer3 Guru

Joined: 24 Sep 2002 Posts: 553
|
Posted: Mon Jan 06, 2003 10:41 am Post subject: |
|
|
Gaidin wrote: | I had a lot of problems getting HTB to work so I just settled for CBQ, until I updated to the newest gentoo sources and iproute2 and my HTB script magically started working.  |
Is it still working?
I'm using the latest gentoo-sources-2.4.19-r10, and the latest iproute available in portage, but I'm getting version conflict errors in my syslog. It's driving me nuts. |
|
Back to top |
|
 |
Gaidin n00b

Joined: 18 Apr 2002 Posts: 9
|
Posted: Tue Jan 14, 2003 4:31 am Post subject: |
|
|
<sigh>
I just reinstalled my Gentoo box this evening for the first time in months to get it up to 1.4x, and of course my HTB is now broken.
I'm using the newest gentoo-sources(r10) and the newest iproute in portage as of 1/13/03. I'm going to go grab the patched tc from the htb site and see if that fixes it.
Gaidin
EDIT: After downloading the newest htb from http://luxik.cdi.cz/~devik/qos/htb/v3/htb3.6-020525.tgz and replacing the /usb/sbin/tc binary, HTB works with the gentoo-sources 2.4.19-r10!  |
|
Back to top |
|
 |
amne Bodhisattva


Joined: 17 Nov 2002 Posts: 6378 Location: Graz / EU
|
Posted: Tue Jan 14, 2003 9:19 am Post subject: |
|
|
afaik htb works without patching since linux-2.4.20rcX (X=2 iirc) (vanilla sources). i'm also using version the version of tc that Gaidin postet above, works fine. the only trouble i had was selecting all the necessary options, i ended up in setting quite everything in the Qos menu of make menuconfig and all that seemed reasonable in network to [*]. now my kernel won't fit on any floppy, but it works . i can make available the .config if someone needs it really hard, this is just not possible at the moment as the admins of "my" server just install debian (*g* no flamewar please) there
regards,
amne |
|
Back to top |
|
 |
Chris Finch Tux's lil' helper


Joined: 10 Mar 2003 Posts: 106 Location: Darmstadt, Germany
|
Posted: Thu Mar 13, 2003 2:19 pm Post subject: |
|
|
I'd like to share my experience:
as to the kernel:
I use the linux-2.4.20-gentoo-r1 kernel. In the configuration of QoS features I enabled `QoS and/or fair queing', `HTB packet scheduler' and everything from `The simplest PRIO scheduler' downwards. It is necessary to enable `Network packet filtering (replaces ipchains)' one menu above in order to be able to choose `ingress' in the QoS menu. Everything is in the kernel, directly, I didn't use modules.
as to tc:
I emerged sys-apps/iproute/iproute-20010824-r1.ebuild, as the r2 didn't work for me (it gave the RTNETLINK answers: Invalid argument error). Mind that tc is installed in /usr/sbin/ as opposed to /sbin, so whichever shaping script you use you may want to give tc the correct path in it.
the shaping script I use is wshaper.htb.
It works nicely, so far. I am able to surf and type this even though mldonkey is running. I wasn't able to do that, before. Also, the fetchmail demon is working now and doesn't get stuck in the traffic.
Cheers,
Finchy |
|
Back to top |
|
 |
Auka Tux's lil' helper


Joined: 01 Jul 2002 Posts: 110 Location: Germany
|
Posted: Thu Mar 13, 2003 4:25 pm Post subject: |
|
|
I was just about to setup HTB QoS on my Gentoo box (based on this script by the german magazine c't if anyone is interested) and I was having exactly the same problem with the current iproute package.
Downgrading to r1 helped and everything works fine now. Thanks a lot for your tip!
BTW there also is a bugreport regarding this issue. Strange enough: though this bug has already been opened on 2002-12-26 and a fix has been provided it is still open... :-/ |
|
Back to top |
|
 |
Chris Finch Tux's lil' helper


Joined: 10 Mar 2003 Posts: 106 Location: Darmstadt, Germany
|
Posted: Thu Mar 13, 2003 8:15 pm Post subject: |
|
|
Hello,
I have just made a (completely mindless) adaption of the wonder shaper script for htb to the gentoo startup system. Code follows:
Code: |
#!/sbin/runscript
# Wonder Shaper, adapted to gentoo startup system
# please read the README before filling out these values
#
# Set the following values to somewhat less than your actual download
# and uplink speed. In kilobits. Also set the device that is to be shaped.
# configuration should really go into /etc/conf.d, but well...
# I have just randomly picked the following numbers (a bit below maximal throughput),
# they are definitely not the result of long term experience
DOWNLINK=735
UPLINK=120
DEV=eth0
# low priority OUTGOING traffic - you can leave this blank if you want
# low priority source netmasks
NOPRIOHOSTSRC=
# low priority destination netmasks
NOPRIOHOSTDST=
# first port is for mldonkey, second for gnutella
# low priority source ports
NOPRIOPORTSRC="4662 6346"
# low priority destination ports
NOPRIOPORTDST="4662 6346"
depend() {
need net
}
start() {
ebegin "Starting Traffic Shaping"
# clean existing down- and uplink qdiscs, hide errors
/usr/sbin/tc qdisc del dev $DEV root 2> /dev/null > /dev/null
/usr/sbin/tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null
###### uplink
# install root HTB, point default traffic to 1:20:
/usr/sbin/tc qdisc add dev $DEV root handle 1: htb default 20
# shape everything at $UPLINK speed - this prevents huge queues in your
# DSL modem which destroy latency:
/usr/sbin/tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst 6k
# high prio class 1:10:
/usr/sbin/tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit \
burst 6k prio 1
# bulk & default class 1:20 - gets slightly less traffic,
# and a lower priority:
/usr/sbin/tc class add dev $DEV parent 1:1 classid 1:20 htb rate $[9*$UPLINK/10]kbit \
burst 6k prio 2
/usr/sbin/tc class add dev $DEV parent 1:1 classid 1:30 htb rate $[8*$UPLINK/10]kbit \
burst 6k prio 2
# all get Stochastic Fairness:
/usr/sbin/tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
/usr/sbin/tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
/usr/sbin/tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
# TOS Minimum Delay (ssh, NOT scp) in 1:10:
/usr/sbin/tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
match ip tos 0x10 0xff flowid 1:10
# ICMP (ip protocol 1) in the interactive class 1:10 so we
# can do measurements & impress our friends:
/usr/sbin/tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
match ip protocol 1 0xff flowid 1:10
# To speed up downloads while an upload is going on, put ACK packets in
# the interactive class:
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 10 u32 \
match ip protocol 6 0xff \
match u8 0x05 0x0f at 0 \
match u16 0x0000 0xffc0 at 2 \
match u8 0x10 0xff at 33 \
flowid 1:10
# rest is 'non-interactive' ie 'bulk' and ends up in 1:20
# some traffic however suffers a worse fate
for a in $NOPRIOPORTDST
do
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 14 u32 \
match ip dport $a 0xffff flowid 1:30
done
for a in $NOPRIOPORTSRC
do
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 15 u32 \
match ip sport $a 0xffff flowid 1:30
done
for a in $NOPRIOHOSTSRC
do
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
match ip src $a flowid 1:30
done
for a in $NOPRIOHOSTDST
do
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 17 u32 \
match ip dst $a flowid 1:30
done
# rest is 'non-interactive' ie 'bulk' and ends up in 1:20
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 18 u32 \
match ip dst 0.0.0.0/0 flowid 1:20
########## downlink #############
# slow downloads down to somewhat less than the real speed to prevent
# queuing at our ISP. Tune to see how high you can set it.
# ISPs tend to have *huge* queues to make sure big downloads are fast
#
# attach ingress policer:
/usr/sbin/tc qdisc add dev $DEV handle ffff: ingress
# filter *everything* to it (0.0.0.0/0), drop everything that's
# coming in too fast:
/usr/sbin/tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1
eend $? "Failed to start Traffic Shaping"
eend $? "Failed to start Traffic Shaping"
}
stop() {
ebegin "Stopping Traffic Shaping"
# clean existing down- and uplink qdiscs, hide errors
/usr/sbin/tc qdisc del dev $DEV root 2> /dev/null > /dev/null
/usr/sbin/tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null
eend $? "Failed to stop Traffic Shaping"
}
|
It is assumed that you are connected to the internet via a network interface called eth0 and that your bandwidth equals 768/128. If you copy the above code into a file called, say, wshaper which you place in /etc/init.d and if afterwards you issue the command
Code: | rc-update add wshaper default |
then traffic shaping is automatically activated at startup.
Note that I am a complete newbie, particularly regarding anything to do with networking, so better have a look at the code before you use it. If you have any suggestions, I'd very much appreciate if you posted them.
Best,
Peter |
|
Back to top |
|
 |
Crg Guru


Joined: 29 May 2002 Posts: 345 Location: London
|
Posted: Fri Mar 14, 2003 1:17 am Post subject: |
|
|
Chris Finch wrote: | Hello,
Code: |
# first port is for mldonkey, second for gnutella
# low priority source ports
NOPRIOPORTSRC="4662 6346"
# low priority destination ports
NOPRIOPORTDST="4662 6346"
# some traffic however suffers a worse fate
for a in $NOPRIOPORTDST
do
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 14 u32 \
match ip dport $a 0xffff flowid 1:30
done
|
If you have any suggestions, I'd very much appreciate if you posted them.
|
The issue I see with this type of script is it relies on you knowing what port/s bandwidth hoggers will be on and putting them in a lower priority queue, with everything else caught by a higher priority queue.
With p2p applications you don't always know what port they will be on and they tend to hog the most bandwidth.
I find its better to approach it from the other way - ie specifically put traffic you do know the ports of and want response out of (http, mail, etc) in the higher priority queue - then let the lower priority queue catch everything else.
ie something like this: (and I haven't run this particular one so it may contain mistakes)
Code: |
#!/sbin/runscript
# Wonder Shaper, adapted to gentoo startup system
# please read the README before filling out these values
#
# Set the following values to somewhat less than your actual download
# and uplink speed. In kilobits. Also set the device that is to be shaped.
# configuration should really go into /etc/conf.d, but well...
# I have just randomly picked the following numbers (a bit below maximal throughput),
# they are definitely not the result of long term experience
DOWNLINK=735
UPLINK=120
DEV=eth0
# low priority OUTGOING traffic - you can leave this blank if you want
# low priority source netmasks
NOPRIOHOSTSRC=
# low priority destination netmasks
NOPRIOHOSTDST=
# normal priority source ports
NOMPRIOPORTS="80 443 25 110"
depend() {
need net
}
start() {
ebegin "Starting Traffic Shaping"
# clean existing down- and uplink qdiscs, hide errors
/usr/sbin/tc qdisc del dev $DEV root 2> /dev/null > /dev/null
/usr/sbin/tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null
###### uplink
# install root HTB, point default traffic to 1:20:
/usr/sbin/tc qdisc add dev $DEV root handle 1: htb default 20
# shape everything at $UPLINK speed - this prevents huge queues in your
# DSL modem which destroy latency:
/usr/sbin/tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst 6k
# high prio class 1:10:
/usr/sbin/tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit \
burst 6k prio 1
# bulk & normal class 1:20 - gets slightly less traffic,
# and a lower priority:
/usr/sbin/tc class add dev $DEV parent 1:1 classid 1:20 htb rate $[9*$UPLINK/10]kbit \
burst 6k prio 2
# Hoggers and default.
/usr/sbin/tc class add dev $DEV parent 1:1 classid 1:30 htb rate $[8*$UPLINK/10]kbit \
burst 6k prio 2
# all get Stochastic Fairness:
/usr/sbin/tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
/usr/sbin/tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
/usr/sbin/tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
# TOS Minimum Delay (ssh, NOT scp) in 1:10:
/usr/sbin/tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
match ip tos 0x10 0xff flowid 1:10
# ICMP (ip protocol 1) in the interactive class 1:10 so we
# can do measurements & impress our friends:
/usr/sbin/tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
match ip protocol 1 0xff flowid 1:10
# To speed up downloads while an upload is going on, put ACK packets in
# the interactive class:
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 10 u32 \
match ip protocol 6 0xff \
match u8 0x05 0x0f at 0 \
match u16 0x0000 0xffc0 at 2 \
match u8 0x10 0xff at 33 \
flowid 1:10
# add "normal" traffic to 1:20
for a in $NOMPRIOPORTS
do
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 14 u32 \
match ip dport $a 0xffff flowid 1:20
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 15 u32 \
match ip sport $a 0xffff flowid 1:20
done
for a in $NOPRIOHOSTSRC
do
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
match ip src $a flowid 1:30
done
for a in $NOPRIOHOSTDST
do
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 17 u32 \
match ip dst $a flowid 1:30
done
# rest is 'unclassified' traffic, p2p etc..
/usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 18 u32 \
match ip dst 0.0.0.0/0 flowid 1:30
########## downlink #############
# slow downloads down to somewhat less than the real speed to prevent
# queuing at our ISP. Tune to see how high you can set it.
# ISPs tend to have *huge* queues to make sure big downloads are fast
#
# attach ingress policer:
/usr/sbin/tc qdisc add dev $DEV handle ffff: ingress
# filter *everything* to it (0.0.0.0/0), drop everything that's
# coming in too fast:
/usr/sbin/tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1
eend $? "Failed to start Traffic Shaping"
eend $? "Failed to start Traffic Shaping"
}
stop() {
ebegin "Stopping Traffic Shaping"
# clean existing down- and uplink qdiscs, hide errors
/usr/sbin/tc qdisc del dev $DEV root 2> /dev/null > /dev/null
/usr/sbin/tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null
eend $? "Failed to stop Traffic Shaping"
}
| [/quote] |
|
Back to top |
|
 |
Forse Apprentice


Joined: 26 Dec 2002 Posts: 260 Location: /dev/random
|
Posted: Mon May 12, 2003 9:32 pm Post subject: |
|
|
Hi folks Crg I am trying to run your script and I get a lot of these:
Code: | /sbin/runscript.sh: line 69: : command not found
/sbin/runscript.sh: line 71: : command not found
/sbin/runscript.sh: line 73: : command not found
/sbin/runscript.sh: line 74: : command not found
/sbin/runscript.sh: line 76: : command not found
/sbin/runscript.sh: line 77: : command not found
/sbin/runscript.sh: line 78: : command not found
/sbin/runscript.sh: line 79: : command not found
/sbin/runscript.sh: line 81: : command not found
/sbin/runscript.sh: line 82: : command not found
/sbin/runscript.sh: line 84: : command not found
/sbin/runscript.sh: line 85: : command not found
/sbin/runscript.sh: line 86: : command not found
/sbin/runscript.sh: line 87: : command not found
/sbin/runscript.sh: line 88: : command not found
/sbin/runscript.sh: line 89: : command not found
/sbin/runscript.sh: line 91: : command not found
/sbin/runscript.sh: line 92: : command not found
/sbin/runscript.sh: line 93: : command not found
/sbin/runscript.sh: line 94: : command not found
/sbin/runscript.sh: line 95: : command not found
/sbin/runscript.sh: line 96: : command not found
/sbin/runscript.sh: line 97: : command not found
/sbin/runscript.sh: line 98: : command not found
/sbin/runscript.sh: line 100: : command not found
/sbin/runscript.sh: line 101: : command not found
/sbin/runscript.sh: line 102: : command not found
/sbin/runscript.sh: line 103: : command not found
/sbin/runscript.sh: line 104: : command not found
/sbin/runscript.sh: line 106: : command not found
/sbin/runscript.sh: line 107: : command not found
/sbin/runscript.sh: line 108: : command not found
/sbin/runscript.sh: line 109: : command not found
/sbin/runscript.sh: line 110: : command not found
/sbin/runscript.sh: line 112: : command not found
/sbin/runscript.sh: line 114: : command not found
/sbin/runscript.sh: line 115: : command not found
/sbin/runscript.sh: line 118: : command not found
/sbin/runscript.sh: line 119: : command not found
/sbin/runscript.sh: line 120: : command not found
/sbin/runscript.sh: line 121: : command not found
/sbin/runscript.sh: line 122: : command not found
/sbin/runscript.sh: line 123: : command not found
/sbin/runscript.sh: line 125: : command not found
/sbin/runscript.sh: line 127: : command not found
/sbin/runscript.sh: line 128: : command not found
/sbin/runscript.sh: line 130: : command not found
/sbin/runscript.sh: line 131: : command not found
/sbin/runscript.sh: line 132: : command not found
/sbin/runscript.sh: line 134: : command not found |
_________________ [ My sites ]: UnixTutorials : AniFIND : AnimeYume |
|
Back to top |
|
 |
dreamer3 Guru

Joined: 24 Sep 2002 Posts: 553
|
Posted: Wed May 14, 2003 3:18 am Post subject: |
|
|
Forse wrote: | Hi folks Crg I am trying to run your script and I get a lot of these:
Code: | /sbin/runscript.sh: line 69: : command not found
|
|
A forum layout/cut-and-paste problem... make sure all the / are at the END of the previous line, not the next line... cutting and pasting with a different browser might help as well, not sure though. |
|
Back to top |
|
 |
Forse Apprentice


Joined: 26 Dec 2002 Posts: 260 Location: /dev/random
|
Posted: Wed May 14, 2003 2:25 pm Post subject: damn |
|
|
Damn...I still can't get script to work Now I have pasted it correctly, but it still doesn't work. Here is what I get:
Code: | [root@homer [pts/1] ./QoS start
* Starting Traffic Shaping...
RTNETLINK answers: Invalid argument
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
* Failed to start Traffic Shaping [ !! ]
* Failed to start Traffic Shaping |
Plz any ideas...I really like this script  _________________ [ My sites ]: UnixTutorials : AniFIND : AnimeYume |
|
Back to top |
|
 |
dreamer3 Guru

Joined: 24 Sep 2002 Posts: 553
|
Posted: Fri May 16, 2003 4:26 am Post subject: Re: damn |
|
|
The Invalid Argument argument may because you haven't compiled all the networking features you're trying to use into your kerenl... Sorry, but I really don' t have any time to look or go any deeper than that. Just a direction, maybe someone else can elaborate.
Forse wrote: | Damn...I still can't get script to work Now I have pasted it correctly, but it still doesn't work. Here is what I get:
Code: | [root@homer [pts/1] ./QoS start
* Starting Traffic Shaping...
RTNETLINK answers: Invalid argument
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
* Failed to start Traffic Shaping [ !! ]
* Failed to start Traffic Shaping |
Plz any ideas...I really like this script  |
|
|
Back to top |
|
 |
sputnik1969 Guru


Joined: 08 Aug 2002 Posts: 401 Location: Berlin / Germany
|
Posted: Wed May 21, 2003 2:39 am Post subject: |
|
|
Try iproute-20010824-r1
I experienced the same problem after updating to r2 or r3... _________________ 'Cynic' is a word invented by optimists to criticize realists. - Nigel. In the ocean of Night by Gregory Benford
"Zyniker" ist ein Wort das Optimisten erfunden haben um Realisten zu kritisieren. - Nigel. Im Meer der Nacht von Gregory Benford |
|
Back to top |
|
 |
segflaunt Tux's lil' helper


Joined: 22 May 2003 Posts: 101
|
Posted: Tue Jun 03, 2003 12:20 am Post subject: I read the thread, but I still have a question |
|
|
I have the following stuff,
gentoo-sources-2.4.20-r5
iproute-20010824-r1
and "ip rule list" fails with
RTNETLINK answers: Invalid argument
Dump terminated
My kernel QoS stuff is modules. Does this make a difference? |
|
Back to top |
|
 |
Forse Apprentice


Joined: 26 Dec 2002 Posts: 260 Location: /dev/random
|
Posted: Tue Jun 03, 2003 10:03 am Post subject: |
|
|
ok...I tried diff iproute and I compiled ALL the QoS staff into kernel. Now script doesn't return much errors....only two. After doing some debugging I found out which lines coz problem:
Code: | /usr/sbin/tc filter add dev $DEV parent 1: protocol ip prio 10 u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x10 0xff at 33 flowid 1:10 |
And this:
Code: | /usr/sbin/tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1 |
I get this while trying to start the script:
Code: | [root@homer [pts/1] ./QoS start
* Starting Traffic Shaping...
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
* Failed to start Traffic Shaping [ !! ]
* Failed to start Traffic Shaping |
Any ideas? Thnx in advance _________________ [ My sites ]: UnixTutorials : AniFIND : AnimeYume |
|
Back to top |
|
 |
segflaunt Tux's lil' helper


Joined: 22 May 2003 Posts: 101
|
Posted: Tue Jun 03, 2003 4:12 pm Post subject: |
|
|
In your kernel config, check that you have
CONFIG_NETLINK_DEV=y
and
CONFIG_IP_ADVANCED_ROUTER=y
Thanks to Juri Haberland <juri@koschikode.com> for that little piece of advice.
Quote: |
I get this while trying to start the script:
Code: | [root@homer [pts/1] ./QoS start
* Starting Traffic Shaping...
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
* Failed to start Traffic Shaping [ !! ]
* Failed to start Traffic Shaping |
Any ideas? Thnx in advance |
|
|
Back to top |
|
 |
Forse Apprentice


Joined: 26 Dec 2002 Posts: 260 Location: /dev/random
|
Posted: Tue Jun 03, 2003 9:02 pm Post subject: |
|
|
Dammit....I still can't get it to work. Thnx a lot for helping
Code: |
<*> Netlink device emulation
...
...
...
[*] IP: advanced router
[ ] IP: policy routing (NEW)
[ ] IP: equal cost multipath (NEW)
[ ] IP: use TOS value as routing key (NEW)
[ ] IP: verbose route monitoring (NEW)
[ ] IP: large routing tables (NEW)
...
...
...
[*] QoS and/or fair queueing
<*> CBQ packet scheduler
<*> HTB packet scheduler
<*> CSZ packet scheduler
<*> The simplest PRIO pseudoscheduler
<*> RED queue
<*> SFQ queue
<*> TEQL queue
<*> TBF queue
<*> GRED queue
<*> Diffserv field marker
< > Ingress Qdisc
[*] QoS support
[*] Rate estimator
[*] Packet classifier API
<*> TC index classifier
<*> Routing table based classifier
<*> Firewall based classifier
<*> U32 classifier
<*> Special RSVP classifier
< > Special RSVP classifier for IPv6
[*] Traffic policing (needed for in/egress) |
Again thnx a lot for help _________________ [ My sites ]: UnixTutorials : AniFIND : AnimeYume |
|
Back to top |
|
 |
Crg Guru


Joined: 29 May 2002 Posts: 345 Location: London
|
Posted: Wed Jun 04, 2003 10:03 am Post subject: |
|
|
Forse wrote: | Dammit....I still can't get it to work. Thnx a lot for helping
|
The options I use are:
Code: |
[*] QoS and/or fair queueing
< > CBQ packet scheduler
<*> HTB packet scheduler
< > CSZ packet scheduler
[ ] ATM pseudo-scheduler
< > The simplest PRIO pseudoscheduler
< > RED queue
<*> SFQ queue
< > TEQL queue
< > TBF queue
< > GRED queue
< > Diffserv field marker
<*> Ingress Qdisc
[*] QoS support
[*] Rate estimator
[*] Packet classifier API
< > TC index classifier
< > Routing table based classifier
< > Firewall based classifier
<*> U32 classifier
< > Special RSVP classifier
< > Special RSVP classifier for IPv6
[*] Traffic policing (needed for in/egress)
|
|
|
Back to top |
|
 |
AlterEgo Veteran


Joined: 25 Apr 2002 Posts: 1619
|
Posted: Wed Jun 04, 2003 2:57 pm Post subject: |
|
|
Has anyone had any luck getting tc/htb to work on a 2.5 kernel?
If yes -> how ? |
|
Back to top |
|
 |
Forse Apprentice


Joined: 26 Dec 2002 Posts: 260 Location: /dev/random
|
Posted: Wed Jun 04, 2003 8:58 pm Post subject: |
|
|
Crg thank you a lot. It finally works...I just wanted others to know that:
is very important and after I builded it into kernel....WOW it worked  _________________ [ My sites ]: UnixTutorials : AniFIND : AnimeYume |
|
Back to top |
|
 |
segflaunt Tux's lil' helper


Joined: 22 May 2003 Posts: 101
|
Posted: Tue Jun 10, 2003 9:33 pm Post subject: |
|
|
AlterEgo wrote: | Has anyone had any luck getting tc/htb to work on a 2.5 kernel?
If yes -> how ? |
You have to compile netfilter from cvs. Maybe also good to compile iproute against the beta kernel sources. |
|
Back to top |
|
 |
AlterEgo Veteran


Joined: 25 Apr 2002 Posts: 1619
|
Posted: Wed Jun 11, 2003 7:17 am Post subject: |
|
|
segflaunt wrote: | AlterEgo wrote: | Has anyone had any luck getting tc/htb to work on a 2.5 kernel?
If yes -> how ? |
You have to compile netfilter from cvs. Maybe also good to compile iproute against the beta kernel sources. |
Netfilter is not the problem. Compiling iproute seems impossible. It stops with a lot of errors referencing the kernel source:
https://forums.gentoo.org/viewtopic.php?t=50114&highlight=iproute |
|
Back to top |
|
 |
mikeraach Apprentice


Joined: 20 Jan 2003 Posts: 168
|
Posted: Fri Jun 13, 2003 5:29 am Post subject: |
|
|
segflaunt, I'm having the same problem as you.
Gentoo-sources 2.4.20-rc5, iproute 20010824-r1, and I get the error:
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
Everything in QoS is compiled in (not as modules) and I even make my .config has the folling:
CONFIG_NETLINK_DEV=y
and
CONFIG_IP_ADVANCED_ROUTER=y
What could be the problem? |
|
Back to top |
|
 |
|