summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/conf_mode/interfaces-openvpn.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/conf_mode/interfaces-openvpn.py b/src/conf_mode/interfaces-openvpn.py
index 9313e339b..155101f1d 100755
--- a/src/conf_mode/interfaces-openvpn.py
+++ b/src/conf_mode/interfaces-openvpn.py
@@ -264,7 +264,9 @@ compat-names
client_tmpl = """
### Autogenerated by interfaces-openvpn.py ###
+{% if ip -%}
ifconfig-push {{ ip }} {{ remote_netmask }}
+{% endif -%}
{% for route in push_route -%}
push "route {{ route }}"
{% endfor -%}
@@ -273,9 +275,9 @@ push "route {{ route }}"
iroute {{ net }}
{% endfor -%}
-{%- if disable %}
+{% if disable -%}
disable
-{% endif %}
+{% endif -%}
"""
default_config_data = {
@@ -886,11 +888,9 @@ def verify(openvpn):
#
subnet = openvpn['server_subnet'].replace(' ', '/')
for client in openvpn['client']:
- if not ip_address(client['ip']) in ip_network(subnet):
+ if client['ip'] and not ip_address(client['ip']) in ip_network(subnet):
raise ConfigError('Client IP "{}" not in server subnet "{}'.format(client['ip'], subnet))
-
-
return None
def generate(openvpn):