| 1 |
.TH "Route classifier in tc" 8 "21 Oct 2015" "iproute2" "Linux" |
| 2 |
|
| 3 |
.SH NAME |
| 4 |
route \- route traffic control filter |
| 5 |
.SH SYNOPSIS |
| 6 |
.in +8 |
| 7 |
.ti -8 |
| 8 |
.BR tc " " filter " ... " route " [ " from |
| 9 |
.IR REALM " | " |
| 10 |
.B fromif |
| 11 |
.IR TAG " ] [ " |
| 12 |
.B to |
| 13 |
.IR REALM " ] [ " |
| 14 |
.B classid |
| 15 |
.IR CLASSID " ] [ " |
| 16 |
.B action |
| 17 |
.IR ACTION_SPEC " ]" |
| 18 |
.SH DESCRIPTION |
| 19 |
Match packets based on routing table entries. This filter centers around the |
| 20 |
possibility to assign a |
| 21 |
.B realm |
| 22 |
to routing table entries. For any packet to be classified by this filter, a |
| 23 |
routing table lookup is performed and the returned |
| 24 |
.B realm |
| 25 |
is used to decide on whether the packet is a match or not. |
| 26 |
.SH OPTIONS |
| 27 |
.TP |
| 28 |
.BI action " ACTION_SPEC" |
| 29 |
Apply an action from the generic actions framework on matching packets. |
| 30 |
.TP |
| 31 |
.BI classid " CLASSID" |
| 32 |
Push matching packets into the class identified by |
| 33 |
.IR CLASSID . |
| 34 |
.TP |
| 35 |
.BI from " REALM" |
| 36 |
.TQ |
| 37 |
.BI fromif " TAG" |
| 38 |
Perform source route lookups. |
| 39 |
.I TAG |
| 40 |
is the name of an interface which must be present on the system at the time of |
| 41 |
.B tc |
| 42 |
invocation. |
| 43 |
.TP |
| 44 |
.BI to " REALM" |
| 45 |
Match if normal (i.e., destination) routing returns the given |
| 46 |
.IR REALM . |
| 47 |
.SH EXAMPLES |
| 48 |
Consider the subnet 192.168.2.0/24 being attached to eth0: |
| 49 |
|
| 50 |
.RS |
| 51 |
.EX |
| 52 |
ip route add 192.168.2.0/24 dev eth0 realm 2 |
| 53 |
.EE |
| 54 |
.RE |
| 55 |
|
| 56 |
The following |
| 57 |
.B route |
| 58 |
filter will then match packets from that subnet: |
| 59 |
|
| 60 |
.RS |
| 61 |
.EX |
| 62 |
tc filter add ... route from 2 classid 1:2 |
| 63 |
.EE |
| 64 |
.RE |
| 65 |
|
| 66 |
and pass packets on to class 1:2. |
| 67 |
.SH NOTES |
| 68 |
Due to implementation details, |
| 69 |
.B realm |
| 70 |
values must be in a range from 0 to 255, inclusive. Alternatively, a verbose |
| 71 |
name defined in /etc/iproute2/rt_realms may be given instead. |
| 72 |
.SH SEE ALSO |
| 73 |
.BR tc (8), |
| 74 |
.BR ip-route (8) |