diff options
author | Christian Breunig <christian@breunig.cc> | 2023-02-09 07:10:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-09 07:10:44 +0100 |
commit | 707688894c1a02953b62eadb318b0ee398c799dd (patch) | |
tree | f6d1cd575a2533ec9e890ed0ad48740a38f9bf88 /python | |
parent | cd78fe90771147f31fef252dc9b4f4061f325930 (diff) | |
parent | b721c5a65e8ff2d29f0fdbf9a84a43e6c816ae49 (diff) | |
download | vyos-1x-707688894c1a02953b62eadb318b0ee398c799dd.tar.gz vyos-1x-707688894c1a02953b62eadb318b0ee398c799dd.zip |
Merge pull request #1803 from sever-sever/T4971
T4971: PPPoE server add named ip pool and attr Framed-Pool
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/configverify.py | 15 |
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: |