| 1 |
.TH "Checksum action in tc" 8 "11 Jan 2015" "iproute2" "Linux" |
| 2 |
|
| 3 |
.SH NAME |
| 4 |
csum - checksum update action |
| 5 |
.SH SYNOPSIS |
| 6 |
.in +8 |
| 7 |
.ti -8 |
| 8 |
.BR tc " ... " "action csum" |
| 9 |
.I UPDATE |
| 10 |
|
| 11 |
.ti -8 |
| 12 |
.IR UPDATE " := " TARGET " [ " UPDATE " ]" |
| 13 |
|
| 14 |
.ti -8 |
| 15 |
.IR TARGET " := { " |
| 16 |
.BR ip4h " |" |
| 17 |
.BR icmp " |" |
| 18 |
.BR igmp " |" |
| 19 |
.BR tcp " |" |
| 20 |
.BR udp " |" |
| 21 |
.BR udplite " |" |
| 22 |
.BR sctp " |" |
| 23 |
.IR SWEETS " }" |
| 24 |
|
| 25 |
.ti -8 |
| 26 |
.IR SWEETS " := { " |
| 27 |
.BR and " | " or " | " + " }" |
| 28 |
.SH DESCRIPTION |
| 29 |
The |
| 30 |
.B csum |
| 31 |
action triggers checksum recalculation of specified packet headers. It is |
| 32 |
commonly used to fix incorrect checksums after the |
| 33 |
.B pedit |
| 34 |
action has modified the packet content. |
| 35 |
.SH OPTIONS |
| 36 |
.TP |
| 37 |
.I TARGET |
| 38 |
Specify which headers to update: IPv4 header |
| 39 |
.RB ( ip4h ), |
| 40 |
ICMP header |
| 41 |
.RB ( icmp ), |
| 42 |
IGMP header |
| 43 |
.RB ( igmp ), |
| 44 |
TCP header |
| 45 |
.RB ( tcp ), |
| 46 |
UDP header |
| 47 |
.RB ( udp ), |
| 48 |
UDPLite header |
| 49 |
.RB ( udplite ") or" |
| 50 |
SCTP header |
| 51 |
.RB ( sctp ). |
| 52 |
.TP |
| 53 |
.B SWEETS |
| 54 |
These are merely syntactic sugar and ignored internally. |
| 55 |
.SH EXAMPLES |
| 56 |
The following performs stateless NAT for incoming packets from 192.0.2.100 to |
| 57 |
new destination 198.51.100.1. Assuming these are UDP |
| 58 |
packets, both IP and UDP checksums have to be recalculated: |
| 59 |
|
| 60 |
.RS |
| 61 |
.EX |
| 62 |
# tc qdisc add dev eth0 ingress handle ffff: |
| 63 |
# tc filter add dev eth0 prio 1 protocol ip parent ffff: \\ |
| 64 |
u32 match ip src 192.0.2.100/32 flowid :1 \\ |
| 65 |
action pedit munge ip dst set 198.51.100.1 pipe \\ |
| 66 |
csum ip and udp |
| 67 |
.EE |
| 68 |
.RE |
| 69 |
|
| 70 |
.SH SEE ALSO |
| 71 |
.BR tc (8), |
| 72 |
.BR tc-pedit (8) |