0

I have a raspberry pi router for me and my room mates. The bandwidth is divided as follow:

         1:0(htb)
            |
         1:1(16mbit/s)
          /   \
1:2(8mbit/s) 1:ffff(8mbit/s)

If I add the filter for with parent 1:0 (tc filter add dev wlan0 parent 1:0 protocol ip prio 1 handle 0x0002 fw flowid 1:2), it works like a charm. However, if I add the filter upon class 1:1 the command didn't report any errors but there is no ouput for tc filter show dev wlan0 command.

Questions:
1. Why it didn't work when I put the filters on 1:1?
2. Can I place the filters on subclasses like 1:1?

user762750
  • 179
  • 1
  • 9

1 Answers1

1
  1. The filters are attached to root of ingress queue discipline, not to classes. So in your case all filters should be created with parent 1:0 option.

  2. To pass the traffic through classes you should create a filter with flowid ... or classid ... options for every class. So, in your case the filters should be looks like (if I've understood you correctly):

tc filter add dev wlan0 parent 1:0 protocol ip prio 1 handle 0x0002 fw flowid 1:2
tc filter add dev wlan0 parent 1:0 protocol ip prio 2 handle 0xffff fw flowid 1:ffff

Anton Danilov
  • 4,874
  • 2
  • 11
  • 20
  • Thanks for the reply, Is there any cases that filters need to be configured with other parents? – user762750 Jul 16 '19 at 10:26
  • Theoretically you can attach the filters to the non-root qdisc (queue disciplines on leaves classes). Practically it can be useful for flow filter and sfq qdiscs. – Anton Danilov Jul 16 '19 at 10:34