From fbdafa2987edece3dfff516f0f13f91a8dd5cb86 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 22 Apr 2020 08:16:11 +0200 Subject: vpn: pptp: T2351: use first IP from client pool as gateway address --- src/conf_mode/vpn_pptp.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/vpn_pptp.py b/src/conf_mode/vpn_pptp.py index d76cd4147..653b21161 100755 --- a/src/conf_mode/vpn_pptp.py +++ b/src/conf_mode/vpn_pptp.py @@ -194,8 +194,10 @@ def get_config(): if conf.exists(['gateway-address']): pptp['gw_ip'] = conf.return_value(['gateway-address']) else: - pptp['gw_ip'] = re.sub( - '[0-9]+$', '1', pptp['client_ip_pool']) + # calculate gw-ip-address + if conf.exists(['client-ip-pool', 'start']): + # use start ip as gw-ip-address + pptp['gateway_address'] = conf.return_value(['client-ip-pool', 'start']) if conf.exists(['authentication', 'require']): # clear default list content, now populate with actual CLI values @@ -246,9 +248,6 @@ def generate(pptp): if not pptp: return None - import pprint - pprint.pprint(pptp) - dirname = os.path.dirname(pptp_conf) if not os.path.exists(dirname): os.mkdir(dirname) -- cgit v1.2.3