summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/sets/0047nat_0
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-04-27 22:12:21 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2020-04-28 17:35:56 +0200
commit6a8668b1fded4fbc908a35ee2b49a2d0b70a1a24 (patch)
tree282acf8228bc32bf1df9a28f238b96eb03d1d38e /tests/shell/testcases/sets/0047nat_0
parent9fef2dc765c53cc15fb021ac36ad3da0cfcebd2d (diff)
tests: shell: add NAT mappings tests
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/sets/0047nat_0')
-rwxr-xr-xtests/shell/testcases/sets/0047nat_020
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/shell/testcases/sets/0047nat_0 b/tests/shell/testcases/sets/0047nat_0
new file mode 100755
index 00000000..746a6b6d
--- /dev/null
+++ b/tests/shell/testcases/sets/0047nat_0
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+EXPECTED="table ip x {
+ map y {
+ type ipv4_addr : interval ipv4_addr
+ flags interval
+ elements = { 10.141.10.0/24 : 192.168.2.2-192.168.2.4,
+ 10.141.11.0/24 : 192.168.4.2-192.168.4.3 }
+ }
+
+ chain y {
+ type nat hook postrouting priority srcnat; policy accept;
+ snat ip interval to ip saddr map @y
+ }
+ }
+"
+
+set -e
+$NFT -f - <<< $EXPECTED
+$NFT add element x y { 10.141.12.0/24 : 192.168.5.10-192.168.5.20 }