使用SoftEther搭建 VPN Server(L2TP、OpenVPN)


这几天遇到了异地组网的需求就来研究研究 毕竟内网穿透 很简单一个frp就搞定了 但是异地组网还是局域网就有点难搞了 网上发现SoftEther这套东西 小小研究一下

介绍

SoftEther是一套程序 包括(PPTP、L2TP、OpenVPN)

SoftEther VPN官网好像被墙了吧

http://www.softether-download.com/cn.aspx?product=softether

debian安装

sudo apt-get update
sudo apt-get install build-essential
#安装 make gcc g++ 编译软件
ubuntu系统执行: apt-get install make gcc g++  -y
#这里的下载地址看你自己需要那个版本就把地址换成那个版本的是SoftEther VPN Server
wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.29-9680-rtm/softether-vpnserver-v4.29-9680-rtm-2019.02.28-linux-x64-64bit.tar.gz
tar xvf softether-vpnserver-v4.29-9680-rtm-2019.02.28-linux-x64-64bit.tar.gz  #解压缩:tar xvf 文件名
cd vpnserver  #切换到解压出来的目录中
make  #编译

systemctl配置

配置systemctl好管理SoftEther
新建启动脚本/etc/systemd/system/vpnserver.service,写入以下内容
vi /etc/systemd/system/vpnserver.service

[Unit] 
Description=SoftEther Server 
After=network.target 
[Service] 
Type=forking 
ExecStart=/root/vpnserver/vpnserver start 
ExecStop= /root/vpnserver/vpnserver stop

[Install] 
WantedBy=multi-user.target

这里的/root/vpnserver/vpnserver目录换成你自己的目录你可以把vpnserver 这个目录移动到/usr/bin/下面 看自己的喜好把

启动

由于我这里使用systemctl作为进程守护

systemctl start vpnserver #开启vpnserver 
systemctl stop vpnserver #关闭vpnserver 
systemctl enable vpnserver #开机自启vpnserver 

配置

vpncmd  #依次 1,回车,回车   针对开启了 https 的 web 服务器,依次 1,localhost:5555,回车

基本上就是 第一个选择1 其他全部回车默认就好
然后设置管理员密码

ServerPasswordSet

到这里服务端就安装好了不过提醒一下这种是有公网IP的情况没有的话还得通过frp穿透出来 这个只是服务端的创建 服务端创建完成了还要通过管理端去管理 然后客户端才能链接

声明:小小博客|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - 使用SoftEther搭建 VPN Server(L2TP、OpenVPN)


Carpe Diem and Do what I like