tc filter [add | del | change | get] dev STRING
[parent PARENTID] [protocol PROTO]
[prio PRIORITY] route
Where:
PROTO = {ip | icmp | etc.}
All the fields above have already been explained. The keyword route indicates that it is a route classifier. All the packets at the specified device will be classified based on the routing table. A set of rules are specified that indicate how the packets need to be treated. This is discussed in [2].
For e.g.
To install a route classifier:
tc filter add dev eth0 parent 1:0 protocol ip prio 100 route
In the above example, a route classifier is attached to the root of a CBQ tree. The classifier will classify IP packets (as indicated by the protocol field) and the priority assigned to it 100.
To specify rules to the filter:
ip route add 129.237.125.150 via 129.237.125.146 dev eth0 flow 1:2
In this example, a route is added to 129.237.125.150 via 129.237.125.146 and all such traffic will be considered as belonging to the class whose handle is 1:2.