diff options
author | Christian Breunig <christian@breunig.cc> | 2024-09-11 07:48:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-11 07:48:49 +0200 |
commit | 4bbd5c7c13f7ea72ba40813db0e6258ecf0a59f7 (patch) | |
tree | 6f4de57bc5af3b482619a91ff1dfcf144214b4a8 /smoketest/scripts | |
parent | 7767fb40b4c4e48a73cbff88860b889302476d22 (diff) | |
parent | f96733dd1e8d840012d98740006d7999a9fa6776 (diff) | |
download | vyos-1x-4bbd5c7c13f7ea72ba40813db0e6258ecf0a59f7.tar.gz vyos-1x-4bbd5c7c13f7ea72ba40813db0e6258ecf0a59f7.zip |
Merge pull request #4023 from nvollmar/T6679
T6679: add group option for nat66
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-x | smoketest/scripts/cli/test_nat66.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_nat66.py b/smoketest/scripts/cli/test_nat66.py index e8eeae26f..52ad8e3ef 100755 --- a/smoketest/scripts/cli/test_nat66.py +++ b/smoketest/scripts/cli/test_nat66.py @@ -141,6 +141,36 @@ class TestNAT66(VyOSUnitTestSHIM.TestCase): self.verify_nftables(nftables_search, 'ip6 vyos_nat') + def test_destination_nat66_network_group(self): + address_group = 'smoketest_addr' + address_group_member = 'fc00::1' + network_group = 'smoketest_net' + network_group_member = 'fc00::/64' + translation_prefix = 'fc01::/64' + + self.cli_set(['firewall', 'group', 'ipv6-address-group', address_group, 'address', address_group_member]) + self.cli_set(['firewall', 'group', 'ipv6-network-group', network_group, 'network', network_group_member]) + + self.cli_set(dst_path + ['rule', '1', 'destination', 'group', 'address-group', address_group]) + self.cli_set(dst_path + ['rule', '1', 'translation', 'address', translation_prefix]) + + self.cli_set(dst_path + ['rule', '2', 'destination', 'group', 'network-group', network_group]) + self.cli_set(dst_path + ['rule', '2', 'translation', 'address', translation_prefix]) + + self.cli_commit() + + nftables_search = [ + [f'set A6_{address_group}'], + [f'elements = {{ {address_group_member} }}'], + [f'set N6_{network_group}'], + [f'elements = {{ {network_group_member} }}'], + ['ip6 daddr', f'@A6_{address_group}', 'dnat prefix to fc01::/64'], + ['ip6 daddr', f'@N6_{network_group}', 'dnat prefix to fc01::/64'] + ] + + self.verify_nftables(nftables_search, 'ip6 vyos_nat') + + def test_destination_nat66_without_translation_address(self): self.cli_set(dst_path + ['rule', '1', 'inbound-interface', 'name', 'eth1']) self.cli_set(dst_path + ['rule', '1', 'destination', 'port', '443']) |