summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-02-07 08:45:38 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2023-02-07 08:50:31 +0000
commit53d82ea2b1427ac4668cc1b38544219eae960b86 (patch)
tree25b36cffd087f8fbc01d9f23dcb172a97a3b7ba8 /python
parent2622902ac76bc1c3356bb722f63e931119f3eb04 (diff)
downloadvyos-1x-53d82ea2b1427ac4668cc1b38544219eae960b86.tar.gz
vyos-1x-53d82ea2b1427ac4668cc1b38544219eae960b86.zip
T4971: PPPoE server add named ip pool and attr Framed-Pool
Add a new feature to allow to use named pools Also it can be used with RADIUS attribute 'Framed-Pool' set service pppoe-server client-ip-pool name POOL1 gateway-address '192.0.2.1' set service pppoe-server client-ip-pool name POOL1 subnet '192.0.2.0/24'
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configverify.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index 8e0ce701e..63edacc81 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -1,4 +1,4 @@
-# Copyright 2020-2022 VyOS maintainers and contributors <maintainers@vyos.io>
+# Copyright 2020-2023 VyOS maintainers and contributors <maintainers@vyos.io>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -23,6 +23,7 @@
from vyos import ConfigError
from vyos.util import dict_search
+from vyos.util import dict_search_recursive
def verify_mtu(config):
"""
@@ -414,7 +415,17 @@ def verify_accel_ppp_base_service(config, local_users=True):
if 'key' not in radius_config:
raise ConfigError(f'Missing RADIUS secret key for server "{server}"')
- if 'gateway_address' not in config:
+ # Check global gateway or gateway in named pool
+ gateway = False
+ if 'gateway_address' in config:
+ gateway = True
+ else:
+ if dict_search_recursive(config, 'gateway_address', ['client_ip_pool', 'name']):
+ for _, v in config['client_ip_pool']['name'].items():
+ if 'gateway_address' in v:
+ gateway = True
+ break
+ if not gateway:
raise ConfigError('Server requires gateway-address to be configured!')
if 'name_server_ipv4' in config: