我正在尝试确定一个类,该类将用作我网络上新 IP 的默认设置,这是我当前的设置:
# Delete qdisc rule
tc qdisc del dev br-lan root
# Add qdisc rule
tc qdisc add dev br-lan root handle 1: htb default 10
# Setup parent class
tc class add dev br-lan parent 1: classid 1:1 htb rate 2000kbit ceil 2000kbit
# Add child classes of parent class 1:
#Wired
tc class add dev br-lan parent 1:1 classid 1:10 htb rate 2000kbit ceil 2000kbit
#Wired2
tc class add dev br-lan parent 1:1 classid 1:11 htb rate 1000kbit ceil 1000kbit
#Wireless1
tc class add dev br-lan parent 1:1 classid 1:12 htb rate 250kbit ceil 150kbit
# Create packet filter rule using parent 1: class, matching to IP (src = outbound traffic, dst = inbound traffic)
# and assigning child class rule via flowid
tc -s filter show dev br-lan
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip src 192.168.1.35 flowid 1:10
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip dst 192.168.1.35 flowid 1:10
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip src 192.168.1.67 flowid 1:11
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip dst 192.168.1.67 flowid 1:11
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip src 192.168.1.104 flowid 1:12
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip dst 192.168.1.104 flowid 1:12
tc filter add dev br-lan parent 1: protocol ip prio 1 u32 match ip dst 192.168.1.104 flowid 1:12
在理想情况下,默认类是类 id 1:12,如上所示,允许 250kbit 带宽。
目前,任何无法识别的设备都使用父类:
tc class add dev br-lan parent 1: classid 1:1 htb rate 2000kbit ceil
这意味着他们有能力占用整个网络的带宽。
我试图研究以下文章: http: //lartc.org/howto/lartc.qdisc.classful.html
但是,我正在努力实施“叶子类”,有人可以对这种情况有所了解吗?谢谢