summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-05-06 21:44:07 +0200
committerChristian Poessinger <christian@poessinger.com>2020-05-06 21:44:09 +0200
commited22334321d3b6f27b5d695a4f984257b909f78b (patch)
tree0f86605584c9a2c4d1d1b23ce7da86713cd9ffb7 /src/conf_mode
parentd55050dcb8806a982b0394dcde00c1814499d9f3 (diff)
downloadvyos-1x-ed22334321d3b6f27b5d695a4f984257b909f78b.tar.gz
vyos-1x-ed22334321d3b6f27b5d695a4f984257b909f78b.zip
sstp: T2392: add IPv6 DNS support
New command added: * set vpn sstp network-settings name-server 2001:db8::1111
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/vpn_sstp.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/conf_mode/vpn_sstp.py b/src/conf_mode/vpn_sstp.py
index 6d9496012..7c3e3f515 100755
--- a/src/conf_mode/vpn_sstp.py
+++ b/src/conf_mode/vpn_sstp.py
@@ -22,10 +22,10 @@ from copy import deepcopy
from stat import S_IRUSR, S_IWUSR, S_IRGRP
from vyos.config import Config
-from vyos import ConfigError
-from vyos.util import call, run, get_half_cpus
from vyos.template import render
-
+from vyos.util import call, run, get_half_cpus
+from vyos.validate import is_ipv4
+from vyos import ConfigError
sstp_conf = '/run/accel-pppd/sstp.conf'
sstp_chap_secrets = '/run/accel-pppd/sstp.chap-secrets'
@@ -40,6 +40,7 @@ default_config_data = {
'client_ipv6_delegate_prefix': [],
'client_gateway': '',
'dnsv4' : [],
+ 'dnsv6' : [],
'radius_server' : [],
'radius_acct_tmo' : '3',
'radius_max_try' : '3',
@@ -251,7 +252,11 @@ def get_config():
# read in network settings
conf.set_level(base_path + ['network-settings'])
if conf.exists(['name-server']):
- sstp['dnsv4'] = conf.return_values(['name-server'])
+ for name_server in conf.return_values(['name-server']):
+ if is_ipv4(name_server):
+ sstp['dnsv4'].append(name_server)
+ else:
+ sstp['dnsv6'].append(name_server)
if conf.exists(['mtu']):
sstp['mtu'] = conf.return_value(['mtu'])