summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/sets/0047nat_0
blob: 746a6b6d345051f712c53e7547ec3b973ea58ca2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 }