openvpn: Enable IPv6 for server and client outside the tunnel

This enables clients to connect to servers on IPv6 networks. After the
connection, the tunnel works just like before.

- Make sure that after upgrading the server configuration, if the server is
  running (which means it was enabled), restart the server to reflect the new
  configuration.

- Don't increment the app version number as it has already been incremented in
  this release cycle.

Tests:

- Check that the listen address before the change is 0.0.0.0:1194 and after
  upgrade (temporarily increment app version number again) the listen address
  automatically changes to *:1194.

- Download the new client profile and use it connect to the server on IPv4
  network and observe that there is error during connection.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2020-01-02 17:30:33 -08:00 committed by James Valleroy
parent 7de78071eb
commit 394588538e
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -50,6 +50,7 @@ ATTR_FILE = os.path.join(KEYS_DIRECTORY, 'pki', 'index.txt.attr')
SERVER_CONFIGURATION = '''
port 1194
proto udp
proto udp6
dev tun
client-to-client
ca /etc/openvpn/freedombox-keys/pki/ca.crt
@ -67,6 +68,7 @@ CLIENT_CONFIGURATION = '''
client
remote {remote} 1194
proto udp
proto udp6
dev tun
nobind
remote-cert-tls server
@ -209,6 +211,8 @@ def subcommand_upgrade(_):
action_utils.service_disable(OLD_SERVICE_NAME)
action_utils.service_enable(SERVICE_NAME)
action_utils.service_try_restart(SERVICE_NAME)
def _write_server_config():
"""Write server configuration."""