Skip to content

Instantly share code, notes, and snippets.

@arno01
Last active April 3, 2022 11:23
Show Gist options
  • Save arno01/e7ddd9cf038e0bc459df2365627da2c4 to your computer and use it in GitHub Desktop.
Save arno01/e7ddd9cf038e0bc459df2365627da2c4 to your computer and use it in GitHub Desktop.
Trying SoftEtherVPN

Final work => akash-network/awesome-akash#281

Old info starts from this line

Keeping the old stuff here just for the record.

Trying SoftEther.

Ref. https://discordapp.com/channels/747885925232672829/747885925878726841/877276961632817152

Server

docker run -p443:443 --rm -ti ubuntu:latest

apt update
apt -y install wget make gcc

wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.38-9760-rtm/softether-vpnserver-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz
tar xvf softether-vpnserver-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz 
cd vpnserver/
make
./vpnserver start

/vpnserver/vpncmd
1. Management of VPN Server or VPN Bridge

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>HubCreate
HubCreate command - Create New Virtual Hub
Name of Virtual Hub to be created: hub1

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

Password: hub1
Confirm input: hub1


The command completed successfully.

Ctrl+D

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: hub1
Password: ****

Connection has been established with VPN Server "localhost" (port 443).

You have administrator privileges for Virtual Hub 'hub1' on the VPN Server.


VPN Server/hub1>UserCreate
UserCreate command - Create User 
User Name: user1

Assigned Group Name: 

User Full Name: User One

User Description: 

The command completed successfully.

VPN Server/hub1>UserPasswordSet
UserPasswordSet command - Set Password Authentication for User Auth Type and Set Password
User Name: user1

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

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


The command completed successfully.

VPN Server/hub1>DhcpGet        
DhcpGet command - Get Virtual DHCP Server Function Setting of SecureNAT Function
Item                           |Value
-------------------------------+--------------
Use Virtual DHCP Function      |Yes
Start Distribution Address Band|192.168.30.10
End Distribution Address Band  |192.168.30.200
Subnet Mask                    |255.255.255.0
Lease Limit (Seconds)          |7200
Default Gateway Address        |192.168.30.1
DNS Server Address 1           |192.168.30.1
DNS Server Address 2           |None
Domain Name                    |
Save NAT and DHCP Operation Log|Yes
Static Routing Table to Push   |
The command completed successfully.

VPN Server/hub1>SecureNatEnable
SecureNatEnable command - Enable the Virtual NAT and DHCP Server Function (SecureNat Function)
The command completed successfully.

VPN Server/hub1>ServerStatusGet
ServerStatusGet command - Get Current Server Status
Item                                          |Value
----------------------------------------------+-------------------------
Server Type                                   |Standalone Server
Number of Active Sockets                      |21
Number of Virtual Hubs                        |2
Number of Sessions                            |1
Number of MAC Address Tables                  |2
Number of IP Address Tables                   |4
Number of Users                               |1
Number of Groups                              |0
Using Client Connection Licenses (This Server)|1
Using Bridge Connection Licenses (This Server)|0
Outgoing Unicast Packets                      |29,545 packets
Outgoing Unicast Total Size                   |2,093,840 bytes
Outgoing Broadcast Packets                    |35 packets
Outgoing Broadcast Total Size                 |5,172 bytes
Incoming Unicast Packets                      |29,626 packets
Incoming Unicast Total Size                   |2,100,374 bytes
Incoming Broadcast Packets                    |122 packets
Incoming Broadcast Total Size                 |24,977 bytes
Server Started at                             |2021-08-17 (Tue) 19:10:24
Current Time                                  |2021-08-17 19:26:44.602
64 bit High-Precision Logical System Clock    |979698
The command completed successfully.

Client

https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases
https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.38-9760-rtm/softether-vpnclient-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz

tar xvf softether-vpnclient-v4.38-9760-rtm-2021.08.17-linux-x64-64bit.tar.gz 
cd vpnclient/
make
sudo ./vpnclient start
./vpncmd
3. Use of VPN Tools (certificate creation and Network Traffic Speed Test Tool)
Check

Ctrl+D

2. Management of VPN Client

VPN Client>NicCreate softether
NicCreate command - Create New Virtual Network Adapter
The command completed successfully.

VPN Client>AccountCreate testvpn
AccountCreate command - Create New VPN Connection Setting
Destination VPN Server Host Name and Port Number: 172.17.0.2:443

Destination Virtual Hub Name: hub1

Connecting User Name: user1

Used Virtual Network Adapter Name: softether

The command completed successfully.


VPN Client>AccountPassword
AccountPasswordSet command - Set User Authentication Type of VPN Connection Setting to Password Authentication
Name of VPN Connection Setting: testvpn

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

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


Specify standard or radius: standard

The command completed successfully.

VPN Client>AccountConnect
AccountConnect command - Start Connection to VPN Server using VPN Connection Setting
Name of VPN Connection Setting: testvpn

The command completed successfully.

VPN Client>AccountList   
AccountList command - Get List of VPN Connection Settings
Item                        |Value
----------------------------+-----------------------------------------
VPN Connection Setting Name |testvpn
Status                      |Connected
VPN Server Hostname         |172.17.0.2:443 (Direct TCP/IP Connection)
Virtual Hub                 |hub1
Virtual Network Adapter Name|softetherThe command completed successfully.


vpnclient$ sudo dhclient vpn_softether
vpnclient$ ifconfig vpn_softether
vpn_softether: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.30.10  netmask 255.255.255.0  broadcast 192.168.30.255
        inet6 fe80::5c09:4cff:fef8:646a  prefixlen 64  scopeid 0x20<link>
        ether 5e:09:4c:f8:64:6a  txqueuelen 1000  (Ethernet)
        RX packets 22572  bytes 1221340 (1.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 92271  bytes 9026529 (9.0 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


~/Downloads/vpnclient$ sudo ./vpnclient stop
sudo pkill dhclient
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment