summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/conf_mode/vpn_l2tp.py52
1 files changed, 27 insertions, 25 deletions
diff --git a/src/conf_mode/vpn_l2tp.py b/src/conf_mode/vpn_l2tp.py
index cb4e44443..b5ad1c3c0 100755
--- a/src/conf_mode/vpn_l2tp.py
+++ b/src/conf_mode/vpn_l2tp.py
@@ -17,6 +17,7 @@
import os
import re
+from copy import deepcopy
from socket import AF_INET, SOCK_STREAM, socket
from sys import exit
from time import sleep
@@ -39,6 +40,31 @@ l2tp_conf = l2tp_cnf_dir + '/l2tp.config'
if not os.path.exists(l2tp_cnf_dir):
os.makedirs(l2tp_cnf_dir)
+
+default_config_data = {
+ 'authentication': {
+ 'mode': 'local',
+ 'local-users': {
+ },
+ 'radiussrv': {},
+ 'radiusopt': {},
+ 'auth_proto': [],
+ 'mppe': 'prefer'
+ },
+ 'outside_addr': '',
+ 'gateway_address': '10.255.255.0',
+ 'dns': [],
+ 'dnsv6': [],
+ 'wins': [],
+ 'client_ip_pool': None,
+ 'client_ip_subnets': [],
+ 'client_ipv6_pool': {},
+ 'mtu': '1436',
+ 'ip6_column': '',
+ 'ip6_dp_column': '',
+ 'ppp_options': {},
+}
+
###
# inline helper functions
###
@@ -78,33 +104,9 @@ def get_config():
return None
c.set_level(base)
-
- config_data = {
- 'authentication': {
- 'mode': 'local',
- 'local-users': {
- },
- 'radiussrv': {},
- 'radiusopt': {},
- 'auth_proto': [],
- 'mppe': 'prefer'
- },
- 'outside_addr': '',
- 'gateway_address': '10.255.255.0',
- 'dns': [],
- 'dnsv6': [],
- 'wins': [],
- 'client_ip_pool': None,
- 'client_ip_subnets': [],
- 'client_ipv6_pool': {},
- 'mtu': '1436',
- 'ip6_column': '',
- 'ip6_dp_column': '',
- 'ppp_options': {},
- }
+ config_data = deepcopy(default_config_data)
### general options ###
-
if c.exists('dns-servers server-1'):
config_data['dns'].append(c.return_value('dns-servers server-1'))
if c.exists('dns-servers server-2'):