summaryrefslogtreecommitdiff
path: root/src/conf_mode/nat_cgnat.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode/nat_cgnat.py')
-rwxr-xr-xsrc/conf_mode/nat_cgnat.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/conf_mode/nat_cgnat.py b/src/conf_mode/nat_cgnat.py
index 5ad65de80..957b12c28 100755
--- a/src/conf_mode/nat_cgnat.py
+++ b/src/conf_mode/nat_cgnat.py
@@ -252,7 +252,11 @@ def generate(config):
ext_pool_name: str = rule_config['translation']['pool']
int_pool_name: str = rule_config['source']['pool']
- external_ranges: list = [range for range in config['pool']['external'][ext_pool_name]['range']]
+ # Sort the external ranges by sequence
+ external_ranges: list = sorted(
+ config['pool']['external'][ext_pool_name]['range'],
+ key=lambda r: int(config['pool']['external'][ext_pool_name]['range'][r].get('seq', 999999))
+ )
internal_ranges: list = [range for range in config['pool']['internal'][int_pool_name]['range']]
external_list_hosts_count = []
external_list_hosts = []