# OpenVPN Server Configuration
# Lambicall VPN Server - Ubuntu 22.04/24.04

port 1194
proto udp
dev tun

# Certificados y claves
ca /etc/openvpn/easy-rsa/pki/ca.crt
cert /etc/openvpn/easy-rsa/pki/issued/server.crt
key /etc/openvpn/easy-rsa/pki/private/server.key
dh /etc/openvpn/easy-rsa/pki/dh.pem
tls-auth /etc/openvpn/ta.key 0

# Red VPN
server 10.7.0.0 255.255.0.0
topology subnet

# Push routes to client
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"

# Client configuration directory
client-config-dir /etc/openvpn/ccd
ifconfig-pool-persist /var/log/openvpn/ipp.txt

# Connection settings
keepalive 10 120
cipher AES-256-GCM
auth SHA256
comp-lzo
max-clients 1000
user nobody
group nogroup
persist-key
persist-tun

# Logs
status /var/log/openvpn/openvpn-status.log
log-append /var/log/openvpn/openvpn.log
verb 3
mute 20

# Security
explicit-exit-notify 1
remote-cert-tls client

# Client-to-client communication
client-to-client

# Management interface (for monitoring)
management localhost 7505