Setup OpenVPN on Fedora via Command Line

This tutorial explains how to set up OpenVPN on Fedora Linux through Command Line Interface, CLI.

If you want to set up the VPN through the Network Manager on Fedora Desktop version, find the setup guides here.

Initial Step: It is recommended to update the outdated packages on your system by running the sudo dnf check-update and dnf upgrade commands.

Step #1: Install OpenVPN by running the following command.

sudo dnf install openvpn

Fedora OpenVPN Setup

Step #2: Enter into the OpenVPN directory and download FastestVPN’s OpenVPN server config files by running these commands.

cd /etc/openvpn
sudo wget http://support.fastestvpn.com/download/fastestvpn_ovpn/ -O fastestvpn_ovpn.zip

Fedora OpenVPN Setup

Step #3: Unzip the downloaded files.

unzip fastestvpn_ovpn.zip

Note: If it says that “unzip command not found” then install unzip by entering sudo dnf install unzip and follow Step # 3 again.

Fedora OpenVPN Command Line

Step #4: Now copy the unzipped server files into the OpenVPN directory.

cp /etc/openvpn/tcp_files/* /etc/openvpn/ && cp /etc/openvpn/udp_files/* /etc/openvpn/

Fedora OpenVPN Command Line

Step #5: Enter ls so all the FastestVPN server files in the directory will be listed.
Fedora OpenVPN CLI Setup

Step #6: Connect to your desired TCP or UDP VPN server by entering sudo openvpn [your desired server name]

For example:

sudo openvpn uk1-udp.ovpn

Fedora OpenVPN CLI Setup

Step #7: It will require you to enter your credentials. Enter your FastestVPN Username and then Password.
Fedora VPN Command Line Setup
Step #8: Once the logs show “Initialization sequence completed” that means the VPN connection has been established.
Fedora OpenVPN CLI Setup
To disconnect from the VPN, press Ctrl+C in the same command line session, or in another session, enter sudo killall openvpn

To connect to another server, enter into the OpenVPN directory and follow Steps # 5 to 7.