随着技术世界的进步,对安全通信的需求变得越来越重要。 VPN 或“虚拟专用网络”对于维护在线安全至关重要。

然而,网络提供商和机构可以通过多种方式阻止 VPN 联系。 您可以通过设置自己的来绕过这些块 VPN 使用 SoftEther 通过 HTTPS。

以下是 SoftEther 的工作原理以及它与流行的有何不同 VPN 服务以及如何安装您自己的 SoftEther VPN 在一个 Ubuntu Linux 服务器。

什么是 SoftEther 和 VPN 通过 HTTPS

最多 VPN 服务提供商使用一组标准化的端口和协议。 这些连接很容易在防火墙级别被阻止,或者通过强制流量通过 Web 代理服务器来阻止。

如果您的本地网络防火墙阻止此操作 VPN 连接,你如何克服它们? 答案就在重定向中 VPN 通过 HTTPS 的隧道。 A 软以太 VPN 它使用安全超文本传输​​协议 (HTTPS) 作为传输协议。 SoftEther 创建了一个安全的 VPN 这几乎可以通过任何防火墙或代理服务器发生。

这是可能的,因为 HTTPS 流量本质上是 Web 流量,通常不会被防火墙阻止。 这确保了可靠且不间断的连接。

SoftEther 代表“软件以太网”,是一种开源、跨平台、多协议的协议 VPN 解决方案。 这个鲜为人知的平台由筑波大学开发,其特点是灵活性和稳健性。

您可以用它安装 SoftEther 客户端 VPN 通过 HTTPS Windows 和 Linux。

如何安装和配置 SoftEther Ubuntu Linux

SoftEther 被认为表现最好 CentOS Linux,但可以定制以完美运行 Ubuntu。 在线支持环境 Ubuntu 是巨大的,这就是为什么托管您的 SoftEther 是一个不错的选择 VPN。

虽然本指南很简单,但需要一些知识 Linux 需要多个系统才能使其发挥作用。 在开始之前还应该满足一些先决条件。

软以太 VPN 要求

  1. Ubuntu 服务器(22.04.x LTS),最好使用虚拟专用服务器
  2. 公共可路由的 IPv4 或 v6 地址
  3. 根管理访问
  4. /var/ 分区至少有 10 GB 可用空间
  5. SSH
  6. 正确的网络配置。 如何配置网络 Ubuntu 如果您需要复习一下服务器。

安装 SoftEther Ubuntu 服务器

开始你的 Ubuntu 服务器并以 root 身份登录。

第一步是更新您的软件和存储库。

 apt-get update -y 

现在我们需要安装 SoftEther 软件所需的依赖项。

 apt-get install build-essential gnupg2 gcc make -y 

然后下载 SoftEther 服务器。 您必须使用基于 Lynx 终端的 Browser 检查该软件的最新版本。

为此,首先安装 Lynx。

 apt-get install lynx -y 

现在打开 SoftEther 下载页面 Browser。

 lynx https://www.softether-download.com/files/softether/ 

使用箭头键搜索最新版本。 突出显示最新版本并按 Enter。

来标记“Linux”并按 Enter 键。

现在突出显示“SoftEther_VPN_Server”并按 Enter 键。

最后,选择支持您的架构的版本(很可能是 64 位__Intel_x64),然后按最后一次 Enter 键。

现在突出显示 .tar.gz 文件并按“d”。 现在将下载该文件。

最后,选择“保存到磁盘”,然后按“q”打开LynxBrowser 结束。

下一步是提取存档。 请注意,如果您下载的是较新版本,您的文件名可能会有所不同。

 tar -xvzf softether-vpnserver-v4.42-9798-rtm-2023.06.30-linux-x64-64bit.tar.gz 

导航到新创建的 VPN-服务器目录

 cd vpnserver 

接下来,输入“make”命令来编译软件。

 make 

在该过程结束时,您应该看到以下输出:

 *** PacketiX VPN Server HTML5 Web Administration Console (NEW) ***
This VPN Server / Bridge has the built-in HTML5 Web Administration Console.

After you start the server daemon, you can open the HTML5 Web Administration Console is available at

https://127.0.0.1:5555/
or
https://ip_address_of_the_vpn_server:5555/

This HTML5 page is obviously under construction, and your HTML5 development contribution is very appreciated.

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

make[1]: Leaving directory '/root/vpnserver'

下一步是将新编译的软件和目录移动到/usr/local。

 cd ..
mv vpnserver /usr/local/

现在为此设置正确的权限 VPN- 服务器目录。

 cd /usr/local/vpnuser
chmod 600 *
chmod 700 vpnserver
chmod 700 vpncmd

接下来我们需要创建一些文件以确保 SoftEther 服务器在运行时运行 Ubuntu 服务器将重新启动。 内置的 Nano 文本文件编辑器可用于创建和编辑文件。

 nano /etc/init.d/vpnserver 

现在将以下内容复制并粘贴到文件中并保存(Ctrl-O、Ctrl-X):

 #!/bin/sh
### BEGIN INIT INFO
# Provides: vpnserver
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: SoftEtherVPNServer
### END INIT INFO

# 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

创建一个新目录并为新创建的服务设置权限。

 mkdir /var/lock/subsys
chmod 755 /etc/init.d/vpnserver

接下来,在 /lib/systemd/system 目录中创建一个名为 vpnserver.service 的新文件。

 nano /lib/systemd/system/vpnserver.service 

将以下内容复制并粘贴到文件中,保存并关闭。

 Description=SoftEther VPN Server
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/vpnserver/vpnserver start
ExecStop=/usr/local/vpnserver/vpnserver stop

[Install]
WantedBy=multi-user.target

启用 SoftEther 服务以在重新启动时启动。

 systemctl enable vpnserver.service 

现在启动 SoftEther VPN 服务。

 /etc/init.d/vpnserver start 

您应该看到以下输出:

 The SoftEther VPN Server service has been started.

Let's get started by accessing to the following URL from your PC:
https://<your public facing IP:5555/
  or
https://<your public facing IP/

Note: IP address may vary. Specify your server's IP address.

接下来,启用服务器脚本以在重新启动时启动。

 update-rc.d vpnserver defaults

配置 SoftEther 服务器

SoftEther 有一个方便的内置配置脚本,使设置变得轻而易举。 要启动脚本,我们更改工作目录并运行脚本。

 cd /usr/local/vpnserver
./vpncmd

您将看到以下选择:

 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
Select 1, 2 or 3: 1

选择 1 并按 Enter 两次。 您应该看到以下输出:

在我们继续之前,我们需要建立一个 admin 密码

 ServerPasswordSet 

这里是 admin 设置 EtherSoft 密码后,输入您的(新)密码并确认。

下一步是创建集线器并设置密码(与 admin 密码)。 您可以为该中心命名任何您喜欢的名称 example 我们用了”VPN”。

 HubCreate VPN 

现在让我们配置集线器”VPN’ 这是刚刚创建的。

 Hub VPN 

您的命令提示符应显示:

 VPN Server/VPN> 

现在让我们创建将 IP 地址分配给远程客户端的虚拟 LAN。

 SecureNatEnable 

输出现在应该显示:

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

接下来我们创建第一个用户 VPN。

 UserCreate vpnuser1 

您应该看到以下输出:

接下来,设置密码 VPN 用户。

 UserPasswordSet vpnuser1 

下一步是配置 SoftEther 多协议平台。

 IPsecEnable 

现在,系统将询问您几个有关要激活哪些服务的问题。 您可以使用以下答案:

请注意,IPSec 密钥用于 L2TP 连接。 所以请让它尽可能复杂。

恭喜,配置完成。 输入“exit”结束该过程。

 exit 

为 SoftEther 启用和配置 UFW 防火墙

如果你的 Ubuntu 如果服务器在启动前是全新的,则需要启用并配置内置的 UFW 防火墙。

首先设置默认策略。

 ufw default allow outgoing
ufw default deny incoming

现在输入以下命令打开 SoftEther 所需的端口

 ufw allow 443/tcp
ufw allow 5555/tcp
ufw allow 992/tcp
ufw allow 1194/udp
ufw allow SSH

启用并启动防火墙。

 ufw enable 

将 UFW 设置为在重新启动时启动。

 systemctl enable ufw 

收尾工作和资源

恭喜你,你的 SoftEther VPN 现在可以使用了。 此时,最好在尝试客户端连接之前重新启动服务器并确保所有服务正在运行。

检查 SoftEther 的状态 VPN 服务器使用命令:

 systemctl status vpnserver.service 

要检查 UFW 防火墙的状态,请使用以下命令:

 systemctl status ufw && ufw status verbose 

连接您的 Windows PC 到您的 HTTPS SoftEther VPN 客户端可以从以下位置下载 SoftEther 网站。 你也可以在那里找到 SoftEther 说明 了解如何安装和连接软件。

有关连接其他操作系统的更多信息也可以在 SoftEther 网站的教程部分

文凭

软以太 VPN 自行安装 Ubuntu 服务器提供了许多优势,特别是在灵活和安全的网络方面。

这是鲜为人知的 VPN 该软件解决方案可以在全球范围内部署和使用,甚至可以绕过最困难的挑战 VPN 阻塞技术。 请宣传并享受这款适应性强、多功能的设备 VPN 解决方案。