summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces_tunnel.py
diff options
context:
space:
mode:
authoraapostoliuk <a.apostoliuk@vyos.io>2024-08-09 18:08:56 +0300
committeraapostoliuk <a.apostoliuk@vyos.io>2025-01-09 18:24:15 +0200
commit5e8307bf3a7f816193ca9da8cb290d57bbb375f2 (patch)
tree14c10b6e515bbdf97a85bad741e5e5a0e5f91307 /src/conf_mode/interfaces_tunnel.py
parent4ca6177f782c336330054c72854e5edbb2fe6322 (diff)
downloadvyos-1x-5e8307bf3a7f816193ca9da8cb290d57bbb375f2.tar.gz
vyos-1x-5e8307bf3a7f816193ca9da8cb290d57bbb375f2.zip
nhrp: T2326: NHRP migration to FRR
NHRP migration to FRR
Diffstat (limited to 'src/conf_mode/interfaces_tunnel.py')
-rwxr-xr-xsrc/conf_mode/interfaces_tunnel.py12
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)