Setting up Linode VPS as a VPN Server (via SoftEther)

In this post, I will show you how to setting up your Linode VPS as a VPN Server (via SoftEther).

After this, you Linode VPS can accept VPN dial-in.

Preparation

  • A Linode VPS with Gentoo Linux (no Linode VPS? Click link on the sidebar to register one)
  • SoftEther VPN Source Code download link

Configuration

Note: Do not enter “↵”, simply press ENTER.

Install SoftEther VPN

  1. Download the source code under /opt/. At the publish time, v4.24 is the latest version, and v4.20 is the latest stable version.

    Let’s using the latest version:

    cd /opt/
    wget http://www.softether-download.com/files/softether/v4.24-9652-beta-2017.12.21-tree/Source_Code/softether-src-v4.24-9652-beta.tar.gz
  2. Extract it to the current directiory:
    tar xvf softether-src-v4.24-9652-beta.tar.gz
  3. Configure, compile and install it:
    cd v4.24-9652
    ./configure
    make
    make install

    In the configuration step, it will ask you some questions, such as EULA, all answer 1 (yes, agree) if you want to continue.

If this step is successful, you can run the vpncmd, vpnserver, vpnclient and vpnbridge commands on your Linode VPS now.

Start the Server

Before configuring the server, we must start it as a daemon, it’s just a simple command:

vpnserver start

You can check if it’s listening on the network:

linode-gentoo-01 ~ # netstat -anop | grep vpnserver
tcp        0      0 0.0.0.0:5555            0.0.0.0:*               LISTEN      2034/vpnserver       off (0.00/0/0)
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      2034/vpnserver       off (0.00/0/0)
tcp        0      0 0.0.0.0:992             0.0.0.0:*               LISTEN      2034/vpnserver       off (0.00/0/0)
tcp        0      0 0.0.0.0:1194            0.0.0.0:*               LISTEN      2034/vpnserver       off (0.00/0/0)
tcp6       0      0 :::5555                 :::*                    LISTEN      2034/vpnserver       off (0.00/0/0)
tcp6       0      0 :::443                  :::*                    LISTEN      2034/vpnserver       off (0.00/0/0)
tcp6       0      0 :::992                  :::*                    LISTEN      2034/vpnserver       off (0.00/0/0)
tcp6       0      0 :::1194                 :::*                    LISTEN      2034/vpnserver       off (0.00/0/0)

Manage the Server

Connect to the server via command line

Here, we using the vpncmd command line management utility to configure the VPN server:

linode-gentoo-01 ~ # vpncmd
vpncmd command - SoftEther VPN Command Line Management Utility
SoftEther VPN Command Line Management Utility (vpncmd command)
Version 4.24 Build 9652   (English)
Compiled 2017/12/21 10:34:43 by yagi at pc33
Copyright (c) SoftEther VPN Project. All Rights Reserved.

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↵

Specify the host name or IP address of the computer that the destination VPN Server or VPN Bridge is operating on.
By specifying according to the format 'host name:port number', you can also specify the port number.
(When the port number is unspecified, 443 is used.)
If nothing is input and the Enter key is pressed, the connection will be made to the port number 8888 of localhost (this computer).
Hostname of IP Address of Destination: ↵

If connecting to the server by Virtual Hub Admin Mode, please input the Virtual Hub name.
If connecting by server admin mode, please press Enter without inputting anything.
Specify Virtual Hub Name: ↵
Connection has been established with VPN Server "localhost" (port 443).

You have administrator privileges for the entire VPN Server.

VPN Server>

Create a hub (virtual Ethernet switch)

We will create a switch named “Fulong”.

VPN Server>HubCreate↵
HubCreate command - Create New Virtual Hub
Name of Virtual Hub to be created: Fulong↵

Please enter the password. To cancel press the Ctrl+D key.

Password: ******↵
Confirm input: ******↵


The command completed successfully.

VPN Server>

Select a hub

You can hold multiple hubs in one VPN server, so you must select a hub before proceeding:

VPN Server>Hub Fulong↵
Hub command - Select Virtual Hub to Manage
The Virtual Hub "Fulong" has been selected.
The command completed successfully.

VPN Server/Fulong>

Create a user on a hub

Except the hub, you also need to special which user connects to the VPN server, so let’s create a user:

VPN Server/Fulong>UserCreate↵
UserCreate command - Create User
User Name: fulong↵

Assigned Group Name: ↵

User Full Name: ↵

User Description: ↵

The command completed successfully.

VPN Server/Fulong>UserPasswordSet↵
UserPasswordSet command - Set Password Authentication for User Auth Type and Set Password
User Name: fulong↵

Please enter the password. To cancel press the Ctrl+D key.

Password: ******↵
Confirm input: ******↵


The command completed successfully.

VPN Server/Fulong>

What’s next?

Now, your Linode VPS is acts as a VPN Server now.

Next, your can set your PC, mobile, or even the Linode VPS itself to connect to the VPN server.

Comments

Leave a Reply

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