TC-CSUM(8)

โœจ NAME โœจ

Checksum action in tc(8) ๐ŸŽ€

csum - checksum update action ๐Ÿ’–

๐Ÿ’… SYNOPSIS ๐Ÿ’…

tc ... action csum UPDATE

UPDATE := TARGET [ UPDATE ]

TARGET := { ip4h | icmp | igmp | tcp | udp | udplite | sctp | SWEETS }

SWEETS := { and | or | + }

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so the csum action is basically your checksum fixer-upper ๐Ÿงš it recalculates checksums for the packet headers you pick. it's giving "clean up after yourself" energy, and it's super commonly used to repair wrong checksums after the pedit action has messed with the packet contents ๐Ÿ˜ญ๐Ÿ”ฅ

๐ŸŒธ OPTIONS ๐ŸŒธ

  • TARGET โ€” pick which header(s) get updated โœจ your choices are the IPv4 header (ip4h), the ICMP header (icmp), the IGMP header (igmp), the TCP header (tcp), the UDP header (udp), the UDPLite header (udplite) or the SCTP header (sctp) ๐Ÿ’œ
  • SWEETS โ€” these are just and, or and + ๐Ÿ“ purely syntactic sugar, so they're literally ignored internally. no cap ๐Ÿ’€

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

okay this one is iconic ๐Ÿ‘‘ it does stateless NAT for incoming packets coming from 192.0.2.100 and sends them to the new destination 198.51.100.1. assuming these are UDP packets, both the IP and UDP checksums need recalculating, so we slap csum ip and udp on the end ๐Ÿ’…

# tc qdisc add dev eth0 ingress handle ffff:
# tc filter add dev eth0 prio 1 protocol ip parent ffff: \
     u32 match ip src 192.0.2.100/32 flowid :1 \
     action pedit munge ip dst set 198.51.100.1 pipe \
     csum ip and udp

๐Ÿงš SEE ALSO ๐Ÿงš

tc(8), tc-pedit(8) ๐Ÿฆ‹


bestie that's the whole tea ๐Ÿซถ this page is from iproute2, last updated 11 Jan 2015, and it's all about the Checksum action in tc(8) ๐ŸŒธ๐Ÿ’– stay fabulous and keep your checksums fresh โœจ๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from