summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2016-10-19 06:17:52 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2016-11-28 11:35:22 +0000
commit475f055305cf904b1c1c0436654f2f3e1c4f3358 (patch)
tree0f6a205f837377289eb369caf1f083fa5610d6f2 /vnet
parenta10f62b11e7a710fde628ae75fe5791e54caba0a (diff)
snat: thread safe (VPP-443)
All traffic corresponding to a specific SANT user is handled by a CPU core. in2out: Non-translated packets worker lookup by src address and VRF hash in snat-in2out-worker-handoff node. out2in: Translated packets worker lookup by dst address and port number hash in snat-out2in-worker-handoff node. Change-Id: Ia092a605689539469841d382588f3f486a29a769 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/etc/scripts/snat34
1 files changed, 34 insertions, 0 deletions
diff --git a/vnet/etc/scripts/snat b/vnet/etc/scripts/snat
new file mode 100644
index 00000000000..87fd699ee51
--- /dev/null
+++ b/vnet/etc/scripts/snat
@@ -0,0 +1,34 @@
+packet-generator new {
+ name f1
+ limit 1000000
+ node ip4-input
+ size 64-64
+ no-recycle
+ worker 0
+ data {
+ UDP: 10.0.0.3 -> 172.16.1.2
+ UDP: 3000 -> 3001
+ length 128 checksum 0 incrementing 1
+ }
+}
+
+
+packet-generator new {
+ name f2
+ limit 1000000
+ node ip4-input
+ size 64-64
+ no-recycle
+ worker 1
+ data {
+ UDP: 10.0.0.3 -> 172.16.1.2
+ UDP: 3005 -> 3006
+ length 128 checksum 0 incrementing 1
+ }
+}
+
+snat add address 172.16.1.3
+ip route 172.16.1.2/32 via drop
+set int ip address pg0 10.0.0.1/24
+set int snat in pg0
+trace add pg-input 10