# Sample OpenVPN configuration for a server using certificates
# Lines starting with # or ; are comments

# VPN subnet 10.8.0.0/24
#   Server will get IP 10.8.0.1,
#   Clients gets other IPs
server 10.8.0.0 255.255.255.0

# Connection settings
proto udp
;proto tcp
dev tun
port 1194

# Encryption and authentication schemes
cipher AES-256-CBC
auth SHA256

# Certificate of certificate authority
ca 		path-to-ca.crt

# Certificate, private-key, and password to private-key for the server
cert 		path-to-server.crt
key 		path-to-server.key  
# If the server's private key is password protected,
# you can provide the password using a password file.
askpass 	path-to-server-key-password.pass

# Do not cache password
auth-nocache

# Diffie-Hellman Key Exchange parameters
dh 		path-to-dh.pem


ifconfig-pool-persist /var/log/openvpn/ipp.txt

# Tell clients of the internal network/s.
push "route 192.168.1.0 255.255.255.0"
push "route 192.168.2.0 255.255.255.0"
push "route 192.168.3.0 255.255.255.0"

# Tell client to redirect all traffic to the VPN server.
;push "redirect-gateway def1 bypass-dhcp"

# Let clients see each other.
;client-to-client

# Allow multiple client connections using the same certificate.
;duplicate-cn

# Ping every 10s. If no response in 120s, terminate connection.
keepalive 10 120

# Compression of data
;compress lz4-v2
;push "compress lz4-v2"

;max-clients 100

# Lowers privilege of OpenVPN server post initialization
user nobody
group nogroup
# Allows restart of server when privileges has been lowered
persist-key
persist-tun

# Write current status to this file
status /var/log/openvpn/openvpn-status.log

# How/Where to log. Uncomment only one.
# Uncomment after having fixed your set-up.
# log: Overwrites old log.
# log-append: Adds to old log.
;log         /var/log/openvpn/openvpn.log
;log-append  /var/log/openvpn/openvpn.log

# Verbosity, 3 is good for debugging set-up
verb 3

# Do not repeat the same log message more thatn 20 times.
mute 20

# Run as daemon.
# Uncomment after having fixed your set-up.
;daemon
