summaryrefslogtreecommitdiff
path: root/src/conf_mode/accel_pppoe.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-06-17 20:13:13 +0200
committerDaniil Baturin <daniil@baturin.org>2019-06-17 20:13:13 +0200
commit8b66a1775fc9cf508195ec5c49c9e3516f37a23a (patch)
treeb1f213f7871c684af572c5338d23cd5b315463c1 /src/conf_mode/accel_pppoe.py
parent7f06879361999e3b3aab6f66bb267841d958bfdb (diff)
parent0f354688d7bd63b63fb91faf17a38c77fb05f660 (diff)
downloadvyos-1x-8b66a1775fc9cf508195ec5c49c9e3516f37a23a.tar.gz
vyos-1x-8b66a1775fc9cf508195ec5c49c9e3516f37a23a.zip
Merge branch 'current' of https://github.com/vyos/vyos-1x into current
Diffstat (limited to 'src/conf_mode/accel_pppoe.py')
-rwxr-xr-xsrc/conf_mode/accel_pppoe.py22
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: