diff options
author | Daniil Baturin <daniil@vyos.io> | 2025-05-08 15:41:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-08 15:41:24 +0100 |
commit | c8e468d4bf720f15e1c0232091399a45e8d9949b (patch) | |
tree | 6e4fe0555cad1d02459dd25f033c6c9fcc2d84bf /smoketest/scripts/cli/test_nat66.py | |
parent | f181c1357a0112f4c370b4c15edd80e80e3d6a96 (diff) | |
parent | 43554efc27fcea6703b3b31674a38252434a0f2f (diff) | |
download | vyos-1x-c8e468d4bf720f15e1c0232091399a45e8d9949b.tar.gz vyos-1x-c8e468d4bf720f15e1c0232091399a45e8d9949b.zip |
Merge pull request #4484 from ryanzuwala/T7051
nat66: T7051: snat group as destination
Diffstat (limited to 'smoketest/scripts/cli/test_nat66.py')
-rwxr-xr-x | smoketest/scripts/cli/test_nat66.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_nat66.py b/smoketest/scripts/cli/test_nat66.py index 52ad8e3ef..d4b5d6aa4 100755 --- a/smoketest/scripts/cli/test_nat66.py +++ b/smoketest/scripts/cli/test_nat66.py @@ -227,6 +227,35 @@ class TestNAT66(VyOSUnitTestSHIM.TestCase): self.verify_nftables(nftables_search, 'ip6 vyos_nat') + def test_source_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(src_path + ['rule', '1', 'destination', 'group', 'address-group', address_group]) + self.cli_set(src_path + ['rule', '1', 'translation', 'address', translation_prefix]) + + self.cli_set(src_path + ['rule', '2', 'destination', 'group', 'network-group', network_group]) + self.cli_set(src_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}', 'snat prefix to fc01::/64'], + ['ip6 daddr', f'@N6_{network_group}', 'snat prefix to fc01::/64'] + ] + + self.verify_nftables(nftables_search, 'ip6 vyos_nat') + def test_nat66_no_rules(self): # T3206: deleting all rules but keep the direction 'destination' or # 'source' resulteds in KeyError: 'rule'. |