The complete setup
Based on the previous examples, we can now construct a complete production-level setup using configuration files, including routing, logging, IPv6 support, as well as a few other production features that OpenVPN offers.
Consider the following network layout:
For the server, we create the following configuration file movpn-02-02-server.conf
:
dev tun proto udp local openvpnserver.example.com lport 1234 remote openvpnclient.example.com rport 4321 secret secret.key 0 ifconfig 10.200.0.1 10.200.0.2 route 192.168.4.0 255.255.255.0 tun-ipv6 ifconfig-ipv6 2001:610:120::200:0:1 2001:610:120::200:0:2 user nobody groupnobody # use 'group nogroup' on Debian/Ubuntu persist-tun persist-key keepalive 10 60 ping-timer-rem verb 3 daemon log-append /var/log/openvpn.log
For the client, we create the file movpn-02-02-client.conf
:
dev tun proto udp local openvpnclient.example.com lport 4321 remote openvpnserver.example.com rport 1234 secret secret.key 1 ifconfig 10.200.0...