Softether VPN Client for Ubuntu
Orion Electric Age

I. Download and Install

  • download softether linux client
    1
    2
    wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.38-9760-rtm/softether-vpnclient-v4.38-9760-rtm-2021.08.17-linux-arm64-64bit.tar.gz
    tar -xvf softether-vpnclient-v4.38-9760-rtm-2021.08.17-linux-arm64-64bit.tar.gz
  • install client and check
    1
    2
    cd vpnclient
    ./.install.sh
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    $ ./vpncmd 
    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.

    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: 3

    VPN Tools has been launched. By inputting HELP, you can view a list of the commands that can be used.

    VPN Tools>help
    You can use the following 6 commands:
    About - Display the version information
    Check - Check whether SoftEther VPN Operation is Possible
    MakeCert - Create New X.509 Certificate and Private Key (1024 bit)
    MakeCert2048 - Create New X.509 Certificate and Private Key (2048 bit)
    TrafficClient - Run Network Traffic Speed Test Tool in Client Mode
    TrafficServer - Run Network Traffic Speed Test Tool in Server Mode

    To reference the usage for each command, input "command name ?" to view a help.
    The command completed successfully.

    VPN Tools>check
    Check command - Check whether SoftEther VPN Operation is Possible
    ---------------------------------------------------
    SoftEther VPN Operation Environment Check Tool

    Copyright (c) SoftEther VPN Project.
    All Rights Reserved.

    If this operation environment check tool is run on a system and that system passes, it is most likely that SoftEther VPN software can operate on that system. This check may take a while. Please wait...

    Checking 'Kernel System'...
    Pass
    Checking 'Memory Operation System'...
    Pass
    Checking 'ANSI / Unicode string processing system'...
    Pass
    Checking 'File system'...
    Pass
    Checking 'Thread processing system'...
    Pass
    Checking 'Network system'...
    Pass

    All checks passed. It is most likely that SoftEther VPN Server / Bridge can operate normally on this system.

    The command completed successfully.

II. Config Client

  • start client
    1
    sudo /home/down/vpn/vpnclient/vpnclient start
  • vpncmd help
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    $ sudo ./vpncmd 
    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.

    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: 2

    Specify the host name or IP address of the computer that the destination VPN Client is operating on.
    If nothing is input and Enter is pressed, connection will be made to localhost (this computer).
    Hostname of IP Address of Destination:

    Connected to VPN Client "localhost".

    VPN Client>help
    You can use the following 66 commands:
    About - Display the version information
    AccountAnonymousSet - Set User Authentication Type of VPN Connection Setting to Anonymous Authentication
    AccountCertGet - Get Client Certificate to Use for Cascade Connection
    AccountCertSet - Set User Authentication Type of VPN Connection Setting to Client Certificate Authentication
    AccountCompressDisable - Disable Data Compression when Communicating by VPN Connection Setting
    AccountCompressEnable - Enable Data Compression when Communicating by VPN Connection Setting
    AccountConnect - Start Connection to VPN Server using VPN Connection Setting
    AccountCreate - Create New VPN Connection Setting
    AccountDelete - Delete VPN Connection Setting
    AccountDetailSet - Set Advanced Settings for VPN Connection Setting
    AccountDisconnect - Disconnect VPN Connection Setting During Connection
    AccountEncryptDisable - Disable Encryption when Communicating by VPN Connection Setting
    AccountEncryptEnable - Enable Encryption when Communicating by VPN Connection Setting
    AccountExport - Export VPN Connection Setting
    AccountGet - Get Setting of VPN Connection Setting
    AccountImport - Import VPN Connection Setting
    AccountList - Get List of VPN Connection Settings
    AccountNicSet - Set Virtual Network Adapter for VPN Connection Setting to Use
    AccountPasswordSet - Set User Authentication Type of VPN Connection Setting to Password Authentication
    AccountProxyHttp - Set Connection Method of VPN Connection Setting to be via an HTTP Proxy Server
    AccountProxyNone - Specify Direct TCP/IP Connection as the Connection Method of VPN Connection Setting
    AccountProxySocks - Set Connection Method of VPN Connection Setting to be via an SOCKS Proxy Server
    AccountRename - Change VPN Connection Setting Name
    AccountRetrySet - Set Interval between Connection Retries for Connection Failures or Disconnections of VPN Connection Setting
    AccountSecureCertSet - Set User Authentication Type of VPN Connection Setting to Smart Card Authentication
    AccountServerCertDelete - Delete Server Individual Certificate for VPN Connection Setting
    AccountServerCertDisable - Disable VPN Connection Setting Server Certificate Verification Option
    AccountServerCertEnable - Enable VPN Connection Setting Server Certificate Verification Option
    AccountServerCertGet - Get Server Individual Certificate for VPN Connection Setting
    AccountServerCertSet - Set Server Individual Certificate for VPN Connection Setting
    AccountSet - Set the VPN Connection Setting Connection Destination
    AccountStartupRemove - Remove Startup Connection of VPN Connection Setting
    AccountStartupSet - Set VPN Connection Setting as Startup Connection
    AccountStatusGet - Get Current VPN Connection Setting Status
    AccountStatusHide - Set Connection Status and Error Screen to be Hidden when Connecting to VPN Server
    AccountStatusShow - Set Connection Status and Error Screen to Display when Connecting to VPN Server
    AccountUsernameSet - Set User Name of User to Use Connection of VPN Connection Setting
    CertAdd - Add Trusted CA Certificate
    CertDelete - Delete Trusted CA Certificate
    CertGet - Get Trusted CA Certificate
    CertList - Get List of Trusted CA Certificates
    Check - Check whether SoftEther VPN Operation is Possible
    KeepDisable - Disable the Keep Alive Internet Connection Function
    KeepEnable - Enable the Keep Alive Internet Connection Function
    KeepGet - Get the Keep Alive Internet Connection Function
    KeepSet - Set the Keep Alive Internet Connection Function
    MakeCert - Create New X.509 Certificate and Private Key (1024 bit)
    MakeCert2048 - Create New X.509 Certificate and Private Key (2048 bit)
    NicCreate - Create New Virtual Network Adapter
    NicDelete - Delete Virtual Network Adapter
    NicDisable - Disable Virtual Network Adapter
    NicEnable - Enable Virtual Network Adapter
    NicGetSetting - Get Virtual Network Adapter Setting
    NicList - Get List of Virtual Network Adapters
    NicSetSetting - Change Virtual Network Adapter Setting
    NicUpgrade - Upgrade Virtual Network Adapter Device Driver
    PasswordGet - Get Password Setting to Connect to VPN Client Service
    PasswordSet - Set the password to connect to the VPN Client service.
    RemoteDisable - Deny Remote Management of VPN Client Service
    RemoteEnable - Allow Remote Management of VPN Client Service
    SecureGet - Get ID of Smart Card Type to Use
    SecureList - Get List of Usable Smart Card Types
    SecureSelect - Select the Smart Card Type to Use
    TrafficClient - Run Network Traffic Speed Test Tool in Client Mode
    TrafficServer - Run Network Traffic Speed Test Tool in Server Mode
    VersionGet - Get Version Information of VPN Client Service

    To reference the usage for each command, input "command name ?" to view a help.
    The command completed successfully.
  • create nic
    1
    2
    3
    4
    5
    VPN Client>NicCreate
    NicCreate command - Create New Virtual Network Adapter
    Virtual Network Adapter Name: aws

    The command completed successfully.
  • create account
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    VPN Client>AccountCreate
    AccountCreate command - Create New VPN Connection Setting
    Name of VPN Connection Setting: aws

    Destination VPN Server Host Name and Port Number: 13.230.1.6:443

    Destination Virtual Hub Name: VPN

    Connecting User Name: rpi1

    Used Virtual Network Adapter Name: aws

    The command completed successfully.
  • set password
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    VPN Client>AccountPasswordSet
    AccountPasswordSet command - Set User Authentication Type of VPN Connection Setting to Password Authentication
    Name of VPN Connection Setting: aws

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

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


    Specify standard or radius: standard

    The command completed successfully.

    III. Connect and Query Status

  • connect
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    VPN Client>AccountConnect
    AccountConnect command - Start Connection to VPN Server using VPN Connection Setting
    Name of VPN Connection Setting: aws

    The command completed successfully.

    VPN Client>AccountList
    AccountList command - Get List of VPN Connection Settings
    Item |Value
    ----------------------------+-----------------------------------------
    VPN Connection Setting Name |aws
    Status |Connected
    VPN Server Hostname |13.230.1.6:443 (Direct TCP/IP Connection)
    Virtual Hub |VPN
    Virtual Network Adapter Name|aws
    The command completed successfully.
  • disconnect
    1
    2
    3
    4
    5
    VPN Client>AccountDisconnect 
    AccountDisconnect command - Disconnect VPN Connection Setting During Connection
    Name of VPN Connection Setting: aws

    The command completed successfully.

enable ip forward and config route

  • enable ipv4 forward
    uncommnet /etc/sysctl.conf ‘s #net.ipv4.ip_forward = 1 field.

    1
    2
    $ sudo sysctl -p
    net.ipv4.ip_forward = 1
  • dhcp ip

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    $ ifconfig vpn_aws
    vpn_aws: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet6 fe80::5c8a:2fff:fea2:9bcd prefixlen 64 scopeid 0x20<link>
    ether 5e:8a:2f:a2:9b:cd txqueuelen 1000 (Ethernet)
    RX packets 480 bytes 36783 (36.7 KB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 404 bytes 34409 (34.4 KB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    $ sudo dhclient vpn_aws

    $ ifconfig vpn_aws
    vpn_aws: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.30.11 netmask 255.255.255.0 broadcast 192.168.30.255
    inet6 fe80::5c8a:2fff:fea2:9bcd prefixlen 64 scopeid 0x20<link>
    ether 5e:8a:2f:a2:9b:cd txqueuelen 1000 (Ethernet)
    RX packets 503 bytes 38923 (38.9 KB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 269644 bytes 188780458 (188.7 MB)
    TX errors 0 dropped 42599 overruns 0 carrier 0 collisions 0
  • config route

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    $ ip route 
    default via 192.168.30.1 dev vpn_aws
    default via 192.168.124.1 dev wlan0 proto dhcp metric 600
    169.254.0.0/16 dev wlan0 scope link metric 1000
    192.168.30.0/24 dev vpn_aws proto kernel scope link src 192.168.30.11
    192.168.124.0/24 dev wlan0 proto kernel scope link src 192.168.124.8 metric 600

    $ sudo ip route add 13.230.1.6/32 via 192.168.124.1 dev wlan0
    $ sudo ip route del default via 192.168.124.1 dev wlan0 proto dhcp metric 600

    $ ip route
    default via 192.168.30.1 dev vpn_aws
    13.230.1.6 via 192.168.124.1 dev wlan0
    169.254.0.0/16 dev wlan0 scope link metric 1000
    192.168.30.0/24 dev vpn_aws proto kernel scope link src 192.168.30.11
    192.168.124.0/24 dev wlan0 proto kernel scope link src 192.168.124.8 metric 600
  • set nameserver

    1
    2
    3
    $ su root
    $ echo "nameserver 8.8.8.8" >> /etc/resolv.conf
    $ ping 8.8.8.8 -c4
  • done

    1
    2
    3
    4
    5
    6
    7
    8
    9
    # ping google.com.au -c4
    PING google.com.au (172.217.25.99) 56(84) bytes of data.
    64 bytes from nrt13s51-in-f99.1e100.net (172.217.25.99): icmp_seq=1 ttl=104 time=197 ms
    64 bytes from nrt13s51-in-f99.1e100.net (172.217.25.99): icmp_seq=2 ttl=104 time=194 ms
    64 bytes from nrt13s51-in-f99.1e100.net (172.217.25.99): icmp_seq=3 ttl=104 time=194 ms
    64 bytes from nrt13s51-in-f99.1e100.net (172.217.25.99): icmp_seq=4 ttl=104 time=194 ms

    --- google.com.au ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 3004ms

Summarize(everytime)

  • start vpn

    1
    2
    3
    4
    sudo /home/down/vpn/vpnclient/vpnclient start; sleep 5
    sudo dhclient vpn_aws
    sudo ip route add 13.230.1.6/32 via 192.168.124.1 dev wlan0
    sudo ip route del default via 192.168.124.1 dev wlan0
  • Notes: the account should be set startup mode

    1
    2
    3
    4
    5
    VPN Client>AccountStartupSet
    AccountStartupSet command - Set VPN Connection Setting as Startup Connection
    Name of VPN Connection Setting: aws

    The command completed successfully.
  • stop vpn

    1
    2
    3
    4
    5
    6
    sudo ifconfig down vpn_aws
    sudo /home/down/vpn/vpnclient/vpnclient stop; sleep 5
    sudo ip route del 13.230.1.6/32
    sudo ip route del default
    sudo ip route add default via 192.168.124.1 dev wlan0 proto dhcp metric 600
    sudo dhclient -x wlan0; sudo dhclient wlan0

Reference

How to install and set up Softether VPN Client for Ubuntu Linux via free VPN Gate servers