diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-11-11 20:13:46 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-11-11 20:13:46 +0100 |
commit | 80375d2be96c53f2fa4a827f93105dc32931401f (patch) | |
tree | 0b805551a0d65cbec00857501e11e721fe0429ac /src/conf_mode/accel_l2tp.py | |
parent | 8abde544455dd158d080eb6ea7b7ed226b27965a (diff) | |
parent | c9c8cd50f4165c7f86e71a6723f0ebb3a2cbdaf5 (diff) | |
download | vyos-1x-80375d2be96c53f2fa4a827f93105dc32931401f.tar.gz vyos-1x-80375d2be96c53f2fa4a827f93105dc32931401f.zip |
Merge branch 'current' of github.com:vyos/vyos-1x into equuleus
* 'current' of github.com:vyos/vyos-1x:
ifconfig: T1793: extend set_speed_duplex() delta check
[OpenVPN]: T1704: Added uppercase entries of ncp-ciphers, since there seems to be a bug in OpenVPN client when comparing pushed cipher with local ncp cipher list
[OpenVPN]: T1704: Moved ncp-ciphers out of encryption block in config template
[OpenVPN]: T1704: Changed the description of ncp-ciphers in config
[OpenVPN]: T1704: Added function for ncp-ciphers, and ability to disable it. [OpenVPN]: T1704: Changed config structure for OpenVPN encryption to support ncp-ciphers. [OpenVPN]: T1704: Added migration scripts for interface 2-to-3
Intel QAT: T1788: Intel QAT implementation
ifconfig: T1793: add delta check on set_speed_duplex()
ifconfig: T1793: add delta check on set_flow_control()
Python/ifconfig: wireguard: remove trailing whitespaces
l2tp: T1747: automatically calculate gw-ip-address
QAT: T1788: Intel QAT implementation
Diffstat (limited to 'src/conf_mode/accel_l2tp.py')
-rwxr-xr-x | src/conf_mode/accel_l2tp.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/conf_mode/accel_l2tp.py b/src/conf_mode/accel_l2tp.py index 244a720db..37fda2029 100755 --- a/src/conf_mode/accel_l2tp.py +++ b/src/conf_mode/accel_l2tp.py @@ -125,6 +125,9 @@ gw-ip-address={{outside_nexthop}} {% if authentication['mode'] == 'local' %} [chap-secrets] chap-secrets=/etc/accel-ppp/l2tp/chap-secrets +{% if outside_nexthop %} +gw-ip-address={{outside_nexthop}} +{% endif %} {% endif %} [ppp] @@ -287,7 +290,7 @@ def get_config(): 'mppe' : 'prefer' }, 'outside_addr' : '', - 'outside_nexthop' : '', + 'outside_nexthop' : '10.255.255.0', 'dns' : [], 'dnsv6' : [], 'wins' : [], @@ -429,7 +432,16 @@ def get_config(): ### gateway address if c.exists('outside-nexthop'): config_data['outside_nexthop'] = c.return_value('outside-nexthop') - + 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') + 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] + if c.exists('authentication require'): auth_mods = {'pap' : 'pap','chap' : 'auth_chap_md5', 'mschap' : 'auth_mschap_v1', 'mschap-v2' : 'auth_mschap_v2'} for proto in c.return_values('authentication require'): |