wrt54g Script Generator and dd-wrt help

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
paradigm
DD-WRT User


Joined: 09 Dec 2008
Posts: 116

PostPosted: Tue Dec 09, 2008 2:21    Post subject: wrt54g Script Generator and dd-wrt help Reply with quote
Hello. I noticed a lot of people having problems with this. I had to spend about eight hours to get this working so I figured I should share. :)

Firstly, apparently 'modprobe' no longer works in the new dd-wrt firmware. I had to replace all calls to modprobe with 'insmod'

Second, It is reported that the ip range commands are not working either. It did not seem as if using mac addresses were workign either so I just used IPs and assigned them based on mac elsewhere in the firmware. [3/6/2009: per "phuzi0n" in a post below it WILL work if you load the proper module for it, "insmod ipt_mac" -- I have not verified this but you can try and report here please for others.]

Third, I had to manually disable two of the advanced options in the script generator which pertain to optimizing and reducing script length to get it to work.

Below is a working configuration which I am using sucessfully and it has been verified to work with the 11/25/8 build (I believe Eko) for the wrt54gl. And using v1.02 of the script.

Basically I have IP's 192.168.1.201 - 192.168.1.208 with upload and download restrictions. All users but 192.168.1.201 have the following restrictions:

Download rate 500kb/s Ceiling 700 kb/s
Upload rate 25 kb/s Ceiling 100 kb/s

192.168.1.201's limits:

Download rate 1000kb/s Ceiling 1000 kb/s
Upload rate 50 kb/s Ceiling 200 kb/s


Code:

#--------------------------------------------
#WRT54 Script Generator v1.02
#(C) 2006-2007 Robert "Robson" Mytkowski
#--------------------------------------------
tc qdisc del dev br0 root
tc qdisc add dev br0 root handle 1: htb
tc class add dev br0 parent 1: classid 1:1 htb rate 2500kbit
tc class add dev br0 parent 1:1 classid 1:10 htb rate 1000kbit ceil 1000kbit prio 2
tc class add dev br0 parent 1:1 classid 1:11 htb rate 500kbit ceil 700kbit prio 2
tc class add dev br0 parent 1:1 classid 1:12 htb rate 500kbit ceil 700kbit prio 2
tc class add dev br0 parent 1:1 classid 1:13 htb rate 500kbit ceil 700kbit prio 2
tc class add dev br0 parent 1:1 classid 1:14 htb rate 500kbit ceil 700kbit prio 2
tc class add dev br0 parent 1:1 classid 1:15 htb rate 500kbit ceil 700kbit prio 2
tc class add dev br0 parent 1:1 classid 1:16 htb rate 500kbit ceil 700kbit prio 2
tc class add dev br0 parent 1:1 classid 1:17 htb rate 500kbit ceil 700kbit prio 2
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:12
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 13 fw flowid 1:13
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 14 fw flowid 1:14
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 15 fw flowid 1:15
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 16 fw flowid 1:16
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 17 fw flowid 1:17
iptables -t mangle -A POSTROUTING -d 192.168.1.201 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.1.202 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.203 -j MARK --set-mark 12
iptables -t mangle -A POSTROUTING -d 192.168.1.204 -j MARK --set-mark 13
iptables -t mangle -A POSTROUTING -d 192.168.1.205 -j MARK --set-mark 14
iptables -t mangle -A POSTROUTING -d 192.168.1.206 -j MARK --set-mark 15
iptables -t mangle -A POSTROUTING -d 192.168.1.207 -j MARK --set-mark 16
iptables -t mangle -A POSTROUTING -d 192.168.1.208 -j MARK --set-mark 17
insmod imq
insmod ipt_IMQ
ip link set imq0 up
tc qdisc del dev imq0 root
tc qdisc add dev imq0 root handle 1: htb
tc class add dev imq0 parent 1: classid 1:1 htb rate 400kbit
tc class add dev imq0 parent 1:1 classid 1:10 htb rate 50kbit ceil 200kbit prio 2
tc class add dev imq0 parent 1:1 classid 1:11 htb rate 25kbit ceil 100kbit prio 2
tc class add dev imq0 parent 1:1 classid 1:12 htb rate 25kbit ceil 100kbit prio 2
tc class add dev imq0 parent 1:1 classid 1:13 htb rate 25kbit ceil 100kbit prio 2
tc class add dev imq0 parent 1:1 classid 1:14 htb rate 25kbit ceil 100kbit prio 2
tc class add dev imq0 parent 1:1 classid 1:15 htb rate 25kbit ceil 100kbit prio 2
tc class add dev imq0 parent 1:1 classid 1:16 htb rate 25kbit ceil 100kbit prio 2
tc class add dev imq0 parent 1:1 classid 1:17 htb rate 25kbit ceil 100kbit prio 2
tc filter add dev imq0 parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
tc filter add dev imq0 parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11
tc filter add dev imq0 parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:12
tc filter add dev imq0 parent 1:0 prio 2 protocol ip handle 13 fw flowid 1:13
tc filter add dev imq0 parent 1:0 prio 2 protocol ip handle 14 fw flowid 1:14
tc filter add dev imq0 parent 1:0 prio 2 protocol ip handle 15 fw flowid 1:15
tc filter add dev imq0 parent 1:0 prio 2 protocol ip handle 16 fw flowid 1:16
tc filter add dev imq0 parent 1:0 prio 2 protocol ip handle 17 fw flowid 1:17
iptables -t mangle -A PREROUTING -s 192.168.1.201 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -s 192.168.1.202 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.203 -j MARK --set-mark 12
iptables -t mangle -A PREROUTING -s 192.168.1.204 -j MARK --set-mark 13
iptables -t mangle -A PREROUTING -s 192.168.1.205 -j MARK --set-mark 14
iptables -t mangle -A PREROUTING -s 192.168.1.206 -j MARK --set-mark 15
iptables -t mangle -A PREROUTING -s 192.168.1.207 -j MARK --set-mark 16
iptables -t mangle -A PREROUTING -s 192.168.1.208 -j MARK --set-mark 17
iptables -t mangle -A PREROUTING -j IMQ --todev 0


If you want use the above and modify it, it will probably work. I verified it with testmy.net to check that the limits were actually working. I hope this helps someone!

Note: I have not attempted priorities or connection limits yet. It may or may not work.

Versions which have worked for me with the script:

10991 eko
11296 eko


Last edited by paradigm on Thu Mar 12, 2009 14:04; edited 3 times in total
Sponsor
paradigm
DD-WRT User


Joined: 09 Dec 2008
Posts: 116

PostPosted: Tue Dec 09, 2008 4:15    Post subject: Reply with quote
I should probably add some things as well.

The script I am speaking of is from here:

http://www.icpnet.pl/~robsonn/generator.zip

To use the script output or a modified version of mine, you go to ADMINISTRATION->COMMANDS and put it in. Then you choose SAVE FIREWALL, go to MANAGEMENT, then choose APPLY. Then reboot the router.

If you just want a more elegant and easier solution which handles download limits only (no upload limits), try the special version:

CORRECTION! Special version now does seem to have upload limits per MAC!

Screenshot: http://dinocrew.com/images/ddwrtqos.gif

http://www.dd-wrt.com/shop/catalog/

I believe if you buy from the above it supports dd-wrt? Thus I include it out of respect and in case this does not work for you. [b]It might be a lot easier than custom hacking iptables scripts....


Last edited by paradigm on Wed Dec 10, 2008 16:25; edited 1 time in total
shizuo
DD-WRT User


Joined: 10 Feb 2008
Posts: 72

PostPosted: Tue Dec 09, 2008 23:59    Post subject: Reply with quote
What do you mean special version has no upload limit? It works fine for me.
paradigm
DD-WRT User


Joined: 09 Dec 2008
Posts: 116

PostPosted: Wed Dec 10, 2008 16:08    Post subject: Reply with quote
shizuo wrote:
What do you mean special version has no upload limit? It works fine for me.


My understanding was that the special version only had d/l by mac, ip, etc. with no built in upload limit. Did this change?
paradigm
DD-WRT User


Joined: 09 Dec 2008
Posts: 116

PostPosted: Wed Dec 10, 2008 16:23    Post subject: Reply with quote
shizuo wrote:
What do you mean special version has no upload limit? It works fine for me.


Thanks. I stand corrected. I looked at your posts and found this screenshot:

http://dinocrew.com/images/ddwrtqos.gif

Previously i guess other versions did not have this. I will update the posts above as that might be A LOT easier for many people then hacking a custom iptables script.
dellsweig
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1476
Location: New York, USA

PostPosted: Wed Dec 10, 2008 16:35    Post subject: Reply with quote
THANKS for the find on MODPROBE !!!!!

That solved all my issues with the Upload limiting!!
dellsweig
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1476
Location: New York, USA

PostPosted: Wed Dec 10, 2008 18:18    Post subject: Reply with quote
A new question regarding the use of the script generated bandwidth control.

I have a VPN client on one of my laptops for work connectivity. I want to control the uplink bandwidth on this PC.

I setup a filter using the generator to limit this PC to 200k uplink. This is fine when the PC is on my lan but when I bring up the VPN tunnel to work this no longer works (no limiting).

The only thing I can figure is that the IP of the PC is changed to an IP assigned by my works DHCP server.

Any suggeestions on getting this to work - use MAC of the laptop??
paradigm
DD-WRT User


Joined: 09 Dec 2008
Posts: 116

PostPosted: Wed Dec 10, 2008 23:44    Post subject: Reply with quote
dellsweig wrote:
THANKS for the find on MODPROBE !!!!!

That solved all my issues with the Upload limiting!!


You're welcome. Sorry I don't have much knowledge of VPN with dd-wrt but here is a bump for hopefully someone who will.
greeneyes
DD-WRT Novice


Joined: 28 Nov 2008
Posts: 7

PostPosted: Thu Dec 11, 2008 12:27    Post subject: Reply with quote
Hmmmm....I think that there is too much useless lines that can be removed and by doing this you are going to reduce the script length. It's not necessary to include parent for each classid and ip handle. It's not an error but it's wasting of time typing each line and not at least it reduces script length. What I'm trying to say is this: in your case you need only two rules. So this means that you need only two lines for classid that are going to give you rate and ceil for each one of the two rules:

tc class add dev br0 parent 1:1 classid 1:10 htb rate 1000kbit ceil 1000kbit prio 2
tc class add dev br0 parent 1:1 classid 1:11 htb rate 500kbit ceil 700kbit prio 2

And now you need two lines for iphandle that are going to give you flowid addressed to the needed rule:

tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11

Now you have the rules with needed speeds and flowid for each rule. All you have to do now is to address each IP to a specific flowid:

iptables -t mangle -A POSTROUTING -d 192.168.1.201 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.1.202 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.203 -j MARK --set-mark 11
.................and so on

After all script is going to look like this:

tc qdisc del dev br0 root
tc qdisc add dev br0 root handle 1: htb
tc class add dev br0 parent 1: classid 1:1 htb rate 2500kbit
tc class add dev br0 parent 1:1 classid 1:10 htb rate 1000kbit ceil 1000kbit prio 2
tc class add dev br0 parent 1:1 classid 1:11 htb rate 500kbit ceil 700kbit prio 2
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11
iptables -t mangle -A POSTROUTING -d 192.168.1.201 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.1.202 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.203 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.204 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.205 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.206 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.207 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.208 -j MARK --set-mark 11
insmod imq
insmod ipt_IMQ
ip link set imq0 up
tc qdisc del dev imq0 root
tc qdisc add dev imq0 root handle 1: htb
tc class add dev imq0 parent 1: classid 1:1 htb rate 400kbit
tc class add dev imq0 parent 1:1 classid 1:10 htb rate 50kbit ceil 200kbit prio 2
tc class add dev imq0 parent 1:1 classid 1:11 htb rate 25kbit ceil 100kbit prio 2
tc filter add dev imq0 parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
tc filter add dev imq0 parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11
iptables -t mangle -A PREROUTING -s 192.168.1.201 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -s 192.168.1.202 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.203 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.204 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.205 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.206 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.207 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.208 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -j IMQ --todev 0

In other words the script is now 24 lines shorter and it could be even more shorter if one day the IP range problem is solved ;)

P.S.: I think your thread has a lot of common things with mine http://www.dd-wrt.com/phpBB2/viewtopic.php?p=238636#238636
paradigm
DD-WRT User


Joined: 09 Dec 2008
Posts: 116

PostPosted: Fri Dec 12, 2008 2:37    Post subject: Reply with quote
greeneyes wrote:
Hmmmm....I think that there is too much useless lines that can be removed and by doing this you are going to reduce the script length. It's not necessary to include parent for each classid and ip handle. It's not an error but it's wasting of time typing each line and not at least it reduces script length. What I'm trying to say is this: in your case you need only two rules. So this means that you need only two lines for classid that are going to give you rate and ceil for each one of the two rules:

tc class add dev br0 parent 1:1 classid 1:10 htb rate 1000kbit ceil 1000kbit prio 2
tc class add dev br0 parent 1:1 classid 1:11 htb rate 500kbit ceil 700kbit prio 2

And now you need two lines for iphandle that are going to give you flowid addressed to the needed rule:

tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11

Now you have the rules with needed speeds and flowid for each rule. All you have to do now is to address each IP to a specific flowid:

iptables -t mangle -A POSTROUTING -d 192.168.1.201 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.1.202 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.203 -j MARK --set-mark 11
.................and so on

After all script is going to look like this:

tc qdisc del dev br0 root
tc qdisc add dev br0 root handle 1: htb
tc class add dev br0 parent 1: classid 1:1 htb rate 2500kbit
tc class add dev br0 parent 1:1 classid 1:10 htb rate 1000kbit ceil 1000kbit prio 2
tc class add dev br0 parent 1:1 classid 1:11 htb rate 500kbit ceil 700kbit prio 2
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
tc filter add dev br0 parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11
iptables -t mangle -A POSTROUTING -d 192.168.1.201 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 192.168.1.202 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.203 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.204 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.205 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.206 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.207 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -d 192.168.1.208 -j MARK --set-mark 11
insmod imq
insmod ipt_IMQ
ip link set imq0 up
tc qdisc del dev imq0 root
tc qdisc add dev imq0 root handle 1: htb
tc class add dev imq0 parent 1: classid 1:1 htb rate 400kbit
tc class add dev imq0 parent 1:1 classid 1:10 htb rate 50kbit ceil 200kbit prio 2
tc class add dev imq0 parent 1:1 classid 1:11 htb rate 25kbit ceil 100kbit prio 2
tc filter add dev imq0 parent 1:0 prio 2 protocol ip handle 10 fw flowid 1:10
tc filter add dev imq0 parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11
iptables -t mangle -A PREROUTING -s 192.168.1.201 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -s 192.168.1.202 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.203 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.204 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.205 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.206 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.207 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -s 192.168.1.208 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -j IMQ --todev 0

In other words the script is now 24 lines shorter and it could be even more shorter if one day the IP range problem is solved ;)

P.S.: I think your thread has a lot of common things with mine http://www.dd-wrt.com/phpBB2/viewtopic.php?p=238636#238636


Thanks, I might plug it in and give it a try when I feel brave! For some reason though the optimizations generated by the script generator -- even accounting for modprobe and the ip range issue -- did not appear to be working with dd-wrt. I was messing with many things at once though and did not isolate it to be that for certain. After all those hours I was merely happy to finally get it to work and I then left it alone. Smile
paradigm
DD-WRT User


Joined: 09 Dec 2008
Posts: 116

PostPosted: Fri Dec 19, 2008 2:04    Post subject: Reply with quote
For anyone else following this from search or whatever, one thing I notice is that the actual bandwidth given is usually about 80% - 95% of what you specify per user. So you should account for that or else it might be slower than you intend.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Fri Mar 06, 2009 23:25    Post subject: Reply with quote
Reviving this old thread from a link just to say that anyone looking to do mac based filtering with iptables be sure to load the kernel module for it.

insmod ipt_mac
paradigm
DD-WRT User


Joined: 09 Dec 2008
Posts: 116

PostPosted: Fri Mar 06, 2009 23:37    Post subject: Reply with quote
phuzi0n wrote:
Reviving this old thread from a link just to say that anyone looking to do mac based filtering with iptables be sure to load the kernel module for it.

insmod ipt_mac


Excellent. That might be why it did not work before for me and I needed to do it based on ip.

Will update original post!
Spaider
DD-WRT Novice


Joined: 29 Aug 2006
Posts: 17

PostPosted: Tue Aug 04, 2009 19:36    Post subject: Reply with quote
I wasted tremendous amount of time trying to get priorities to work. I am not linux guru, so may be I am missing something. May be someone can help me at least diagnose what's the problem.

I am trying to set priorities for www, smpt and p2p traffic on my 512Kbit connection. Here is the script I got from generator:

Quote:

#--------------------------------------------
#WRT54 Script Generator v1.02
#(C) 2006-2007 Robert "Robson" Mytkowski
#--------------------------------------------
tc qdisc del dev ppp0 root
tc qdisc add dev ppp0 root handle 1: htb
tc class add dev ppp0 parent 1: classid 1:1 htb rate 460kbit
tc class add dev ppp0 parent 1:1 classid 1:10 htb rate 230kbit ceil 460kbit prio 0
tc class add dev ppp0 parent 1:1 classid 1:11 htb rate 92kbit ceil 460kbit prio 1
tc class add dev ppp0 parent 1:1 classid 1:12 htb rate 92kbit ceil 460kbit prio 2
tc class add dev ppp0 parent 1:1 classid 1:13 htb rate 46kbit ceil 321kbit prio 4
tc qdisc add dev ppp0 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev ppp0 parent 1:11 handle 11: sfq perturb 10
tc qdisc add dev ppp0 parent 1:12 handle 12: sfq perturb 10
tc qdisc add dev ppp0 parent 1:13 handle 13: sfq perturb 10
tc filter add dev ppp0 parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10
tc filter add dev ppp0 parent 1:0 prio 1 protocol ip handle 11 fw flowid 1:11
tc filter add dev ppp0 parent 1:0 prio 2 protocol ip handle 12 fw flowid 1:12
tc filter add dev ppp0 parent 1:0 prio 4 protocol ip handle 13 fw flowid 1:13
iptables -t mangle -A POSTROUTING -p tcp --sport 80 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -p tcp --sport 443 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -p tcp --sport 110 -j MARK --set-mark 12
iptables -t mangle -A POSTROUTING -p tcp --sport 1024:65535 -j MARK --set-mark 13


I am using ppp0 device because router connected to ISP through VPN. Well... it simply does not work. I have checked iptables:
Quote:
root@SPAIDER:~# iptables -t mangle -L -v
Chain PREROUTING (policy ACCEPT 51M packets, 24G bytes)
pkts bytes target prot opt in out source destination

Chain INPUT (policy ACCEPT 16M packets, 3511M bytes)
pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 35M packets, 20G bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 21M packets, 18G bytes)
pkts bytes target prot opt in out source destination

Chain POSTROUTING (policy ACCEPT 56M packets, 38G bytes)
pkts bytes target prot opt in out source destination
19848 7251K MARK tcp -- any any anywhere anywhere tcp spt:www MARK set 0xa
308 191K MARK tcp -- any any anywhere anywhere tcp spt:https MARK set 0xb
0 0 MARK tcp -- any any anywhere anywhere tcp spt:pop3 MARK set 0xc
316K 132M MARK tcp -- any any anywhere anywhere tcp spts:1024:65535 MARK set 0xd


Looks like traffic on 80, 43 and p2p ports are marked correctly. But when I checked the filters, it shows that it counted p2p traffic only (class htb 1:13):

Quote:
root@SPAIDER:~# tc -s class show dev ppp0
class htb 1:11 parent 1:1 prio 1 rate 92000bit ceil 460000bit burst 1714b cburst 2174b
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 230685 ctokens: 58512

class htb 1:1 root rate 460000bit ceil 460000bit burst 2174b cburst 2174b
Sent 20144021 bytes 103130 pkts (dropped 0, overlimits 0)
rate 122672bit 72pps
lended: 55214 borrowed: 0 giants: 0
tokens: 29674 ctokens: 29674

class htb 1:10 parent 1:1 prio 0 rate 230000bit ceil 460000bit burst 1886b cburst 2174b
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 101527 ctokens: 58512

class htb 1:13 parent 1:1 prio 4 rate 46000bit ceil 321000bit burst 1656b cburst 2000b
Sent 20144021 bytes 103130 pkts (dropped 11019, overlimits 0)
rate 121480bit 71pps
lended: 47916 borrowed: 55214 giants: 0
tokens: -263062 ctokens: 35815

class htb 1:12 parent 1:1 prio 2 rate 92000bit ceil 460000bit burst 1714b cburst 2174b
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 230685 ctokens: 58512


And, one more detail. For debug purposes, I ran this script from console, not from any auto-load scripts. Does it really matter?

Sorry for long post, I did not find the way to make code pieces collapsible.

Thanks.

_________________
DD-WRT v.24 Mini on WRT54GL v.1.1
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Tue Aug 04, 2009 22:36    Post subject: Reply with quote
Your script only has a queue attached to your uplink interface. The iptables rules will mark traffic in both directions but only the marked uplink traffic ends up in a queue.

Instead of using any of the presets in the script generator, create your own rules that have downlink limits so that it generates a script with imq0. Also don't set it to ppp0 because the generator attaches the uplink to imq0 and downlink to br0 by default.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum