diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-10-01 20:02:44 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-10-01 20:02:44 +0200 |
commit | a91b9e6805c61c58cdca83ffa7a47182831d8652 (patch) | |
tree | 7fed72bef3802488c6b18a86d2564640647e9ea1 /src/conf_mode/nat.py | |
parent | 3508feea888bfc0d95eb8928d98afd50bc335eb9 (diff) | |
download | vyos-1x-a91b9e6805c61c58cdca83ffa7a47182831d8652.tar.gz vyos-1x-a91b9e6805c61c58cdca83ffa7a47182831d8652.zip |
nat: T2948: fix validation of IP address range
Diffstat (limited to 'src/conf_mode/nat.py')
-rwxr-xr-x | src/conf_mode/nat.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/conf_mode/nat.py b/src/conf_mode/nat.py index eb634fd78..b66cd370a 100755 --- a/src/conf_mode/nat.py +++ b/src/conf_mode/nat.py @@ -238,8 +238,11 @@ def verify(nat): if rule['translation_address']: addr = rule['translation_address'] - if addr != 'masquerade' and not is_addr_assigned(addr): - print(f'Warning: IP address {addr} does not exist on the system!') + if addr != 'masquerade': + for ip in addr.split('-'): + if not is_addr_assigned(ip): + print(f'Warning: IP address {ip} does not exist on the system!') + elif not rule['exclude']: raise ConfigError(f'{err_msg} translation address not specified') |