summaryrefslogtreecommitdiff
path: root/src/conf_mode/accel_pppoe.py
diff options
context:
space:
mode:
authorhagbard <vyosdev@derith.de>2018-11-22 10:35:42 -0800
committerhagbard <vyosdev@derith.de>2018-11-22 10:36:30 -0800
commitb7b45384b4398d1b4fa6ef94664eed600c9d71aa (patch)
tree7b350f88bfdf2e3202a5d0165da127441ee0c140 /src/conf_mode/accel_pppoe.py
parenta1b33575a316c36c3d2a1176154c00d68b99b803 (diff)
downloadvyos-1x-b7b45384b4398d1b4fa6ef94664eed600c9d71aa.tar.gz
vyos-1x-b7b45384b4398d1b4fa6ef94664eed600c9d71aa.zip
T835: accel-ppp: pppoe implementation
- verify if an auth mode is set and if its local checking that a user and password for chap-secrets exists.
Diffstat (limited to 'src/conf_mode/accel_pppoe.py')
-rwxr-xr-xsrc/conf_mode/accel_pppoe.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/conf_mode/accel_pppoe.py b/src/conf_mode/accel_pppoe.py
index 7f721f932..f0a7fcf96 100755
--- a/src/conf_mode/accel_pppoe.py
+++ b/src/conf_mode/accel_pppoe.py
@@ -368,7 +368,9 @@ def get_config():
config_data['snmp'] = 'enable-ma'
#### authentication mode local
-
+ if not c.exists('authentication mode'):
+ raise ConfigError('pppoe-server authentication mode required')
+
if c.exists('authentication mode local'):
if c.exists('authentication local-users username'):
for usr in c.list_nodes('authentication local-users username'):
@@ -478,13 +480,16 @@ def get_config():
def verify(c):
if c == None:
return None
-
- for usr in c['authentication']['local-users']:
- if not c['authentication']['local-users'][usr]:
- raise ConfigError('user ' + usr + ' has no password set')
+ if c['authentication']['mode'] == 'local':
+ if not c['authentication']['local-users']:
+ raise ConfigError('pppoe-server authentication local-users required')
+
+ for usr in c['authentication']['local-users']:
+ if not c['authentication']['local-users'][usr]['passwd']:
+ raise ConfigError('user ' + usr + ' requires a password')
if not c['ppp_gw']:
- raise ConfigError('pppoe gateway-ip required')
+ raise ConfigError('pppoe-server local-ip required')
if c['authentication']['mode'] == 'radius':
if len(c['authentication']['radiussrv']) == 0: