1

I'm trying to determine a class which would be used as default for new IP's on my network, here's my current setup:

# 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

In an ideal world, the default class would be class id 1:12, as shown above, allowing 250kbit bandwidth.

At the moment, any unrecognized device uses the parent class:

tc class add dev br-lan parent 1: classid 1:1 htb rate 2000kbit ceil 

Which means they have the ability of taking the entire bandwidth of the network.

I've tried to study the following article: http://lartc.org/howto/lartc.qdisc.classful.html

However, I'm struggling to implement 'leaf classes', could anyone shed some light into this situation? Thanks

  • Unfortunately, questions about host or server configurations are off-topic here. You could try to ask this question on Server Fault for a business network, or on Super User for a personal network. – Ron Maupin Apr 17 '17 at 21:13
1

Using the line:

tc qdisc add dev br-lan root handle 1: htb default 10

The following code determines the class which will be used for devices which have not been declared in the list of filters 'default 10' No idea how I previously overlooked this.

Not the answer you're looking for? Browse other questions tagged or ask your own question.