summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-04 19:56:42 +0200
committerGitHub <noreply@github.com>2020-04-04 19:56:42 +0200
commit2364dac59628a801cec373c278860b258b014b46 (patch)
tree1a1835e1e39c2818ba06d3284b63e82aa28a413d
parent71030ad38014f4884a48df43fc4bfd54a4fd497a (diff)
parent11fdb20ca051a6e5083d0d321191033418e5f8f7 (diff)
downloadvyos-1x-2364dac59628a801cec373c278860b258b014b46.tar.gz
vyos-1x-2364dac59628a801cec373c278860b258b014b46.zip
Merge pull request #298 from jjakob/openvpn-multihome
openvpn: T2222: set 'multihome' option when local-host is unset
-rwxr-xr-xsrc/conf_mode/interfaces-openvpn.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/conf_mode/interfaces-openvpn.py b/src/conf_mode/interfaces-openvpn.py
index fb2d6e6d9..9bac4d759 100755
--- a/src/conf_mode/interfaces-openvpn.py
+++ b/src/conf_mode/interfaces-openvpn.py
@@ -66,6 +66,10 @@ proto {% if 'tcp-active' in protocol -%}tcp-client{% elif 'tcp-passive' in proto
local {{ local_host }}
{% endif %}
+{%- if mode == 'server' and protocol == 'udp' and not local_host %}
+multihome
+{% endif %}
+
{%- if local_port %}
lport {{ local_port }}
{% endif %}
@@ -308,7 +312,7 @@ default_config_data = {
'ncp_ciphers': '',
'options': [],
'persistent_tunnel': False,
- 'protocol': '',
+ 'protocol': 'udp',
'redirect_gateway': '',
'remote_address': '',
'remote_host': [],
@@ -512,8 +516,7 @@ def get_config():
# OpenVPN operation mode
if conf.exists('mode'):
- mode = conf.return_value('mode')
- openvpn['mode'] = mode
+ openvpn['mode'] = conf.return_value('mode')
# Additional OpenVPN options
if conf.exists('openvpn-option'):