summaryrefslogtreecommitdiffstats
path: root/tests/py/inet/snat.t
blob: cf23b5cff1bbe562805e8fc88d10cdad4865f160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
:postrouting;type nat hook postrouting priority 0

*inet;test-inet;postrouting

# explicit family: 'snat to ip':
iifname "eth0" tcp dport 81 snat ip to 192.168.3.2;ok

# infer snat target family from network header base:
iifname "eth0" tcp dport 81 ip saddr 10.1.1.1 snat to 192.168.3.2;ok;iifname "eth0" tcp dport 81 ip saddr 10.1.1.1 snat ip to 192.168.3.2
iifname "eth0" tcp dport 81 snat ip6 to dead::beef;ok

iifname "foo" masquerade random;ok


snat to 192.168.3.2;fail
snat ip6 to 192.168.3.2;fail
snat to dead::beef;fail
snat ip to dead::beef;fail
snat ip daddr 1.2.3.4 to dead::beef;fail
snat ip daddr 1.2.3.4 ip6 to dead::beef;fail
snat ip6 saddr dead::beef to 1.2.3.4;fail