Ready-to-use server

VPN solution built with OpenVPN® Community Edition

Open Source VPN solution

VPN solution built with OpenVPN® Community Edition screenshots

OpenVPN® Community Edition provides a full-featured open source SSL/TLS Virtual Private Network (VPN). The TurnKey Linux VPN software appliance leverages the open source 'openvpn-server', 'openvpn-client' and 'easy-rsa' software (developed by OpenVPN® Inc.) to support "site-to-site" or "gateway" access. "Site-to-site" can link 2 otherwise unconnected LANs; suitable for multi-site enterprise networks or linkage to an Amazon VPC. "Gateway" configuration can secure traffic across public and/or insecure wifi connections and/or provide a secure solution for remote work scenarios.

This appliance includes all the standard features in TurnKey Core, and on top of that:

  • OpenVPN® configurations:

    • Initialization hooks to configure common OpenVPN® deployments such as "site-to-site" server or client and gateway profiles.

    • All profiles support SSL/TLS certificates for authentication and key exchange.

    • Server and gateway deployments include a convenience script to add clients, generating all required keys and certificates, as well as a unified ovpn profile for clients to easily connect to the VPN.

    • Expiring obfuscated HTTPS urls can be created for clients to download their profiles (especially useful with mobile devices using a QR code scanner).

    • The server profile supports a private subnet configuration, enabling clients to reach servers behind the OpenVPN® server.

    • The gateway profile configures connecting clients to tunnel all their traffic through the VPN.

    • When adding clients in a server or gateway deployment, an optional parameter can be given to enable computers on a subnet behind the client to connect to the VPN.

    • For added security, OpenVPN® is configured to drop privilages, run in a chroot jail dedicated to CRL, and uses tls-auth for HMAC signature verification protecting againsts DoS attacks, port flooding, port scanning and buffer overflow vulnerabilities in the SSL/TLS implementation.

See the Usage documentation for further details, including Amazon VPC notes and cloudformation template.

Note: OpenVPN® is a registered trademark of OpenVPN® Inc. Neither TurnKey Linux nor this software appliance are affiliated with or endorsed by OpenVPN® Inc.

Potential issues caused by timezone mismatch

Some VPN client applications expect certificate timestamps to be in local time. However, by default, TurnKey servers use UTC time.

That can lead to the creation of certificates, which according to local time, are not yet valid. Under these circumstance, connection will fail.

To avoid that, please set the timezone for your TurnKey OpenVPN server prior to further configuration. To do that via the commandline:

dpkg-reconfigure tzdata

For further info re setting timezone, please see this TurnKey Blog post.

Credentials (passwords set at first boot)

  • Webmin, SSH: username root

Updates and v19 validation

OpenVPN Community Edition, Easy-RSA and iptables are installed and updated from Debian 13 Trixie's signed repositories. The appliance adds no third-party application package source. The focused v19 build, firstboot, authenticated tunnel, gateway data-path, restart and nonmutating updater checks are mapped in the v19 testing notes.

Stable version: 19.0 (changelog)

Usage details & Logging in for Administration

No default passwords: For security reasons there are no default passwords. All passwords are set at system initialization time.

Ignore SSL browser warning: browsers don't like self-signed SSL certificates, but this is the only kind that can be generated automatically. If you have a domain configured, then via Confconsole Advanced menu, you can generate free Let's Encypt SSL/TLS certificates.

Web - point your browser at either:

  1. http://12.34.56.789/ - not encrypted so no browser warning
  2. https://12.34.56.789/ - encrypted with self-signed SSL certificate

Username for OS system administration:

Login as root except on AWS marketplace which uses username admin.

  1. Point your browser to:
  2. Login with SSH client:
    ssh root@12.34.56.789
    

    Special case for AWS marketplace:

    ssh admin@12.34.56.789
    

* Replace 12.34.56.789 with a valid IP or hostname.

Documentation

Links of value:

Container Configuration Considerations

If your OpenVPN server or client is failing with errors like:

ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory

You are probably missing the tun0 interface, which is the network interface for your encrypted tunnel. Try these steps to see if you are able to start your VPN service:

service openvpn stop
mkdir /dev/net
mknod /dev/net/tun c 10 200
chmod 666 /dev/net/tun
service openvpn start

If your OpenVPN server starts successfully, you can add a startup script to create the tun0 interface at boot time:

#! /bin/sh
# Script originally developed by Wolfgang
### BEGIN INIT INFO
# Provides:          tun
# Required-Start:    $network
# Required-Stop:     $openvpn
# Default-Start:     S 1 2
# Default-Stop:      0 6
# Short-Description: Make a tun device.
# Description:       Create a tundev for openvpn
### END INIT INFO

# Aktionen
case "$1" in
    start)
        mkdir /dev/net
        mknod /dev/net/tun c 10 200
        chmod 666 /dev/net/tun
        ;;
    stop)

Then activate the script at boot time:

chmod 755 /etc/init.d/tun
update-rc.d tun defaults

Be sure to reboot your container to make sure that your VPN service starts properly.

OpenVPN Client as a Router

You may want your Turnkey Linux OpenVPN appliance to connect to an OpenVPN Server or Gateway in order to route network traffic. Example uses might be a Site-to-Site VPN where the remote site (client) connects to the central office (server), or when securing the traffic of another host, such as a Turnkey Linux Torrent Server.

In either case, you will need to first set up your client.ovpn file as your OpenVPN default configuration file. You do this by copying the client.ovpn file to a .conf file in /etc/openvpn:

cp /root/client.ovpn /etc/openvpn/client.conf

 Then you want to make sure that the OpenVPN server starts successfully by:

openvpn --config /etc/openvpn/client.conf

Now you need to make sure that OpenVPN starts your client connection when the server boots by editing the OpenVPN configuration file and uncommenting the "client" autostart entry:

nano /etc/default/openvpn
AUTOSTART="client"

Note that the "AUTOSTART" value must match the name of the /etc/openvpn.conf file, without the ".conf" at the end. If your .ovpn file had a different name, like "user1.conf" you will have to change the value of AUTOSTART="user1"

Finally, you need to enable routing between the eth0 and the tun0 interface using IPTables:

iptables -A FORWARD -o tun0 -i eth0 -s 192.168.1.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE

Note that you will need to replace "192.168.1.0/24" with the IP and subnet of your local network.

At this point, you should be able to test your routing with another computer. You will need to set an IP address with a the default gateway that is the static IP address of your Turnkey Linux OpenVPN server. You can then access a website that will display your IP to you to make sure that your IP matches that of your VPN server rather than that of your ISP.

Once your IPTables rules are working and your traffic is routing, you need to save the rules to a specific file:

iptables-save | tee /etc/iptables.up.rules

The file name and path are important because the IPTables rules file already exists and is called when networking starts in /etc/network/interfaces, so don't change the name.

Other places to get (non TKL specific) OpenVPN info: