{"id":3442,"date":"2022-12-20T17:02:41","date_gmt":"2022-12-20T20:02:41","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/checksum-action-in-tc-man8\/"},"modified":"2022-12-20T17:02:41","modified_gmt":"2022-12-20T20:02:41","slug":"checksum-action-in-tc-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/checksum-action-in-tc-man8\/","title":{"rendered":"Checksum action in tc (man8)"},"content":{"rendered":"<h1 align=\"center\">Checksum action in tc<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">csum &#8211; checksum update action<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:23%; margin-top: 1em\"><b>tc<\/b> &#8230; <b>action csum<\/b> <i>UPDATE<\/i><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>UPDATE<\/i> := <i>TARGET<\/i> [ <i>UPDATE<\/i> ]<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>TARGET<\/i> := { <b>ip4h<\/b> | <b>icmp<\/b> | <b>igmp<\/b> | <b>tcp<\/b> | <b>udp<\/b> | <b>udplite<\/b> | <b>sctp<\/b> | <i>SWEETS<\/i> }<\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><i>SWEETS<\/i> := { <b>and<\/b> | <b>or<\/b> | <b>+<\/b> }<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>csum<\/b> action triggers checksum recalculation of specified packet headers. It is commonly used to fix incorrect checksums after the <b>pedit<\/b> action has modified the packet content.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\"><i>TARGET<\/i><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">Specify which headers to update: IPv4 header (<b>ip4h<\/b>), ICMP header (<b>icmp<\/b>), IGMP header (<b>igmp<\/b>), TCP header (<b>tcp<\/b>), UDP header (<b>udp<\/b>), UDPLite header (<b>udplite<\/b>) or SCTP header (<b>sctp<\/b>).<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>SWEETS<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>These are merely syntactic sugar and ignored internally.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following performs stateless NAT for incoming packets from 192.0.2.100 to new destination 198.51.100.1. Assuming these are UDP packets, both IP and UDP checksums have to be recalculated:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"># tc qdisc add dev eth0 ingress handle ffff: <br \/> # tc filter add dev eth0 prio 1 protocol ip parent ffff: <\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"92%\">\n<p>u32 match ip src 192.0.2.100\/32 flowid :1 <\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"92%\">\n<p>action pedit munge ip dst set 198.51.100.1 pipe <\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"92%\">\n<p>csum ip and udp<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>tc<\/b>(8), <b>tc-pedit<\/b>(8)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  csum &#8211; checksum update action <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,568],"class_list":["post-3442","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-tc-csum"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3442"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3442\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}