QUOTE(ncool15 @ Mar 8 2012, 12:12 PM)
Hey guys
I got a question here.Im on VIP 10 and using the DIR615 modem provided by TM.Thing is im sharing my unifi with 3 other housemates .They dont have broadband so they asked if they can share my unifi.Judging ob their financial background,i only ask RM60 from them(I pay the rest).Thing is these people are downloading alot now and i sometime can only get speed around 1.5mbps.
Can anyone enlighten me how to limit their connection lets say allocate 3mbps for them and 7mbps for me?
Thanks alot.
You have a few options (use method 1 or 3 if they are unwilling to cooperate with you) :
1) P2Pover - I personally don't like this method as it involves ARP cache poisoning. Easy to setup though, just download, scan, add a 24/7 schedule + speed cap profile and target their IP addresses.
2) Netlimiter - They can use this on their PCs to manually assign rate limits to themselves.
3) Router based rate limiting - You can use traffic control + HTB egress scheduling on the DIR-615 stock firmware to set hard rate limits per IP. This works if you have admin access on the router however since there's no way to write a startup script on the stock firmware (that I know of), you need to reapply the commands on router reboot. You need to enable telnet/ssh access on the router via the 'operator' account then use PuTTy to access the router shell. After that you can use the following commands
CODE
tc qdisc del dev br0 root
tc qdisc add dev br0 root handle 1: htb
tc qdisc del dev ppp0 root
tc qdisc add dev ppp0 root handle 1: htb
tc class add dev br0 parent 1: classid 1:1 htb rate 2mbit
tc qdisc add dev br0 parent 1:1 pfifo limit 50
tc class add dev br0 parent 1: classid 1:2 htb rate 2mbit
tc qdisc add dev br0 parent 1:2 pfifo limit 50
tc class add dev br0 parent 1: classid 1:3 htb rate 2mbit
tc qdisc add dev br0 parent 1:3 pfifo limit 50
tc class add dev ppp0 parent 1: classid 1:1 htb rate 2mbit
tc qdisc add dev ppp0 parent 1:1 pfifo limit 50
tc class add dev ppp0 parent 1: classid 1:2 htb rate 2mbit
tc qdisc add dev ppp0 parent 1:2 pfifo limit 50
tc class add dev ppp0 parent 1: classid 1:3 htb rate 2mbit
tc qdisc add dev ppp0 parent 1:3 pfifo limit 50
tc filter add dev br0 parent 1: protocol ip handle 10 fw flowid 1:1
iptables -t mangle -A FORWARD -o br0 -d 192.168.0.11/32 -j MARK --set-mark 10
tc filter add dev br0 parent 1: protocol ip handle 20 fw flowid 1:2
iptables -t mangle -A FORWARD -o br0 -d 192.168.0.12/32 -j MARK --set-mark 20
tc filter add dev br0 parent 1: protocol ip handle 30 fw flowid 1:3
iptables -t mangle -A FORWARD -o br0 -d 192.168.0.13/32 -j MARK --set-mark 30
tc filter add dev ppp0 parent 1: protocol ip handle 10 fw flowid 1:1
iptables -t mangle -A FORWARD -o ppp0 -s 192.168.0.11/32 -j MARK --set-mark 10
tc filter add dev ppp0 parent 1: protocol ip handle 20 fw flowid 1:2
iptables -t mangle -A FORWARD -o ppp0 -s 192.168.0.12/32 -j MARK --set-mark 20
tc filter add dev ppp0 parent 1: protocol ip handle 30 fw flowid 1:3
iptables -t mangle -A FORWARD -o ppp0 -s 192.168.0.13/32 -j MARK --set-mark 30
This applies egress scheduling on both the ppp and LAN bridge interfaces of the DIR-615 so you can control upload/download bandwidth on a per client IP basis. The example above applies a 2mbit up/down cap on IP's 192.168.0.11, 192.168.0.12 and 192.168.0.13.