blob: a47ca67867bcf277d1c15c47d0c7ab9b169cb173 [file] [log] [blame]
Zack Williamsbecdc0e2022-03-26 07:08:25 -07001# openvpn server.conf - {{ ansible_managed }}
2#
3{#
4SPDX-FileCopyrightText: © 2022 Open Networking Foundation <support@opennetworking.org>
5SPDX-License-Identifier: Apache-2.0
6#}
7
8# accounts and privilege dropping
9user nobody
10group {{ openvpn_groupname }}
11persist-key
12persist-tun
13
14# security
15tls-server
16tls-version-min 1.3
17cipher AES-256-GCM
18auth SHA256
19
20# CA
21ca {{ openvpn_conf_dir }}/server/chain.pem
22crl-verify {{ openvpn_conf_dir }}/server/ca.crl
23
24# openVPN server
25cert {{ openvpn_conf_dir }}/server/openvpn_server.pem
26key {{ openvpn_conf_dir }}/server/openvpn_server.key
27dh {{ openvpn_conf_dir }}/server/dh.pem
28
29# shared auth
30tls-auth {{ openvpn_conf_dir }}/server/ta.key 0
31
32# must connect with a verified client cert
33opt-verify
34remote-cert-tls client
35verify-client-cert require
36tls-cert-profile preferred
37
38# Connection
39dev openvpn
40dev-type tun
41local {{ openvpn_listen_ip }}
42port 1194
43proto udp
44keepalive 10 120
45max-clients 100
46opt-verify
47
48# IP config
49topology subnet
50server {{ openvpn_subnet_cidr | ipaddr('network') }} {{ openvpn_subnet_cidr | ipaddr('netmask') }}
51
52# DHCP config
53{% for dnsserv in openvpn_dns_servers %}
54push "dhcp-option DNS {{ dnsserv }}"
55{% endfor %}
56
57# routes
58{% for route in openvpn_routes %}
59push "route {{ route | ipaddr('network') }} {{ route | ipaddr('netmask') }}"
60{% endfor %}
61
62# notify clients on server restart
63explicit-exit-notify 1
64
65# logging
66verb 4
67mute 20
68status {{ openvpn_log_dir }}/status.log
69ifconfig-pool-persist {{ openvpn_log_dir }}/ipp.txt