Chapter 12. Advanced filters for (re-)classifying packets
- Table of Contents
- 12.1. The u32 classifier
- 12.1.1. U32 selector
- 12.1.2. General selectors
- 12.1.3. Specific selectors
- 12.2. The route classifier
- 12.3. Policing filters
- 12.3.1. Ways to police
- 12.3.2. Overlimit actions
- 12.3.3. Examples
- 12.4. Hashing filters for very fast massive filtering
As explained in the section on classful queueing disciplines, filters are needed to classify packets into any of the sub-queues. These filters are called from within the classful qdisc.
Here is an incomplete list of classifiers available:
- fw
Bases the decision on how the firewall has marked the packet. This can be the easy way out if you don't want to learn tc filter syntax. See the Queueing chapter for details.
- u32
Bases the decision on fields within the packet (i.e. source IP address, etc)
- route
Bases the decision on which route the packet will be routed by
- rsvp, rsvp6
Routes packets based on RSVP . Only useful on networks you control - the Internet does not respect RSVP.
- tcindex
Used in the DSMARK qdisc, see the relevant section.
Note that in general there are many ways in which you can classify packet and that it generally comes down to preference as to which system you wish to use.
Classifiers in general accept a few arguments in common. They are listed here for convenience:
- protocol
The protocol this classifier will accept. Generally you will only be accepting only IP traffic. Required.
- parent
The handle this classifier is to be attached to. This handle must be an already existing class. Required.
- prio
The priority of this classifier. Lower numbers get tested first.
- handle
This handle means different things to different filters.
All the following sections will assume you are trying to shape the traffic going to HostA. They will assume that the root class has been configured on 1: and that the class you want to send the selected traffic to is 1:1.