Convert Figma logo to code with AI

OpenVPN logoopenvpn

OpenVPN is an open source VPN daemon

10,611
2,959
10,611
129

Top Related Projects

Cross-platform multi-protocol VPN software. Pull requests are welcome. The stable version is available at https://github.com/SoftEtherVPN/SoftEtherVPN_Stable.

Mirror only. Official repository is at https://git.zx2c4.com/wireguard-linux

4,404

Enterprise VPN server

28,648

Set up a personal VPN in the cloud

23,174

Streisand sets up a new server running your choice of WireGuard, OpenConnect, OpenSSH, OpenVPN, Shadowsocks, sslh, Stunnel, or a Tor bridge. It also generates custom instructions for all of these services. At the end of the run you are given an HTML file with instructions that can be shared with friends, family members, and fellow activists.

Set up your own OpenVPN server on Debian, Ubuntu, Fedora, CentOS or Arch Linux.

Quick Overview

OpenVPN is an open-source virtual private network (VPN) system that implements techniques to create secure point-to-point or site-to-site connections in routed or bridged configurations. It uses a custom security protocol that utilizes SSL/TLS for key exchange and is capable of traversing network address translators (NATs) and firewalls.

Pros

  • Strong security features, including OpenSSL encryption and various authentication methods
  • Cross-platform compatibility (Windows, macOS, Linux, iOS, Android)
  • Highly configurable and flexible for various network setups
  • Active community and regular updates

Cons

  • Can be complex to set up and configure, especially for beginners
  • Performance overhead due to encryption and tunneling
  • Requires administrative privileges for installation and configuration
  • Some countries or ISPs may block OpenVPN traffic

Code Examples

  1. Basic client configuration:
client
dev tun
proto udp
remote example.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
remote-cert-tls server
cipher AES-256-CBC
verb 3

This example shows a basic OpenVPN client configuration file.

  1. Server configuration with routing:
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
keepalive 10 120
cipher AES-256-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3

This example demonstrates a server configuration with routing and DNS settings.

  1. Connecting to a server using the command line:
openvpn --config client.ovpn

This command connects to an OpenVPN server using a client configuration file.

Getting Started

To get started with OpenVPN:

  1. Install OpenVPN on your system:

    # For Ubuntu/Debian
    sudo apt-get install openvpn
    
    # For macOS (using Homebrew)
    brew install openvpn
    
  2. Generate certificates and keys:

    # Generate a static key for testing
    openvpn --genkey --secret static.key
    
  3. Create a basic client configuration file (client.ovpn) and add your server details and certificates.

  4. Connect to the server:

    sudo openvpn --config client.ovpn
    

For more detailed setup instructions, refer to the official OpenVPN documentation.

Competitor Comparisons

Cross-platform multi-protocol VPN software. Pull requests are welcome. The stable version is available at https://github.com/SoftEtherVPN/SoftEtherVPN_Stable.

Pros of SoftEtherVPN

  • Multi-protocol support (OpenVPN, L2TP/IPsec, SSTP, and more)
  • Built-in NAT traversal and Dynamic DNS functionality
  • User-friendly GUI for configuration and management

Cons of SoftEtherVPN

  • Less widespread adoption and community support
  • Potentially more complex setup for basic use cases
  • Limited third-party audits compared to OpenVPN

Code Comparison

SoftEtherVPN configuration example:

LIST *o = ParseCommandList(c, cmd, "");
if (o == NULL)
{
    return ERR_INVALID_PARAMETER;
}

OpenVPN configuration example:

if (!push_option(options, &o->gc, string, msglevel, &option_types_found))
{
    goto err;
}

Both projects use C for core functionality, but SoftEtherVPN tends to have more complex code structures due to its multi-protocol support. OpenVPN's codebase is generally more focused and streamlined for its specific protocol.

SoftEtherVPN offers greater flexibility with its multi-protocol support and built-in features, making it suitable for diverse network environments. However, OpenVPN's widespread adoption, extensive community support, and focused development make it a more reliable choice for many users, especially those seeking a straightforward VPN solution.

Mirror only. Official repository is at https://git.zx2c4.com/wireguard-linux

Pros of WireGuard

  • Significantly faster performance and lower latency
  • Simpler codebase and easier to audit for security
  • More efficient battery usage on mobile devices

Cons of WireGuard

  • Less mature and battle-tested compared to OpenVPN
  • Fewer configuration options and less flexibility
  • Limited support for older operating systems

Code Comparison

WireGuard configuration example:

[Interface]
PrivateKey = <private_key>
Address = 10.0.0.1/24
ListenPort = 51820

[Peer]
PublicKey = <public_key>
AllowedIPs = 10.0.0.2/32

OpenVPN configuration example:

client
dev tun
proto udp
remote example.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key

WireGuard's configuration is notably more concise and straightforward compared to OpenVPN's. This simplicity extends throughout the codebase, making WireGuard easier to implement and maintain. However, OpenVPN's extensive configuration options provide greater flexibility for complex network setups.

4,404

Enterprise VPN server

Pros of Pritunl

  • User-friendly web interface for easier management
  • Built-in multi-factor authentication support
  • Seamless integration with cloud platforms like AWS and Azure

Cons of Pritunl

  • Less mature and battle-tested compared to OpenVPN
  • Smaller community and ecosystem
  • Limited customization options for advanced users

Code Comparison

OpenVPN configuration example:

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key

Pritunl configuration example (in JSON format):

{
  "bind_addr": "0.0.0.0",
  "port": 1194,
  "protocol": "udp",
  "dh_param_bits": 2048
}

Both projects use similar configuration parameters, but Pritunl uses a JSON-based format, while OpenVPN uses a more traditional configuration file format. OpenVPN's configuration is generally more verbose and allows for more fine-grained control, while Pritunl's approach is more streamlined and easier to manage through its web interface.

Pritunl offers a more modern, user-friendly approach to VPN management, making it attractive for organizations looking for an easy-to-deploy solution. However, OpenVPN's maturity, extensive documentation, and large community make it a more robust choice for users who require advanced customization and have the technical expertise to manage it.

28,648

Set up a personal VPN in the cloud

Pros of algo

  • Simpler setup and configuration process
  • Focuses on modern, secure protocols (WireGuard, IKEv2)
  • Automated deployment to cloud providers

Cons of algo

  • Limited customization options
  • Supports fewer platforms and devices
  • Less extensive documentation and community support

Code comparison

algo:

def deploy_strongswan(self):
    self.copy_ipsec_files()
    self.configure_ipsec()
    self.configure_strongswan()
    self.start_strongswan()

openvpn:

static void
do_init_first_time(void)
{
    /* initialize random number generator */
    prng_init(NULL, 0);
    /* initialize allocation tracking */
    dmalloc_init();
}

The algo project uses Python for its deployment scripts, focusing on automation and ease of use. OpenVPN, written in C, provides lower-level control and performance optimization.

algo is designed for quick, secure deployments with minimal configuration, while OpenVPN offers more flexibility and customization options. OpenVPN has a larger user base and more extensive documentation, but algo simplifies the VPN setup process for users who prioritize modern protocols and cloud deployments.

23,174

Streisand sets up a new server running your choice of WireGuard, OpenConnect, OpenSSH, OpenVPN, Shadowsocks, sslh, Stunnel, or a Tor bridge. It also generates custom instructions for all of these services. At the end of the run you are given an HTML file with instructions that can be shared with friends, family members, and fellow activists.

Pros of Streisand

  • Automated setup of multiple VPN protocols and services
  • Includes additional privacy-enhancing tools like Tor and Shadowsocks
  • Designed for ease of use and quick deployment on cloud platforms

Cons of Streisand

  • Less flexible for custom configurations compared to OpenVPN
  • May include unnecessary services for some users
  • Potentially larger attack surface due to multiple services

Code Comparison

OpenVPN configuration example:

proto udp
port 1194
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem

Streisand Ansible playbook excerpt:

- name: Install OpenVPN
  apt:
    name: openvpn
    state: present

- name: Generate OpenVPN configuration
  template:
    src: openvpn-server.conf.j2
    dest: /etc/openvpn/server.conf

While OpenVPN focuses solely on its VPN protocol, Streisand automates the deployment of multiple privacy tools. OpenVPN offers more granular control over its configuration, whereas Streisand prioritizes ease of use and quick setup. The code comparison shows OpenVPN's direct configuration approach versus Streisand's use of Ansible for automated deployment.

Set up your own OpenVPN server on Debian, Ubuntu, Fedora, CentOS or Arch Linux.

Pros of openvpn-install

  • Simplified installation process with an easy-to-use script
  • Automated setup of OpenVPN server and client configurations
  • Regular updates and active community support

Cons of openvpn-install

  • Limited customization options compared to the official OpenVPN repository
  • May not include all advanced features available in the core OpenVPN project
  • Potential security risks if not properly maintained or updated

Code Comparison

openvpn:

static void
do_init_frame_net(struct frame *frame)
{
  frame_reserve_frame_net(frame);
  frame->buf.len = 0;
}

openvpn-install:

if [[ -e /etc/debian_version ]]; then
    os="debian"
    group_name="nogroup"
elif [[ -e /etc/centos-release || -e /etc/redhat-release ]]; then
    os="centos"
    group_name="nobody"

The openvpn repository contains the core OpenVPN software implementation, while openvpn-install focuses on providing a user-friendly installation script. The code snippets highlight this difference, with openvpn showing low-level C code for frame handling, and openvpn-install demonstrating shell scripting for system detection and configuration.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

OpenVPN -- A Secure tunneling daemon

Copyright (C) 2002-2022 OpenVPN Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.


To get the latest release of OpenVPN, go to:

https://openvpn.net/community-downloads/

To Build and Install,

tar -zxf openvpn-<version>.tar.gz
cd openvpn-<version>
./configure
make
make install

or see the file INSTALL for more info.

For information on how to build OpenVPN on/for Windows with MinGW or MSVC see README.cmake.md.


For detailed information on OpenVPN, including examples, see the man page http://openvpn.net/man.html

For a sample VPN configuration, see http://openvpn.net/howto.html

To report an issue, see https://github.com/OpenVPN/openvpn/issues/new (Note: We recently switched to GitHub for reporting new issues, old issues can be found at: https://community.openvpn.net/openvpn/report)

For a description of OpenVPN's underlying protocol, see the file ssl.h included in the source distribution.


Other Files & Directories:

  • configure.ac -- script to rebuild our configure script and makefile.

  • sample/sample-scripts/verify-cn

    A sample perl script which can be used with OpenVPN's --tls-verify option to provide a customized authentication test on embedded X509 certificate fields.

  • sample/sample-keys/

    Sample RSA keys and certificates. DON'T USE THESE FILES FOR ANYTHING OTHER THAN TESTING BECAUSE THEY ARE TOTALLY INSECURE.

  • sample/sample-config-files/

    A collection of OpenVPN config files and scripts from the HOWTO at http://openvpn.net/howto.html


Note that easy-rsa and tap-windows are now maintained in their own subprojects. Their source code is available here:

https://github.com/OpenVPN/easy-rsa https://github.com/OpenVPN/tap-windows6

Community-provided Windows installers (MSI) and Debian packages are built from

https://github.com/OpenVPN/openvpn-build

See the INSTALL file for usage information.