diff options
author | Christian Breunig <christian@breunig.cc> | 2025-01-13 19:52:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-13 19:52:58 +0100 |
commit | 4663c59ac956f33ecadc7f2ebf0c9c7b5de9c8a2 (patch) | |
tree | 858c1e443aabcaef216aaecb072011199957b7ee /src/conf_mode/interfaces_tunnel.py | |
parent | 8a83a976b775d4f24138ee5fff8dcb602789904d (diff) | |
parent | 5e8307bf3a7f816193ca9da8cb290d57bbb375f2 (diff) | |
download | vyos-1x-4663c59ac956f33ecadc7f2ebf0c9c7b5de9c8a2.tar.gz vyos-1x-4663c59ac956f33ecadc7f2ebf0c9c7b5de9c8a2.zip |
Merge pull request #4217 from aapostoliuk/T2326-circinus
nhrp: T2326: NHRP migration to FRR
Diffstat (limited to 'src/conf_mode/interfaces_tunnel.py')
-rwxr-xr-x | src/conf_mode/interfaces_tunnel.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/conf_mode/interfaces_tunnel.py b/src/conf_mode/interfaces_tunnel.py index 98ef98d12..ee1436e49 100755 --- a/src/conf_mode/interfaces_tunnel.py +++ b/src/conf_mode/interfaces_tunnel.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2018-2024 yOS maintainers and contributors +# Copyright (C) 2018-2025 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -13,9 +13,8 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. - from sys import exit - +import ipaddress from vyos.config import Config from vyos.configdict import get_interface_dict from vyos.configdict import is_node_changed @@ -89,6 +88,13 @@ def verify(tunnel): raise ConfigError('Tunnel used for NHRP, it can not be deleted!') return None + if 'nhrp' in tunnel: + if 'address' in tunnel: + address_list = dict_search('address', tunnel) + for tunip in address_list: + if ipaddress.ip_network(tunip, strict=False).prefixlen != 32: + raise ConfigError( + 'Tunnel is used for NHRP, Netmask should be /32!') verify_tunnel(tunnel) |