diff options
author | Daniil Baturin <daniil@vyos.io> | 2021-12-30 21:13:04 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-30 21:13:04 +0700 |
commit | b7b5eecd30c740e49d9a6943a1f0e8099be732eb (patch) | |
tree | 977404f73ae4acc581c0202f0185d3b06cf53ced /src/conf_mode | |
parent | 8341dbb811abf37b8cf4caf20d9e05ed4fb7d61a (diff) | |
parent | 94ee47fdf975232de2855eb06adcff3403c4b5b8 (diff) | |
download | vyos-1x-b7b5eecd30c740e49d9a6943a1f0e8099be732eb.tar.gz vyos-1x-b7b5eecd30c740e49d9a6943a1f0e8099be732eb.zip |
Merge pull request #1125 from DmitriyEshenko/eq-1x-29122021-01
l2tp-server: T4117: Add dae-server configuration to template
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/vpn_l2tp.py | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/conf_mode/vpn_l2tp.py b/src/conf_mode/vpn_l2tp.py index 86aa9af09..fc6923b62 100755 --- a/src/conf_mode/vpn_l2tp.py +++ b/src/conf_mode/vpn_l2tp.py @@ -65,7 +65,7 @@ default_config_data = { 'radius_source_address': '', 'radius_shaper_attr': '', 'radius_shaper_vendor': '', - 'radius_dynamic_author': '', + 'radius_dynamic_author': {}, 'wins': [], 'ip6_column': [], 'thread_cnt': get_half_cpus() @@ -206,21 +206,21 @@ def get_config(config=None): l2tp['radius_source_address'] = conf.return_value(['source-address']) # Dynamic Authorization Extensions (DOA)/Change Of Authentication (COA) - if conf.exists(['dynamic-author']): + if conf.exists(['dae-server']): dae = { - 'port' : '', 'server' : '', + 'port' : '3799', 'key' : '' } - if conf.exists(['dynamic-author', 'server']): - dae['server'] = conf.return_value(['dynamic-author', 'server']) + if conf.exists(['dae-server', 'ip-address']): + dae['server'] = conf.return_value(['dae-server', 'ip-address']) - if conf.exists(['dynamic-author', 'port']): - dae['port'] = conf.return_value(['dynamic-author', 'port']) + if conf.exists(['dae-server', 'port']): + dae['port'] = conf.return_value(['dae-server', 'port']) - if conf.exists(['dynamic-author', 'key']): - dae['key'] = conf.return_value(['dynamic-author', 'key']) + if conf.exists(['dae-server', 'secret']): + dae['key'] = conf.return_value(['dae-server', 'secret']) l2tp['radius_dynamic_author'] = dae @@ -330,6 +330,12 @@ def verify(l2tp): if not radius['key']: raise ConfigError(f"Missing RADIUS secret for server { radius['key'] }") + if l2tp['radius_dynamic_author']: + if not l2tp['radius_dynamic_author']['server']: + raise ConfigError("Missing ip-address for dae-server") + if not l2tp['radius_dynamic_author']['key']: + raise ConfigError("Missing secret for dae-server") + # check for the existence of a client ip pool if not (l2tp['client_ip_pool'] or l2tp['client_ip_subnets']): raise ConfigError( |