From a91b9e6805c61c58cdca83ffa7a47182831d8652 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 1 Oct 2020 20:02:44 +0200 Subject: nat: T2948: fix validation of IP address range --- src/conf_mode/nat.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/conf_mode/nat.py') 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') -- cgit v1.2.3