naccyde / rpms / iproute

Forked from rpms/iproute 8 months ago
Clone

Blame SOURCES/0140-man-tc-csum.8-Add-an-example.patch

049c96
From 40dbf26f8c9369ec6a7be6702cfb54d3d9c198d5 Mon Sep 17 00:00:00 2001
049c96
From: Phil Sutter <psutter@redhat.com>
049c96
Date: Wed, 30 Mar 2016 16:51:09 +0200
049c96
Subject: [PATCH] man: tc-csum.8: Add an example
049c96
049c96
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1275426
049c96
Upstream Status: iproute2.git commit dbfb17a67f9c7
049c96
049c96
commit dbfb17a67f9c7cf64a38ca734ef638a3f613546c
049c96
Author: Phil Sutter <phil@nwl.cc>
049c96
Date:   Tue Mar 22 15:48:34 2016 +0100
049c96
049c96
    man: tc-csum.8: Add an example
049c96
049c96
    Signed-off-by: Phil Sutter <phil@nwl.cc>
049c96
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
049c96
---
049c96
 man/man8/tc-csum.8 | 15 +++++++++++++++
049c96
 1 file changed, 15 insertions(+)
049c96
049c96
diff --git a/man/man8/tc-csum.8 b/man/man8/tc-csum.8
049c96
index 9d00aae..3a64c82 100644
049c96
--- a/man/man8/tc-csum.8
049c96
+++ b/man/man8/tc-csum.8
049c96
@@ -49,6 +49,21 @@ UDPLite header
049c96
 .TP
049c96
 .B SWEETS
049c96
 These are merely syntactic sugar and ignored internally.
049c96
+.SH EXAMPLES
049c96
+The following performs stateless NAT for incoming packets from 192.168.1.100 to
049c96
+new destination 18.52.86.120 (0x12345678 in hex). Assuming these are UDP
049c96
+packets, both IP and UDP checksums have to be recalculated:
049c96
+
049c96
+.RS
049c96
+.EX
049c96
+# tc qdisc add dev eth0 ingress handle ffff:
049c96
+# tc filter add eth0 prio 1 protocol ip parent ffff: \\
049c96
+	u32 match ip src 192.168.1.100/32 flowid :1 \\
049c96
+	action pedit munge ip dst set 0x12345678 pipe \\
049c96
+	csum ip and udp
049c96
+.EE
049c96
+.RE
049c96
+
049c96
 .SH SEE ALSO
049c96
 .BR tc (8),
049c96
 .BR tc-pedit (8)
049c96
-- 
049c96
1.8.3.1
049c96