| 1 |
.TH "Generic actions in tc" 8 "11 Jan 2023" "iproute2" "Linux" |
| 2 |
|
| 3 |
.SH NAME |
| 4 |
gact - generic action |
| 5 |
.SH SYNOPSIS |
| 6 |
.in +8 |
| 7 |
.ti -8 |
| 8 |
.BR tc " ... " "action gact" |
| 9 |
.IR CONTROL " [ " RAND " ] [ " INDEX " ]" |
| 10 |
.ti -8 |
| 11 |
.IR CONTROL " := { " |
| 12 |
.BR reclassify " | " drop " | " continue " | " pass " | " pipe " | " |
| 13 |
.br |
| 14 |
.BI "goto chain " "CHAIN_INDEX" |
| 15 |
| |
| 16 |
.br |
| 17 |
.BI "jump " "JUMP_COUNT" |
| 18 |
} |
| 19 |
|
| 20 |
.ti -8 |
| 21 |
.IR RAND " := " |
| 22 |
.BI random " RANDTYPE CONTROL VAL" |
| 23 |
.ti -8 |
| 24 |
.IR RANDTYPE " := { " |
| 25 |
.BR netrand " | " determ " }" |
| 26 |
.ti -8 |
| 27 |
.IR VAL " := number not exceeding 10000" |
| 28 |
.ti -8 |
| 29 |
.IR JUMP_COUNT " := absolute jump from start of action list" |
| 30 |
.ti -8 |
| 31 |
.IR INDEX " := index value used" |
| 32 |
|
| 33 |
.SH DESCRIPTION |
| 34 |
The |
| 35 |
.B gact |
| 36 |
action allows reclassify, dropping, passing, or accepting packets. |
| 37 |
At the moment there are only two algorithms. One is deterministic |
| 38 |
and the other uses internal kernel netrand. |
| 39 |
|
| 40 |
.SH OPTIONS |
| 41 |
.TP |
| 42 |
.BI random " RANDTYPE CONTROL VAL" |
| 43 |
The probability of taking the action expressed in terms of 1 out of |
| 44 |
.I VAL |
| 45 |
packets. |
| 46 |
|
| 47 |
.TP |
| 48 |
.I CONTROL |
| 49 |
Indicate how |
| 50 |
.B tc |
| 51 |
should proceed if the packet matches. |
| 52 |
For a description of the possible |
| 53 |
.I CONTROL |
| 54 |
values, see |
| 55 |
.BR tc-actions (8). |
| 56 |
|
| 57 |
.SH EXAMPLES |
| 58 |
Apply a rule on ingress to drop packets from a given source address. |
| 59 |
.RS |
| 60 |
.EX |
| 61 |
# tc filter add dev eth0 parent ffff: protocol ip prio 6 u32 match ip src \ |
| 62 |
10.0.0.9/32 flowid 1:16 action drop |
| 63 |
.EE |
| 64 |
.RE |
| 65 |
|
| 66 |
Allow 1 out 10 packets from source randomly using the netrand generator |
| 67 |
.RS |
| 68 |
.EX |
| 69 |
# tc filter add dev eth0 parent ffff: protocol ip prio 6 u32 match ip src \ |
| 70 |
10.0.0.9/32 flowid 1:16 action drop random netrand ok 10 |
| 71 |
.EE |
| 72 |
.RE |
| 73 |
|
| 74 |
Deterministically accept every second packet |
| 75 |
.RS |
| 76 |
.EX |
| 77 |
# tc filter add dev eth0 parent ffff: protocol ip prio 6 u32 match ip src \ |
| 78 |
10.0.0.9/32 flowid 1:16 action drop random determ ok 2 |
| 79 |
.EE |
| 80 |
.RE |
| 81 |
|
| 82 |
.SH SEE ALSO |
| 83 |
.BR tc (8), |
| 84 |
.BR tc-actions (8), |
| 85 |
.BR tc-u32 (8) |