How to set up Softether VPN client on Ubuntu 20.04 / Linux [Simple]

Muhammad Faizan
4 min readApr 3, 2021

--

VPN

If for any reason, you have to use the SoftEther VPN Client on Linux / Ubuntu environment then you would have noticed that right now there is no UI interface available by SoftEther VPN client for Linux environment. Only the command line tool is available to configure and connect to the VPN server, which is quite a complicated process.

To make things easier, I have written bash scripts to easily configure, connect/disconnect VPN. The scripts are available at my git repository here. Below I have mentioned the steps needed to properly set up the SoftEther VPN Client on Ubuntu / Linux.

Prerequisites:

  1. VPN User Account.
  2. VPN connection configurations (VPN Server Host name, Port and IPv4 address etc.). Note: If you don’t know the VPN Server Host IPv4 address, then you can easily find it using the command “nslookup <hostname>”, or simply visit the website (https://whatismyipaddress.com/hostname-ip).
  3. Linux (Ubuntu, Linux Mint etc.) machine.
  4. Make sure that IP forwarding is enabled in your system. Note: To check if IP forwarding is enabled, open terminal window, and run the following command:
cat /proc/sys/net/ipv4/ip_forward

If it returns ‘1’, then IP forwarding is enabled and you are good to go to Step 1. Otherwise, you need to enable IP forwarding in /etc/sysctl.conf file.

  • Open the file /etc/sysctl.conf in an editor (e.g. sudo gedit /etc/sysctl.conf).
  • Uncomment the line: net.ipv4.ip_forward=1. Save and close the file.
  • Run the following command in terminal: sysctl -p .

5. Find the local gateway of your system by running the command: sudo netstat -rn . Please note down the gateway IPv4 address, we will need it in step 2. In the following example, the gateway is: 192.168.0.1 .

Step 1: Download and extract SoftEther VPN Client

  1. Go to SoftEther official website (https://www.softether.org) and download the client for your machine. Navigate to Download > Download SoftEther VPN . Click on Download SoftEther VPN .
SoftEther Download Link

2. Make sure you have selected the correct CPU type.

SoftEther VPN Client Linux Download

3. Extract the downloaded tar.gz file to the location ~/softether.

Note: You can also extract it to any other location, but then you would need to update the location configurations in step 2 (in file: vpn_config). To extract the file, you can use the following commands:

mkdir ~/softethertar -xf softether-vpnclient-<version_info>.tar.gz -C ~/softether

Now, download the script files from my repository, and save them anywhere on your machine.

Step 2: Setup the SoftEther VPN Client

  1. Open terminal to the location where you have saved these script files.
  2. First, we need to set the configuration variables in the file named vpn_config. Open the file in your favourite editor and set the following variables:
  • CLIENT_DIR: The location of the SoftEther VPN Client extracted in step 1. e.g. /home/<username>/softether/vpnclient .
  • NIC_NAME: The name for virtual network interface. You can use the default one nic1 .
  • ACCOUNT_NAME: The name of the VPN Account. You can use any text here. e.g. cisco, cactusvpn etc.
  • VPN_HOST_IPv4: The VPN Server Host IP address, which is mentioned in prerequisites e.g. 169.123.123.123.
  • LOCAL_GATEWAY: The gateway IPv4 address which we noted in prerequisite#5. e.g. 192.168.0.1 .

3. Now, make sure the script files are marked as executables. You can review the scripts if you want to, for security concerns :)

You can run the following commands on the terminal to make them executables:

chmod +x ./setup-client.shchmod +x ./remove-client.shchmod +x ./vpn-connect.shchmod +x ./vpn-disconnect.sh

4. Run the first setup script, by running the command:

./setup-client.sh

Follow the instructions on the terminal, and provide the asked information.

  • Accept the License Agreement by entering 1.
  • Accept the Terms and conditions by entering 1.
  • Destination VPN Server Host Name and Port Number: <hostname>:<port> . e.g. vpn.intellexlab.com:443.
  • Destination Virtual Hub Name: <hub_name> . The hub name provided by your VPN provider.
  • Connecting User Name: <your_vpn_username> .
  • Used Virtual Network Adapter Name: <NIC_NAME>. The NIC name we set in vpn_config. e.g. nic1.
  • Password: <your_vpn_password> .
  • Specify standard or radius: radius . Or according to your VPN provider.

When done, review the output on the terminal window to see if there are any errors/issues. If not, continue to next step.

Step 3: Connect to the VPN

Since now everything is configured, you can connect to the VPN by running the command:

./vpn-connect.sh

Once completed, you should be able to browse the internet. Hurryyy!!!

Disconnect / Sign-Out

To disconnect from the VPN, simply run ./vpn-disconnect.sh. Next time, you want to connect again, just simply run ./vpn-connect.sh .

To permanently sign out your VPN account, first disconnect and then run ./remove-client.sh .

Disclaimer: Please use my scripts at your risk. Its working fine for me. If you face any issues, feel free to comment below.

--

--

Responses (1)