OpenVPN explained

Logo Size:200px
Author:James Yonan
Developer:OpenVPN project / OpenVPN Inc.
Released:[1]
Programming Language:C
Platform:
Genre:VPN
License:GNU GPLv2[9]

OpenVPN is a virtual private network (VPN) system that implements techniques to create secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities. It implements both client and server applications.

OpenVPN allows peers to authenticate each other using pre-shared secret keys, certificates or username/password. When used in a multiclient-server configuration, it allows the server to release an authentication certificate for every client, using signatures and certificate authority.

It uses the OpenSSL encryption library extensively, as well as the TLS protocol, and contains many security and control features. As it uses a custom security protocol[10] that utilizes SSL/TLS for key exchange. It is capable of traversing network address translators (NATs) and firewalls.[11]

OpenVPN has been ported and embedded on several systems. For example, DD-WRT has the OpenVPN server function. SoftEther VPN, a multi-protocol VPN server, also has an implementation of the OpenVPN protocol.[12]

It was written by James Yonan and is free software, released under the terms of the GNU General Public License version 2 (GPLv2).[13] Additionally, commercial licenses are available.[14]

Architecture

Encryption

OpenVPN uses the OpenSSL library to provide encryption of both the data and control channels. It lets OpenSSL do all the encryption and authentication work, allowing OpenVPN to use all the ciphers available in the OpenSSL package. It can also use the HMAC packet authentication feature to add an additional layer of security to the connection (referred to as an "HMAC Firewall" by the creator). It can also use hardware acceleration to get better encryption performance.[15] [16] Support for mbed TLS is available starting from version 2.3.[17]

Authentication

OpenVPN has several ways to authenticate peers with each other. OpenVPN offers pre-shared keys, certificate-based, and username/password-based authentication. Preshared secret key is the easiest, and certificate-based is the most robust and feature-rich. In version 2.0, username/password authentications can be enabled, both with or without certificates. However, to make use of username/password authentications, OpenVPN depends on third-party modules.

Networking

OpenVPN can run over User Datagram Protocol (UDP) or Transmission Control Protocol (TCP) transports, multiplexing created SSL tunnels on a single TCP/UDP port[18] (RFC 3948 for UDP).[19]

From 2.3.x series on, OpenVPN fully supports IPv6 as a protocol of the virtual network inside a tunnel and the OpenVPN applications can also establish connections via IPv6.[20] It has the ability to work through most proxy servers (including HTTP) and is good at working through network address translation (NAT) and getting out through firewalls. The server configuration can "push" certain network configuration options to the clients. These include IP addresses, routing commands, and a few connection options. OpenVPN offers two types of interfaces for networking via the Universal TUN/TAP driver. It can create either a layer-3 based IP tunnel (TUN), or a layer-2 based Ethernet TAP that can carry any type of Ethernet traffic. OpenVPN can optionally use the LZO compression library to compress the data stream. Port 1194 is the official IANA assigned port number for OpenVPN. Newer versions of the program now default to that port. A feature in the 2.0 version allows for one process to manage several simultaneous tunnels, as opposed to the original "one tunnel per process" restriction on the 1.x series.

OpenVPN's use of common network protocols (TCP and UDP) makes it a desirable alternative to IPsec in situations where an ISP may block specific VPN protocols in order to force users to subscribe to a higher-priced, "business grade" service tier. For example, Comcast previously declared that their @Home product was, and had always been, designated as a residential service and did not allow the use of commercial applications. Their argument was that conducting remote work via a VPN can adversely affect the network performance of their regular residential subscribers. They offered an alternative, @Home Professional, which would cost more than the @Home product. So, anyone wishing to use a VPN would have to subscribe to a higher-priced, business-grade service tier.[21]

When OpenVPN uses Transmission Control Protocol (TCP) transports to establish a tunnel, performance will be acceptable only as long as there is sufficient excess bandwidth on the un-tunneled network link to guarantee that the tunneled TCP timers do not expire.[22] If this becomes untrue, performance falls off dramatically due to the TCP meltdown problem.[23] [24]

Security

OpenVPN offers various internal security features. It has up to 256-bit encryption through the OpenSSL library, although some service providers may offer lower rates, effectively providing some of the fastest VPN available to consumers. OpenVPN also supports Perfect Forward Secrecy (PFS), which regenerates encryption keys at set intervals, ensuring that even if one key is compromised, previous and future data remains secure. Additionally, OpenVPN can be configured with various encryption ciphers, such as ChaCha20 and AES-256.[25] It runs in userspace instead of requiring IP stack (therefore kernel) operation. OpenVPN has the ability to drop root privileges, use mlockall to prevent swapping sensitive data to disk, enter a chroot jail after initialization, and apply a SELinux context after initialization.

OpenVPN runs a custom security protocol based on SSL and TLS, rather than supporting IKE, IPsec, L2TP or PPTP.

OpenVPN supports the use of smart cards via PKCS#11-based cryptographic tokens.

Extensibility

OpenVPN can be extended with third-party plug-ins or scripts, which can be called at defined entry points.[26] [27] The purpose of this is often to extend OpenVPN with more advanced logging, enhanced authentication with username and passwords, dynamic firewall updates, RADIUS integration and so on. The plug-ins are dynamically loadable modules, usually written in C, while the scripts interface can execute any scripts or binaries available to OpenVPN. In the OpenVPN source code[28] there are some examples of such plug-ins, including a PAM authentication plug-in. Several third-party plug-ins also exist to authenticate against LDAP or SQL databases such as SQLite and MySQL.[29]

Header

This is an example for an OpenVPN control channel packet when HMAC based auth is enabled (tls-auth option in OpenVPN). Data channel packets, which carry IP traffic, have a different format. [30]

OpenVPN header format
OffsetsOctet0123
OctetBitstyle=width:2.6%0style=width:2.6%1style=width:2.6%2style=width:2.6%3style=width:2.6%4style=width:2.6%5style=width:2.6%6style=width:2.6%7style=width:2.6%8style=width:2.6%9style=width:2.6%10style=width:2.6%11style=width:2.6%12style=width:2.6%13style=width:2.6%14style=width:2.6%15style=width:2.6%16style=width:2.6%17style=width:2.6%18style=width:2.6%19style=width:2.6%20style=width:2.6%21style=width:2.6%22style=width:2.6%23style=width:2.6%24style=width:2.6%25style=width:2.6%26style=width:2.6%27style=width:2.6%28style=width:2.6%29style=width:2.6%30style=width:2.6%31
00OpcodeKeyIDSession ID
432Session ID
864Session IDHMAC
1296HMAC
⋮⋮
24192
28224HMACPacket ID
32256Packet IDNet Time
36288Net TimeMsg Array LenMessage Packet ID #
⋮⋮

Platforms

It is available on Solaris, Linux, OpenBSD, FreeBSD, NetBSD, QNX, macOS and Windows XP and later.[31] OpenVPN is available for mobile operating systems including Maemo,[32] Windows Mobile 6.5 and below,[33] iOS 3GS+ devices,[34] jailbroken iOS 3.1.2+ devices,[35] Android 4.0+ devices, and Android devices that have had the Cyanogenmod aftermarket firmware flashed[36] or have the correct kernel module installed.[37] It is not compatible with some mobile phone OSes, including Palm OS. It is not a "web-based" VPN shown as a web page such as Citrix or Terminal Services Web access; the program is installed independently and configured by editing text files manually, rather than through a GUI-based wizard. OpenVPN is not compatible with VPN clients that use the IPsec over L2TP or PPTP protocols. The entire package consists of one binary for both client and server connections, an optional configuration file, and one or more key files depending on the authentication method used.

Firmware implementations

OpenVPN has been integrated into several router firmware packages allowing users to run OpenVPN in client or server mode from their network routers. A router running OpenVPN in client mode, for example, allows any device on a network to access a VPN without needing the capability to install OpenVPN.

Notable firmware packages with OpenVPN integration include:

Notable firmware packages with OpenVPN integration!Firmware package!!Cost!!Developer!!References
DD-WRTFreeNewMedia-NET GmbH[38]
GargoyleFreeEric Bishop[39]
IPFireFreeIPFire Project[40]
OpenWrtFreeCommunity driven development[41]
OPNsenseFreeDeciso BV[42]
pfSenseFreeRubicon Communications, LLC (Netgate)
TomatoFreeKeith Moyer[43] [44]

OpenVPN has also been implemented in some manufacturer router firmware.

Software implementations

OpenVPN has been integrated into SoftEther VPN, an open-source multi-protocol VPN server, to allow users to connect to the VPN server from existing OpenVPN clients.

OpenVPN is also integrated into Vyos, an open-source routing operating system forked from the Vyatta software router.

Licensing

OpenVPN is available in two versions:

Detectability

OpenVPN connections can be easily detected using deep packet inspection,[49] [50] [51] based on known header data of the transmitted packets, regardless of the protocol or port used. While deep packet inspection does not allow determining the contents of the encrypted tunnel, it can be used to block the connection, identify communication participants, and log related data. This is particularly important when the use of VPN connections is prohibited in certain environments, for example, in countries where encrypted connections are banned, or under civil legislation when circumventing network blocks in corporate networks.[52] [53] [54] [55] [56]

See also

External links

Notes and References

  1. OpenVPN Change Log - OpenVPN Release Notes
  2. Web site: Downloads. openvpn.net. 27 January 2023.
  3. Web site: OpenVPN - Android Apps on Google Play.
  4. Web site: Private Tunnel VPN. https://web.archive.org/web/20150315013008/https://itunes.apple.com/us/app/private-tunnel-vpn/id854725970. dead. 15 March 2015. 23 October 2014. App Store.
  5. Web site: How to connect to Access Server from a Linux computer.
  6. Web site: FreeBSD Ports Search.
  7. Web site: OpenBSD Ports. https://web.archive.org/web/20090518020445/http://openports.se/net/openvpn. usurped. 18 May 2009.
  8. Web site: The NetBSD Packages Collection: net/openvpn.
  9. Web site: openvpn_COPYING at master · OpenVPN_openvpn. . 2019-07-30. https://archive.today/20190731031634/https://github.com/OpenVPN/openvpn/blob/master/COPYING. 31 July 2019. live. 2019-07-30.
  10. Web site: OpenVPN Security Overview. https://web.archive.org/web/20180821223435/https://openvpn.net/index.php/open-source/documentation/security-overview.html. 2018-08-21.
  11. Web site: Understanding Network Traversal Techniques . AnonymousVPNs.com . 2025-08-07.
  12. Web site: 6 open source tools for making your own VPN. Bischoff. Paul. 2018-08-31. Opensource.com. en. https://web.archive.org/web/20180831141210/https://opensource.com/article/18/8/open-source-tools-vpn. 2018-08-31. live. 2019-07-30.
  13. LinuxSecurity.com - OpenVPN: An Introduction and Interview with Founder, James Yonan
  14. https://openvpn.net/pricing/ openvpn.net: Pricing
  15. Book: Andrew Lockhart. Network Security Hacks: Tips & Tools for Protecting Your Privacy. 2006. O'Reilly Media, Inc.. 978-0-596-55143-8. 339.
  16. Book: 6net. IPv6 Deployment Guide. 2008. Javvin Technologies Inc.. 978-1-60267-005-1. 109.
  17. Overview of changes in OpenVPN v2.3 - ChangesInOpenvpn23 - OpenVPN Community
  18. OpenVPN man page, section "TLS Mode Options"
  19. Book: Petros Daras. Oscar Mayora. User Centric Media: First International Conference, UCMedia 2009, Venice, Italy, December 9-11, 2009, Revised Selected Papers. 2013. Springer Science & Business Media. 978-3-642-12629-1. 239.
  20. https://community.openvpn.net/openvpn/wiki/IPv6 OpenVPN community wiki
  21. Web site: OpenVPN VPN Protocol. 2021-06-24. privacyhq.com. en.
  22. Web site: Murray. Mike. https://web.archive.org/web/20210320203759/https://www.thegeekpub.com/271035/openvpn-mtu-finding-the-correct-settings. 20 March 2021. 20 July 2022. OPENVPN MTU: Finding The Correct Settings. live. The Geek Pub. 20 March 2021 .
  23. Web site: Why TCP Over TCP Is A Bad Idea. Olaf. Titz. 23 April 2001. 17 October 2015.
  24. 2005SPIE.6011..138H. Understanding TCP over TCP: effects of TCP tunneling on end-to-end throughput and latency. Honda, Osamu. Ohsaki, Hiroyuki. Imase, Makoto. Ishizuka, Mika. Murayama, Junichi. 8945952. Performance, Quality of Service, and Control of Next-Generation Communication and Sensor Networks III. 6011. October 2005. 10.1117/12.630496. 10.1.1.78.5815. Atiquzzaman. Mohammed. Balandin. Sergey I..
  25. Web site: 2023-11-29 . OpenVPN explained: Definition, how it works, and safety NordVPN . 2024-09-10 . nordvpn.com . de.
  26. Web site: OpenVPN script entry points. Openvpn.net. 30 July 2012. 9 August 2012. https://web.archive.org/web/20120809012329/http://openvpn.net/index.php/open-source/documentation/manuals/427-openvpn-22.html#lbAQ. dead.
  27. https://web.archive.org/web/20110728041758/http://openvpn.git.sourceforge.net/git/gitweb.cgi?p=openvpn%2Fopenvpn.git%3Ba%3Dblob%3Bf%3Dopenvpn-plugin.h%3Bhb%3DHEAD OpenVPN plug-in entry points for C based modules
  28. Web site: OpenVPN example plug-ins. Openvpn.git.sourceforge.net. 30 July 2012.
  29. https://community.openvpn.net/openvpn/wiki/RelatedProjects OpenVPN Community Wiki - Related Projects
  30. https://openvpn.github.io/openvpn-rfc/openvpn-wire-protocol.html OpenVPN Wire Protocol specification draft
  31. Web site: Downloads. openvpn.net. OpenVPN. 6 August 2015.
  32. Web site: OpenVPN Maemo package. Maemo.org. 30 July 2012.
  33. Web site: OpenVPN for PocketPC. Ovpnppc.ziggurat29.com. 1 April 2007. 30 July 2012. 20 September 2012. https://web.archive.org/web/20120920065335/http://ovpnppc.ziggurat29.com/ovpnppc-main.htm. dead.
  34. Web site: OpenVPN Connect. OpenVPN Technologies. 16 January 2013. 16 January 2013.
  35. Web site: GuizmOVPN - OpenVPN GUI for iPhone/iPad. guizmovpn.com. 30 September 2007. 30 September 2012.
  36. Web site: CHANGELOG at eclair from CyanogenMod's android_vendor_cyanogen. 7 July 2010. GitHub. cyanogen. 28 October 2010. Nexus One Cyanogenmod changelog
  37. Web site: How to setup and configure OpenVPN on Android rooted device | VPN blog is actual information about VPN. https://web.archive.org/web/20110526083443/https://vpnblog.info/android-openvpn-strongvpn.html. Vpnblog.info. 26 May 2011. dead.
  38. dd-wrt.com - OpenVPN
  39. https://www.gargoyle-router.com/wiki/doku.php?id=openvpn&s Gargoyle Wiki - OpenVPN
  40. https://www.ipfire.org/docs/configuration/services/openvpn IPFire OpenVPN Documentation
  41. Web site: OpenVPN - OpenWrt Wiki. openwrt.org. 2018-06-11.
  42. Web site: opnsense.org - OPNsense 17.1 Release Announcement. 9 August 2018. 6 August 2018. https://web.archive.org/web/20180806180814/https://opnsense.org/opnsense-17-1-released/. dead.
  43. Web site: TomatoVPN. Tomatovpn.keithmoyer.com. 30 July 2012.
  44. LinksysInfo.org – VPN build with Web GUI
  45. Web site: OpenVPN Product Comparison. 2017-01-15. 11 January 2017. https://web.archive.org/web/20170111081923/https://openvpn.net/index.php/access-server/section-faq-openvpn-as/general/225-compare-openvpn-community-and-enterprise-editions.html. dead.
  46. Web site: What is OpenVPN Access Server (OpenVPN-AS)?. 2017-01-15. 11 January 2017. https://web.archive.org/web/20170111140107/https://openvpn.net/index.php/access-server/section-faq-openvpn-as/general/133-what-is-openvpn-access-server.html. dead.
  47. Web site: Regarding chocolatey.org repository · Issue #2 · wget/chocolatey_package_openvpn. . 2017-01-16. 2017-01-16.
  48. Web site: Can I use a community OpenVPN client to connect to the Access Server?. 2017-01-16. 11 January 2017. https://web.archive.org/web/20170111124956/https://openvpn.net/index.php/access-server/section-faq-openvpn-as/client-configuration/140-can-i-use-open-source-openvpn-client-gui-to-connect-to-the-access-server.html. dead.
  49. Web site: Detecting VPN Traffic through Encapsulated TCP Behavior. 2025-08-07. www.petsymposium.org.
  50. Web site: Bypassing Deep Packet Inspection: Tunneling Traffic Over TLS VPN. 2025-08-07. www.linuxjournal.com.
  51. Web site: Study Shows OpenVPN Traffic Can Be Easily Identified and Blocked. 2025-08-07. cyberinsider.com . 22 March 2024 .
  52. Web site: Country-Based VPN Connection Restrictions: How to Bypass Them? - VPS Hosting, Webhosting a Dedikované Servery. 2025-08-07. mydreams.cz.
  53. Web site: What Is a VPN?. 2025-08-07. www.cyberhaven.com.
  54. Web site: VPN Blockers: Common Methods Used to Detect VPNs. 2025-08-07. ascendantusa.com . 12 February 2025 .
  55. Web site: Are VPNs Legal in Egypt? Navigating the Regulatory Landscape. 2025-08-07. eg.andersen.com . 28 March 2024 .
  56. Web site: Are VPNs Legal? Where You Can (and Can't) Use a VPN. 2025-08-07. nym.com . 25 April 2025 .