From 685e9fb19140d002bcae9f3b78d5bd0f33b172d0 Mon Sep 17 00:00:00 2001 From: DmitriyEshenko Date: Mon, 30 Dec 2019 11:50:15 +0000 Subject: l2tp: T1858: Delete deprecated outside-nexthop --- src/conf_mode/accel_l2tp.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/accel_l2tp.py b/src/conf_mode/accel_l2tp.py index 37fda2029..a7af9cc68 100755 --- a/src/conf_mode/accel_l2tp.py +++ b/src/conf_mode/accel_l2tp.py @@ -118,15 +118,15 @@ secret={{lns_shared_secret}} {% endfor -%} {% endif %} {% endif %} -{% if outside_nexthop %} -gw-ip-address={{outside_nexthop}} +{% if gateway_address %} +gw-ip-address={{gateway_address}} {% endif %} {% if authentication['mode'] == 'local' %} [chap-secrets] chap-secrets=/etc/accel-ppp/l2tp/chap-secrets -{% if outside_nexthop %} -gw-ip-address={{outside_nexthop}} +{% if gateway_address %} +gw-ip-address={{gateway_address}} {% endif %} {% endif %} @@ -181,7 +181,7 @@ dae-server={{authentication['radiusopt']['dae-srv']['ip-addr']}}:\ {{authentication['radiusopt']['dae-srv']['port']}},\ {{authentication['radiusopt']['dae-srv']['secret']}} {% endif -%} -gw-ip-address={{outside_nexthop}} +gw-ip-address={{gateway_address}} verbose=1 {% endif -%} @@ -290,7 +290,7 @@ def get_config(): 'mppe' : 'prefer' }, 'outside_addr' : '', - 'outside_nexthop' : '10.255.255.0', + 'gateway_address' : '10.255.255.0', 'dns' : [], 'dnsv6' : [], 'wins' : [], @@ -430,17 +430,17 @@ def get_config(): config_data['mtu'] = c.return_value('mtu') ### gateway address - if c.exists('outside-nexthop'): - config_data['outside_nexthop'] = c.return_value('outside-nexthop') + if c.exists('gateway-address'): + config_data['gateway_address'] = c.return_value('gateway-address') else: ### calculate gw-ip-address if c.exists('client-ip-pool start'): ### use start ip as gw-ip-address - config_data['outside_nexthop'] = c.return_value('client-ip-pool start') + config_data['gateway_address'] = c.return_value('client-ip-pool start') elif c.exists('client-ip-pool subnet'): ### use first ip address from first defined pool lst_ip = re.findall("\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}", c.return_values('client-ip-pool subnet')[0]) - config_data['outside_nexthop'] = lst_ip[0] + config_data['gateway_address'] = lst_ip[0] if c.exists('authentication require'): auth_mods = {'pap' : 'pap','chap' : 'auth_chap_md5', 'mschap' : 'auth_mschap_v1', 'mschap-v2' : 'auth_mschap_v2'} @@ -497,10 +497,6 @@ def verify(c): if not c['client_ip_pool'] and not c['client_ip_subnets']: raise ConfigError("set vpn l2tp remote-access client-ip-pool requires subnet or start/stop IP pool") - if not c['outside_nexthop']: - #raise ConfigError('set vpn l2tp remote-access outside-nexthop required') - print ("WARMING: set vpn l2tp remote-access outside-nexthop required") - ## check ipv6 if 'delegate_prefix' in c['client_ipv6_pool'] and not 'prefix' in c['client_ipv6_pool']: raise ConfigError("\"set vpn l2tp remote-access client-ipv6-pool prefix\" required for delegate-prefix ") -- cgit v1.2.3