原创

SoftEtherVPN开源VPN安装步骤

温馨提示:
本文最后更新于 2022年11月08日,已超过 773 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我

安装gcc readline-devel readline

自己动手安装VPN服务器

[root@alex SoftEtherVPN]# yum install readline-devel openssl openssl-devel

linux内核要求2.6.9 版本以上

把源码copy到本地,编译进行安装

[root@alex ~]# git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
[root@alex ~]# cd SoftEtherVPN
[root@alex SoftEtherVPN]# ./configure
[root@alex SoftEtherVPN]# make
[root@alex SoftEtherVPN]# make install

正常安装完成后会看待如下提示

Installation completed successfully.

Execute 'vpnserver start' to run the SoftEther VPN Server background service.

Execute 'vpnbridge start' to run the SoftEther VPN Bridge background service.

Execute 'vpnclient start' to run the SoftEther VPN Client background service.

Execute 'vpncmd' to run SoftEther VPN Command-Line Utility to configure VPN Server, VPN Bridge or VPN Client.

执行检查

[root@alex ~]# vpncmd //执行VPNCMD命令

vpncmd command - SoftEther VPN Command Line Management Utility Developer Edition

SoftEther VPN Command Line Management Utility (vpncmd command)

Developer Edition

Version 4.23 Build 9647 (English)

Compiled 2017/10/19 14:28:18 by yagi at pc37

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工具

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

VPN Tools>check
//执行检查命令

Check command - Check whether SoftEther VPN Operation is Possible

---------------------------------------------------

SoftEther VPN Operation Environment Check Tool

Developer Edition

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.

以上都为pass即可

注册为服务

[root@alex ~]# vim /etc/init.d/vpnserver

#!/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

[root@alex ~]# chmod 755 /etc/init.d/vpnserver //设置权限

[root@alex ~]# systemctl enable vpnserver
//设定开机启动服务

vpnserver.service is not a native service, redirecting to /sbin/chkconfig.

Executing /sbin/chkconfig vpnserver on

[root@alex ~]# systemctl start vpnserver.service //启动VPN服务

[root@alex ~]# systemctl status vpnserver.service
//查看服务状态

* vpnserver.service - SYSV: SoftEther VPN Server

Loaded: loaded (/etc/rc.d/init.d/vpnserver; bad; vendor preset: disabled)

Active: active (exited) since Thu 2017-11-23 10:21:46 CST; 2s ago

Docs: man:systemd-sysv-generator(8)

Process: 7617 ExecStart=/etc/rc.d/init.d/vpnserver start (code=exited, status=0/SUCCESS)

Nov 23 10:21:46 alex systemd[1]: Starting SYSV: SoftEther VPN Server...

Nov 23 10:21:46 alex systemd[1]: Started SYSV: SoftEther VPN Server.

[root@alex ~]#

设置服务器管理密码

[root@alex SoftEtherVPN]# vpncmd
#使用VPN自带的管理工具

vpncmd command - SoftEther VPN Command Line Management Utility Developer Edition

SoftEther VPN Command Line Management Utility (vpncmd command)

Developer Edition

Version 4.23 Build 9647 (English)

Compiled 2017/10/19 14:28:18 by yagi at pc37

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 #选择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>ServerPasswordSet #设置密码

ServerPasswordSet command - Set VPN Server Administrator Password

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

Password: **********

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

The command completed successfully.

剩下的我们就可以用UI进行远程连接了,我们在可以使用UI工具进行建立VPN

 

正文到此结束
本文目录