How to Install OpenVPN on Clear Linux Latest

OpenVPN is an open-source virtual private network (VPN) software that allows you to securely connect to a remote network over the internet. In this tutorial, we will guide you through the step-by-step installation of OpenVPN on Clear Linux Latest.

Prerequisites

Step 1: Install OpenVPN

  1. Open a terminal window by pressing Ctrl + Alt + T or using the application launcher.
  2. Update your system's package repository information:

sudo swupd update

  1. Install OpenVPN by running the following command:

sudo swupd bundle-add openvpn

Step 2: Configure OpenVPN

After installing OpenVPN, you need to configure it to work with your VPN settings. Follow the steps below to configure OpenVPN:

  1. Copy the sample OpenVPN configuration file to the /etc/openvpn directory:

sudo cp /usr/share/openvpn/examples/sample-config-files/server.conf /etc/openvpn/

  1. Uncomment these lines in the /etc/openvpn/server.conf file to enable TUN mode:
# Some examples don't show tun-ipv6 double fragment, but IPv6 fragmentation
# is a must, at least for PMTU discovery.
# And there is no harm in double fragment (occurs on the first fragment only)
# note that enabling this will disable UDP fast I/O.
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
  1. Uncomment the following line to enable the user and group settings:
# If you want to run multiple OpenVPN instances on the same machine,
# use a different port number for each one.  You will need to
# open up this port on your firewall.
port 1194
# TCP or UDP server?
;proto tcp
proto udp
# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an Ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
dev tun
;dev tap
;dev-node MyTap
  1. Uncomment the following lines to enable the server settings:
# server-bridge 192.168.1.100 255.255.255.0 192.168.1.120 192.168.1.130
# push "route 192.168.1.0 255.255.255.0"
  1. Uncomment the following lines to configure the certificate settings:
# See the server config file for more
# description.  It's best to use
# a separate .crt/.key file pair
# for each client.  A single ca
# file can be used for all clients.
# ca ca.crt
# cert server.crt
# key server.key
# Verify server certificate by checking that the `nsCertType` field
# contains the appropriate value.  To enable this feature,
# uncomment `ns-cert-type server` in the client config file.
# ns-cert-type server
  1. Save the file and close it.

Step 3: Start OpenVPN

  1. Start OpenVPN by running the following command:

sudo systemctl start openvpn-server@server

  1. Verify that OpenVPN is running by checking its status:

sudo systemctl status openvpn-server@server

You should see an output similar to the following:

● openvpn-server@server.service - OpenVPN service for server
  Loaded: loaded (/usr/lib/systemd/system/openvpn-server@.service; disabled; vendor preset: enabled)
  Active: active (running) since Mon 2021-08-02 08:15:30 IDT; 2min 22s ago
    Docs: man:openvpn(8)
          https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
          https://community.openvpn.net/openvpn/wiki/HOWTO
Main PID: 4695 (openvpn)
  Status: "Initialization Sequence Completed"
  Tasks: 1 (limit: 9830)
  Memory: 1.3M
  CGroup: /system.slice/system-openvpn\x2dserver.slice/openvpn-server@server.service
          └─4695 /usr/sbin/openvpn --cd /etc/openvpn --config server.conf

Aug 02 08:15:30 clearlinux systemd[1]: Starting OpenVPN service for server...
Aug 02 08:15:30 clearlinux systemd[1]: Started OpenVPN service for server.

Step 4: Enable OpenVPN at Startup

  1. Enable OpenVPN to run at startup by running the following command:

sudo systemctl enable openvpn-server@server

Conclusion

You have successfully installed and configured OpenVPN on Clear Linux Latest. You can now connect to your VPN by using the OpenVPN client software and providing the server's IP address or hostname, port, and credentials.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!