path: root/tests/py/inet/snat.t
diff options
Diffstat (limited to 'tests/py/inet/snat.t')
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/py/inet/snat.t b/tests/py/inet/snat.t
new file mode 100644
index 00000000..cf23b5cf
--- /dev/null
+++ b/tests/py/inet/snat.t
@@ -0,0 +1,21 @@
+:postrouting;type nat hook postrouting priority 0
+# explicit family: 'snat to ip':
+iifname "eth0" tcp dport 81 snat ip to;ok
+# infer snat target family from network header base:
+iifname "eth0" tcp dport 81 ip saddr snat to;ok;iifname "eth0" tcp dport 81 ip saddr snat ip to
+iifname "eth0" tcp dport 81 snat ip6 to dead::beef;ok
+iifname "foo" masquerade random;ok
+snat to;fail
+snat ip6 to;fail
+snat to dead::beef;fail
+snat ip to dead::beef;fail
+snat ip daddr to dead::beef;fail
+snat ip daddr ip6 to dead::beef;fail
+snat ip6 saddr dead::beef to;fail