diff options
author | hagbard <vyosdev@derith.de> | 2019-06-17 08:38:37 -0700 |
---|---|---|
committer | hagbard <vyosdev@derith.de> | 2019-06-17 08:38:37 -0700 |
commit | 9b4447f039655b9e24187302b9c4d9bb2116aa99 (patch) | |
tree | 2cc8bd18c66ca461c326f13c4966ac81ea2ad176 | |
parent | d6d42f5a2729b5efb839de48b2ebd52b792dfa84 (diff) | |
download | vyos-1x-9b4447f039655b9e24187302b9c4d9bb2116aa99.tar.gz vyos-1x-9b4447f039655b9e24187302b9c4d9bb2116aa99.zip |
[pppoe-server] T1408 - improve verify() function to enable IPv6 only deployments
-rwxr-xr-x | src/conf_mode/accel_pppoe.py | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/conf_mode/accel_pppoe.py b/src/conf_mode/accel_pppoe.py index 7a9878a1d..9d2efb0bc 100755 --- a/src/conf_mode/accel_pppoe.py +++ b/src/conf_mode/accel_pppoe.py @@ -83,17 +83,19 @@ master=1 [client-ip-range] disable +{% if ppp_gw %} [ip-pool] gw-ip-address={{ppp_gw}} {% if client_ip_pool %} {{client_ip_pool}} -{% endif %} +{% endif -%} {% if client_ip_subnets %} {% for sn in client_ip_subnets %} {{sn}} {% endfor %} {% endif %} +{% endif -%} {% if client_ipv6_pool %} [ipv6-pool] @@ -550,18 +552,14 @@ def verify(c): if c['authentication']['radiussrv'][rsrv]['secret'] == None: raise ConfigError('radius server ' + rsrv + ' needs a secret configured') - ### local ippool and gateway settings - - if not c['ppp_gw']: - raise ConfigError('pppoe-server local-ip required') - - if not c['client_ip_subnets'] and not c['client_ip_pool']: - print ("Warning: No pppoe client IP pool defined") + ### local ippool and gateway settings config checks - ### activate as soon as it is clear what to do migrate or depricate. - #if c['client_ip_pool']: - # print ("Warning: client-ip-pool (start|stop) is depricated, please use client-ip-pool subnet") - # sl.syslog(sl.LOG_NOTICE, "client-ip-pool start stop is depricated, please use client-ip-pool subnet") + if c['client_ip_subnets'] or c['client_ip_pool']: + if not c['ppp_gw']: + raise ConfigError('pppoe-server local-ip required') + + if c['ppp_gw'] and not c['client_ip_subnets'] and not c['client_ip_pool']: + print ("Warning: No pppoe client IPv4 pool defined") def generate(c): if c == None: |