• November 01, 2024, 02:29:54 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: Rate limiting using DLINK ADSL modems  (Read 5655 times)

Mark Hodge

  • Level 1 Member
  • *
  • Posts: 1
Rate limiting using DLINK ADSL modems
« on: May 07, 2010, 09:56:49 PM »

Hi. I am wondering if there is a way to rate limit computer by IP address or MAC address on DLINK ADSL modems.

If there is a more appropriate place to post this question please feel welcome to tell me - I couldn't see anything any better than this random location in the forum :(

The common examples I have seen involve using iptables, which the current DLINK modem I use has (DLINK G604T, formware V3.00B01T01.TX.20060516).

However, none of the examples work, and I'm not experienced enough with iptables/tc/ismod etc to guess why or figure out a workaround.

One of the simple examples I have is this script, designed to give the user of IP 10.1.1.100 and 10.1.1.180 high throughput, and ratelimit the user with IP 10.1.1.184.

Once the insmod imq command is used error message abound and none of the subsequent commands are accepted either.

Does anyone here know enough to tell me what is going wrong and suggest a workaround?

Cheers,
Mark



#Based on http://www.dd-wrt.com/phpBB2/viewtopic.php?p=241408

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 50kbit ceil 70kbit 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 10.1.1.100 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 10.1.1.180 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -d 10.1.1.184 -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 2kbit ceil 10kbit 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 10.1.1.100 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -s 10.1.1.180 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -s 10.1.1.184 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -j IMQ --todev 0
Logged

Sammydad1

  • Level 5 Member
  • *****
  • Posts: 722
Re: Rate limiting using DLINK ADSL modems
« Reply #1 on: May 10, 2010, 12:36:12 AM »

don't know that specific device, but if it supports QoS as a router also, then you might be able to achieve at least prt of your goal using QoS....

But that may not be what you really want to achieve....
Logged
DIR-655 A2, FW: 1.35NA