Client behind NAT establishing connection
file /etc/rc.conf
openvpn_enable="YES"
openvpn_configfile="/usr/local/etc/openvpn/client/client.conf"
file /usr/local/etc/openvpn/client/client.conf
tls-client
dev tun
proto udp
remote 104.248.252.189 1194
nobind
user nobody
group nogroup
persist-key
persist-tun
key-direction 1
tls-auth /usr/local/etc/openvpn/client/ta.key 1
comp-lzo
verb 3
ca /usr/local/etc/openvpn/client/ca.crt
cert /usr/local/etc/openvpn/client/client.crt
key /usr/local/etc/openvpn/client/client.key
remote-cert-tls server
Server in cloud
file /etc/rc.conf
openvpn_configfile="/usr/local/etc/openvpn/server/server.conf"
file /usr/local/etc/openvpn/server/server.conf
cert /usr/local/etc/openvpn/server/issued/server.crt
key /usr/local/etc/openvpn/server/private/server.key
route 192.168.4.0 255.255.255.0
route 192.168.7.0 255.255.255.0
route 192.168.9.0 255.255.255.0
persist-tun
/usr/local/etc/openvpn/server/ccd/client
iroute 192.168.7.0 255.255.255.0
iroute 192.168.9.0 255.255.255.0
Sources:
- OpenVPN How To Guide: https://openvpn.net/community-resources/how-to/
- Static Key Mini-HOWTO: https://openvpn.net/community-resources/static-key-mini-howto/