summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-05-18 15:13:44 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2024-05-18 15:13:44 +0000
commit2371c26b55db133b3864e54f460a046898e55abf (patch)
treee176239f268d14afd9c4c827b7af218ab0f0f632
parenta9e461edfc645f07ddfdad7b0d6ab9c9548c73a7 (diff)
downloadvyos-1x-2371c26b55db133b3864e54f460a046898e55abf.tar.gz
vyos-1x-2371c26b55db133b3864e54f460a046898e55abf.zip
T5169: Allow to set CGNAT multiple internal pools
Allow to set multiple CGNAT internal pools ``` set nat cgnat pool internal int-01 range '100.64.0.0/28' set nat cgnat pool internal int-01 range '100.64.222.11-100.64.222.14' ```
-rw-r--r--interface-definitions/nat_cgnat.xml.in1
-rwxr-xr-xsrc/conf_mode/nat_cgnat.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/interface-definitions/nat_cgnat.xml.in b/interface-definitions/nat_cgnat.xml.in
index caa26b4d9..fce5e655d 100644
--- a/interface-definitions/nat_cgnat.xml.in
+++ b/interface-definitions/nat_cgnat.xml.in
@@ -123,6 +123,7 @@
<validator name="ipv4-host"/>
<validator name="ipv4-range"/>
</constraint>
+ <multi/>
</properties>
</leafNode>
</children>
diff --git a/src/conf_mode/nat_cgnat.py b/src/conf_mode/nat_cgnat.py
index fbfb431f6..5ad65de80 100755
--- a/src/conf_mode/nat_cgnat.py
+++ b/src/conf_mode/nat_cgnat.py
@@ -253,7 +253,7 @@ def generate(config):
int_pool_name: str = rule_config['source']['pool']
external_ranges: list = [range for range in config['pool']['external'][ext_pool_name]['range']]
- internal_ranges: list = [config['pool']['internal'][int_pool_name]['range']]
+ internal_ranges: list = [range for range in config['pool']['internal'][int_pool_name]['range']]
external_list_hosts_count = []
external_list_hosts = []
internal_list_hosts_count = []