Add ocserv role

Create a self-signed CA, set up group configs, add script to allow new
connections through the firewall.

In the base debian role, drop the default nftables forward chain with
drop policy because it clashes with this. If you enable forwarding on
a debian host, make sure to configure the firewall.
This commit is contained in:
Timotej Lazar 2025-04-12 18:09:02 +02:00
parent a1c7be8184
commit cf6b682cf8
9 changed files with 177 additions and 8 deletions

View file

@ -0,0 +1,3 @@
{% for route in item.value %}
route = {{ route }}
{% endfor %}

View file

@ -0,0 +1,26 @@
listen-host = {{ dns_name }}
tcp-port = 443
server-cert = /etc/letsencrypt/live/{{ dns_name }}/fullchain.pem
server-key = /etc/letsencrypt/live/{{ dns_name }}/privkey.pem
run-as-user = ocserv
run-as-group = ocserv
socket-file = /run/ocserv-socket
chroot-dir = /var/lib/ocserv
connect-script = /usr/local/bin/ocserv-script
disconnect-script = /usr/local/bin/ocserv-script
device = vpns
cisco-client-compat = true
dtls-legacy = true
compression = true
isolate-workers = true
auth = certificate
ca-cert = /etc/ocserv/ca.crt
cert-user-oid = 2.5.4.3
cert-group-oid = 2.5.4.11
config-per-group = /etc/ocserv/config-per-group/
default-domain = {{ domain }}
ipv4-network = {{ vpn.network }}
route = {{ vpn.network }}