A million thanks Styno, I will try this inmediatly and will post later with the results.
Printable View
A million thanks Styno, I will try this inmediatly and will post later with the results.
For all the Linux starters like me, I would like to share a nice vi guide. I still find vi very scary but hope that with the help of this guide I can acomplish the basic edition tasks related to Wondershaper.
http://www.gentoo.org/doc/en/vi-guide.xml
I hope it helps you too.
I have done it, but the results were not what I was expecting. I have upgraded FW, add the speed fix (100full) to post-boot and reconfigured my router again with the security settings and other things from the web interface.Quote:
Originally Posted by Styno
I have used the exact command line that you wrote for testing Wshaper and I was very sorprised to see that the shaper was affecting ALL the traffic, not only bittorrent (port 54321). I have tested downloading 4 torrents and at the same time downloading from a web server that by itself I know it can fill all my bandwidth (256KB/s down or 2048kbps). I was checking the traffic monitor in taskmanager and saw that with an activated test shape that I was using (1000 100) I was using only little over half of my bandwidth. After stoping Wshaper from telnet inmediatly I could see how my bandwidth was totally used specially by the single HTTP download. This was not exactly the result that I was looking for, Wshaper is not effecting only traffic on port 54321, it is shaping all the traffic together.
I have doenloaded a shaper program for Windows XP (Netlimiter) and now I am trying with it. Very nice peace of software. Until I don't find a way to shape only Bittorrent on port 54321 I don't think that Wshaper will be useful for me. Or at least that it shapes all traffic but that let HTTP use almost all the channel and hold bittorrent on 1900 170 or something like that.
Thanks a lot for the help.
The behaviour you describe above is exactly what the default Wondershaper script does. It shapes all traffic and devides bandwith according to the priority of the traffic and the speed parameters.
I'll quote myself:
If the normal priority class (HTTP mostly) requires more bandwith then the low priority class (Bittorrent) will give it. Also, Bittorrent will get 8/10 * 1990 kb/s maximum. Normal priority class will get 9/10 *1990 maximum. When using Wondershaper you will not get the maximum download speed because it reserves speed to be able to get those high priority packets through.Quote:
This way:
- All traffic will get normal priority
- ICMP and SSH will get high priority (ICMP = ping and a number of other important internet tools)
- TCP ports given in the script parameters (Bittorrent in your case) will get low priority, this class will never get full bandwidth though. Even if there's no other traffic.
I suggest you use the '1990 190' parameters. '1000 100' are improper parameters and you should forget the results you got from that test.
Like I've said before: if you feel you're up to it, you can customize the script to your own needs. I've customized it in order to let the bulk priority class vary, depending on the load, between 3/10 and 9/10 of the max. download speed for example.
There are a lot of other shaping strategies possible, some of which will provide better results for you, some will not. The Wondershaper script is essentially an example of what traffic shaping can do. But in the end its up to you and your desicion...
Good luck.
@styno or other people who running ws
can you (or the others) adapt the wiki for the new firmware 1.8.1.7-1, i think there are only changes in file stuctur right?
for a newbie in ws(that i'm), it would be a big help if there is the new structur in.
@all
i've read the whole qos thread and the wiki, but i didn't understand the structur of the script parameters. the only thing i wanted to do is:
to set up my voip ip adapter (IP adresse: 192.168.1.4 in DMZ) to the high priority mode (most important the upload speed).
the other traffic (up and download) should get lower priority.
my connection is adsl (with 786down/128up). firmware on wl500g is 1.8.1.7-1 .
my file post-firewall:
i know that the setting above is not correct for the setting i wish. but i don't understand the parameters. and if i enter "wshaper status eth1" nothing happend.Code:#!/bin/sh
/sbin/wshaper start "$1" 700 100
if someone could help me, it would be nice
thx a lot.
ps: sry for my english ;-)
--edit--
if i enter
wshaper start "$1" 700 100
the following appears:
did i something wrong?Code:Cannot find device "root"
Error: Qdisc "1:" is classless.
Error: Qdisc "1:1" is classless.
Error: Qdisc "1:1" is classless.
Error: Qdisc "1:1" is classless.
Unknown qdisc "1:10", hence option "handle" is unparsable
Unknown qdisc "1:20", hence option "handle" is unparsable
Unknown qdisc "1:30", hence option "handle" is unparsable
Unknown filter "1:0", hence option "protocol" is unparsable
Unknown filter "1:0", hence option "protocol" is unparsable
Unknown filter "1:", hence option "protocol" is unparsable
Unknown filter "1:", hence option "protocol" is unparsable
Unknown qdisc "ffff:", hence option "ingress" is unparsable
Unknown filter "ffff:", hence option "protocol" is unparsable
pls help! ;-)
To run interactively, you will need to replace $1 with your WAN interface name (eth1 for static/dhcp, ppp0 for pppoe/pptp).Quote:
Originally Posted by xlephant
$1 should be used inside post-firewall only.
thx oleg,
do you also know a fast way how i can set up my voip device(192.168.1.4) to the highest priority? and reserve (if its in use) a upload and download speed of 100kb for it.
i'm not a completly idiot, but it is so difficult to understand.
You can put your voice traffic in the low delay queue by adding the following lines in the wshaper scriptQuote:
do you also know a fast way how i can set up my voip device(192.168.1.4) to the highest priority? and reserve (if its in use) a upload and download speed of 100kb for it.
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
match ip src 192.168.1.4 flowid 1:10
Best, you can consider creating a new voice class with high priority and put voice traffic into it. You wshaper script will be something like :
Code:# voice class
tc class add dev $DEV parent 1:1 classid 1:100 htb rate 100kbit \
burst 6k prio 1
# low delay class
tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit \
burst 6k prio 2
# bulk & default class 1:20 - gets slightly less traffic,
# and a lower priority:
tc class add dev $DEV parent 1:1 classid 1:20 htb rate $((9*$UPLINK/10))kbit \
burst 6k prio 3
tc class add dev $DEV parent 1:1 classid 1:30 htb rate $((8*$UPLINK/10))kbit \
burst 6k prio 3
# put voice traffic into high priority class
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
match ip src 192.168.1.4 flowid 1:100
@ark+
thx a lot i will test it tomorrow.
good night to all
can anybody confirm that ingress actualy work at all?
i have tested it with options that make sense to my bandwidth and
default ingress settings from original wshaper
example #1:
### wshaper ###
...
DEV=eth0
DOWNLINK=460
tc qdisc add dev $DEV handle ffff: ingress
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
...
RESULT #1
in that moment 76kbit/s
example #2
### wshaper ###
...
DEV=eth0
DOWNLINK=8
tc qdisc add dev $DEV handle ffff: ingress
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
...
RESULT #2
in that moment 103kbit/s
:confused:
my settings:
FW: 1.7.5.9-5
WL500b with WL500g FW
WAN: eth2
LAN: eth0
NAT (so I am actually shaping my UL with ingress)
shaping dev: eth0
zox
#promenne
MAXDOWN=488 #dowload
MAXUP=82 #upload
IF=eth0 #private device
A=br0 #public device
TC=/sbin/tc
IPTABLES=/sbin/iptables
wshaper start $IF 422 82
wshaper start $A 422 82
#DELETE OLD QUEUES
$TC qdisc del dev $A root
$TC qdisc del dev $IF root
$IPTABLES -t mangle -F FORWARD
#DOWNLOAD
$TC qdisc add dev $IF root handle 1:0 htb
$TC class add dev $IF parent 1:0 classid 1:1 htb rate $MAXDOWN
$TC class add dev $IF parent 1:1 classid 1:11 htb rate 128kbit ceil $MAXDOWN #koma
$TC class add dev $IF parent 1:1 classid 1:12 htb rate 128kbit ceil $MAXDOWN #michal
$TC class add dev $IF parent 1:1 classid 1:13 htb rate 128kbit ceil $MAXDOWN #aaada
$TC class add dev $IF parent 1:1 classid 1:14 htb rate 128kbit ceil $MAXDOWN #viktor
$TC filter add dev $IF protocol ip parent 1:0 prio 1 handle 1 fw flowid 1:11 #koma
$TC filter add dev $IF protocol ip parent 1:0 prio 1 handle 2 fw flowid 1:12 #michal
$TC filter add dev $IF protocol ip parent 1:0 prio 1 handle 3 fw flowid 1:13 #aaada
$TC filter add dev $IF protocol ip parent 1:0 prio 1 handle 4 fw flowid 1:14 #viktor
$IPTABLES -t mangle -A FORWARD -i $IF -d 10.0.0.2 -j MARK --set-mark 1 #koma
$IPTABLES -t mangle -A FORWARD -i $IF -d 10.0.0.3 -j MARK --set-mark 2 #michal
$IPTABLES -t mangle -A FORWARD -i $IF -d 10.0.0.5 -j MARK --set-mark 3 #aaada
$IPTABLES -t mangle -A FORWARD -i $IF -d 10.0.0.6 -j MARK --set-mark 4 #viktor
#UPLOAD
$TC qdisc add dev $A root handle 1:0 htb
$TC class add dev $A parent 1:0 classid 1:1 htb rate $MAXUP
$TC class add dev $A parent 1:1 classid 1:11 htb rate 12kbit ceil $MAXUP prio 1 #koma
$TC class add dev $A parent 1:1 classid 1:12 htb rate 12kbit ceil $MAXUP prio 1 #michal
$TC class add dev $A parent 1:1 classid 1:13 htb rate 12kbit ceil $MAXUP prio 1 #aaada
$TC class add dev $A parent 1:1 classid 1:14 htb rate 12kbit ceil $MAXUP prio 1 #viktor
$TC filter add dev $A protocol ip parent 1:0 prio 1 handle 11 fw flowid 1:11 #koma
$TC filter add dev $A protocol ip parent 1:0 prio 1 handle 12 fw flowid 1:12 #michal
$TC filter add dev $A protocol ip parent 1:0 prio 1 handle 13 fw flowid 1:13 #aaada
$TC filter add dev $A protocol ip parent 1:0 prio 1 handle 14 fw flowid 1:14 #viktor
$IPTABLES -t mangle -A FORWARD -i $A -d 10.0.0.2 -j MARK --set-mark 11 #koma
$IPTABLES -t mangle -A FORWARD -i $A -d 10.0.0.3 -j MARK --set-mark 12 #michal
$IPTABLES -t mangle -A FORWARD -i $A -d 10.0.0.5 -j MARK --set-mark 13 #aaada
$IPTABLES -t mangle -A FORWARD -i $A -d 10.0.0.6 -j MARK --set-mark 14 #viktor
My idea i fair shaping bandwidth between 4 computers i my network, but something is wrong, but this doesnt work :[ Im linux newbie. Thanks for help.
Koma
Hi,
are you sure, that eth0 is privat and the br0 i the public side of 500g?
In my case (of course, using just a "one line" shaping) is the br0 is the LAN (private) side and eth0 is the INTERNET side ...
WiZiPoK
This depends on the wl500g model: regular box uses eth1, Deluxe - eth0.Quote:
Originally Posted by WiziPok
Hi,
And what about to try using this part of code:
WiZiPoKCode:wshaper start $IF 422 82
wshaper start $A 82 422
well, i'm sure... :)Quote:
Originally Posted by WiziPok
i don't know what is default eth on newer devices, on mine is eth0 for WAN, but I needed to change eth0 to LAN and eth2 to WAN, because my internet link is provided through wireless, and some of my clients are on LAN.
zox