Advance

How to Install SoftEther VPN Server on Ubuntu 20.04

How to Install SoftEther VPN Server on Ubuntu 20.04

If you want to access content that is fully protected under the Firewall network, SoftEther is a good choice for you. Also, if you are using the Internet with an unsecured connection, it is better to use the SoftEther VPN protocol to protect what you are trying to do. If you use this protocol, your geographic location will be registered from another country and you will be able to access limited content based on specific geographic locations. This article will teach you How to Install SoftEther VPN Server on Ubuntu 20.04. You can check out the packages offered on the Eldernode website to purchase your own Ubuntu VPS server.

Recommended Article: How to install NextCloud on CentOS 8

What is SoftEther VPN Server?

SoftEther VPN Protocol is a free, open-source, cross-platform, and multi-protocol VPN program that develops and distributes SoftEther VPN. It is an alternative to purchasing OpenVPN and other SSTP-based VPN protocols from Microsoft. This protocol provides high-speed and low-latency client access. VPN tunnels created by SoftEther VPN are highly secure and they have a very low risk of data vulnerability. Also, SoftEther VPN protocol offers AES and RSA encryptions, which have excellent performance, very high speed, and NAT and DNS capability.

In the continuation of this article from the Ubuntu training series, you will learn how to install the SoftEther VPN server on Ubuntu 20.04.

Prerequisites to Install SoftEther VPN Server on Ubuntu

Here are the prerequisites for the installation of SoftEther VPN Server on Ubuntu 20.04:

– Server running Ubuntu 20.04 server for VPN Server

– Server running Ubuntu 20.04 server for VPN client

– Configuring a root password on both servers

Install SoftEther VPN Server on Ubuntu 20.04

Let’s go to explain the installation method of the SoftEther VPN Server on Ubuntu 20.04. To do this just follow the steps below:

First of all update the system packages cache with the following command:

apt-get update

Now you should install other required dependencies by running the command below:

apt-get install build-essential gnupg2 gcc make

This step is the time to download the latest version of SoftEther VPN from its official website. Also, you can do this using the command below:

wget http://www.softether-download.com/files/softether/v4.38-9760-rtm-2021.08.17-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz

After the download is completed, extract the downloaded file by entering the following command:

tar -xvzf softether-vpnserver-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz

Go to the directory where you extracted the downloaded file to it. Then install the SoftEther VPN Server by running the following command:

cd vpnserveer
make

Next, you have to move the extracted directory to /ust/local directory as shown below:

cd ..
mv vpnserver /usr/local

And set proper permission to vpnserver directory:

cd /usr/local/vpnserver/
chmod 600 *
chmod 700 vpnserver
chmod 700 vpncmd

Creating a Systemd Service File for SoftEther VPN

You can manage the SoftEther VPN service by creating a systems service file. To do this, run the command below:

nano /etc/init.d/vpnserver

Now add the lines below:

#!/bin/sh  # chkconfig: 2345 99 01  # description: SoftEther VPN Server  DAEMON=/usr/local/vpnserver/vpnserver  LOCK=/var/lock/subsys/vpnserver  test -x $DAEMON || exit 0  case "$1" in  start)  $DAEMON start  touch $LOCK  ;;  stop)  $DAEMON stop  rm $LOCK  ;;  restart)  $DAEMON stop  sleep 3  $DAEMON start  ;;  *)  echo "Usage: $0 {start|stop|restart}"  exit 1  esac  exit 0

Save the file and close it.

Next, enter the command below to create the required directory and set proper permission to the systems service file:

mkdir /var/lock/subsys  chmod 755 /etc/init.d/vpnserver

To start the SoftEther VPN, run the following command:

/etc/init.d/vpnserver start

Finally, you can enable the SoftEther VPN service to start at system reboot. To do this, use the command below:

update-rc.d vpnserver defaults

How to Configure SoftEther VPN Server on Ubuntu 20.04

In this section, you will learn how to configure SoftEther VPN Server on Ubuntu 20.04.

First of all, you should change the directory to /usr/local/vpnserver using the following command:

cd /usr/local/vpnserver  ./vpncmd

If you are prompted to select a VPN component, type 1 and press Enter twice:

By using vpncmd program, the following can be achieved.    1. Management of VPN Server or VPN Bridge  2. Management of VPN Client  3. Use of VPN Tools (certificate creation and Network Traffic Speed Test Tool)    Select 1, 2 or 3: 1

Now you should set a password with the command below:

ServerPasswordSet

If you want to create a hub and set a password, enter the following command:

HubCreate myhub

To enter the hub, run the following command:

Hub myhub

You can allow the hub to work as a virtual LAN using the command below:

SecureNatEnable

Now it’s time to create a VPN user. To do this, run the following command:

UserCreate vpnuser

To set a password for a VPN user, use the following command:

UserPasswordSet vpnuser

You can get Multi-Protocol working by enabling the IPsec. To do this, run the command below:

IPsecEnable

Next, answer all the questions as shown below:

IPsecEnable command - Enable or Disable IPsec VPN Server Function  Enable L2TP over IPsec Server Function (yes / no): yes    Enable Raw L2TP Server Function (yes / no): yes    Enable EtherIP / L2TPv3 over IPsec Server Function (yes / no): yes    Pre Shared Key for IPsec (Recommended: 9 letters at maximum): vpnserver    Default Virtual HUB in a case of omitting the HUB on the Username: myhub    The command completed successfully.

To exit from the VPN configuration, just run the following command:

exit

In the last step, you should configure the UFW Firewall to allow ports 443, 5555, 992, and 1194 to pass using the command below:

ufw allow 443/tcp  ufw allow 5555/tcp  ufw allow 992/tcp  ufw allow 1194/udp

And reload the UFW firewall:

ufw reload

Installing SoftEther VPN Client on Ubuntu 20.04

Once you installed SoftEther VPN Server successfully, you need to install the SoftEther VPN client on the Client machine. First, install the required dependencies with the following command:

apt-get install build-essential gnupg2 gcc make

To download the latest version of the SoftEther VPN client, run the command below:

wget http://www.softether-download.com/files/softether/v4.38-9760-rtm-2021.08.17-tree/Linux/SoftEther_VPN_Client/64bit_-_Intel_x64_or_AMD64/softether-vpnclient-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz

Extract the downloaded file after the download is finished using the following command:

tar -xvzf softether-vpnclient-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz

Now you should create a directory to store the VPN client script by running the following command:

mkdir /root/vpnscript

Then navigate to the VPN script download page and download all scripts:

cd /root/vpnscript  
wget https://raw.githubusercontent.com/mfaizanse/intellexlab-files/main/softether-vpn-client/remove-client.sh
wget https://raw.githubusercontent.com/mfaizanse/intellexlab-files/main/softether-vpn-client/setup-client.sh  
wget https://raw.githubusercontent.com/mfaizanse/intellexlab-files/main/softether-vpn-client/vpn-connect.sh
wget https://raw.githubusercontent.com/mfaizanse/intellexlab-files/main/softether-vpn-client/vpn-disconnect.sh
wget https://raw.githubusercontent.com/mfaizanse/intellexlab-files/main/softether-vpn-client/vpn_config

After the download is completed, you should set proper permission to the downloaded script:

chmod 755 *3

Now you have to edit the vpn_config file and define your VPN client directory, VPN server IP, VPN username, and local gateway IP by running the following command:

nano vpn_config

And add the lines below:

CLIENT_DIR="/root/vpnclient"  NIC_NAME="Marilyn"  ACCOUNT_NAME="vpnuser"  VPN_HOST_IPv4="vpn-server-ip"  LOCAL_GATEWAY="gateway-ip-of-client-machine"

Save and close the file.

Now setup the VPN client using the following command:

./setup-client.sh

You should provide your VPN server IP, port, Hub name, VPN username, Virtual adapter name and password as you see below:

Connected to VPN Client "localhost".    VPN Client>AccountCreate vpnuser  AccountCreate command - Create New VPN Connection Setting  Destination VPN Server Host Name and Port Number: IpNumber:Port    Destination Virtual Hub Name: myhub    Connecting User Name: vpnuser    Used Virtual Network Adapter Name: Marilyn    The command completed successfully.    vpncmd command - SoftEther VPN Command Line Management Utility  SoftEther VPN Command Line Management Utility (vpncmd command)  Version 4.38 Build 9760 (English)  Compiled 2021/08/17 22:32:49 by buildsan at crosswin  Copyright (c) SoftEther VPN Project. All Rights Reserved.    Connected to VPN Client "localhost".    VPN Client>AccountPassword vpnuser  AccountPasswordSet command - Set User Authentication Type of VPN Connection Setting to Password Authentication  Please enter the password. To cancel press the Ctrl+D key.    Password: **********  Confirm input: **********      Specify standard or radius: radius    The command completed successfully.

To connect to the VPN server, run the command below:

./vpn-connect.sh

Finally, you will see a new VPN interface named vpn_Marilyn has been created. To check it, run the command below:

ifconfig
Recommended Article: Common Apache Errors Troubleshooting

Conclusion

SoftEther VPN Server is a VPN software and an alternative to OpenVPN and Microsoft VPN servers. In this article, we taught you how to install the SoftEther VPN server on Ubuntu 20.04. I hope this tutorial helps you to install the SoftEther VPN server on Ubuntu 20.04 and was useful for you. If you have any questions or problems, you can contact us in the Comments section.

View More Posts
Tom Veitch
Eldernode Writer
We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave a Reply

Your email address will not be published. Required fields are marked *

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day