summaryrefslogtreecommitdiff
path: root/src/conf_mode/vpn_pptp.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-22 08:16:11 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-22 08:16:11 +0200
commitfbdafa2987edece3dfff516f0f13f91a8dd5cb86 (patch)
tree4d3f7303f5f6d3c8e22fa2d88d7a2ded7fc6c907 /src/conf_mode/vpn_pptp.py
parent05f839574b101bdea4d91740834479811a271e11 (diff)
downloadvyos-1x-fbdafa2987edece3dfff516f0f13f91a8dd5cb86.tar.gz
vyos-1x-fbdafa2987edece3dfff516f0f13f91a8dd5cb86.zip
vpn: pptp: T2351: use first IP from client pool as gateway address
Diffstat (limited to 'src/conf_mode/vpn_pptp.py')
-rwxr-xr-xsrc/conf_mode/vpn_pptp.py9
1 files changed, 4 insertions, 5 deletions
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)