September 10

OpenWRT ( +Linux) Bandwith limit per IP

Limit traffic from/to interface named “wl0” for specific IPs.

Replace 10kbit /20kbit according to your needs.

 


tc qdisc add dev wl0 root handle 1: htb default 12
tc class add dev wl0 parent 1: classid 1:1 htb rate 1000mbit ceil 1000mbit
tc class add dev wl0 parent 1:1 classid 1:10 htb rate 10kbit ceil 20kbit
tc filter add dev wl0 protocol ip parent 1:0 prio 1 u32 match ip src CLIENT IP/32 flowid 1:10
tc filter add dev wl0 protocol ip parent 1:0 prio 1 u32 match ip dst CLIENT/32 flowid 1:10



Limit for the interface

tc qdisc add dev wl0 handle 1: root htb default 11
tc class add dev wl0 parent 1: classid 1:1 htb rate 50kbit
tc class add dev wl0 parent 1:1 classid 1:11 htb rate 50kbit


Copyright © 1998. All rights reserved.

Posted September 10, 2019 by RaNd in category "/etc/config

Select comment form

Loading Facebook Comments ...

Leave a Reply

Your email address will not be published. Required fields are marked *

five × 3 =