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