Compare commits
2 Commits
28a7b595ec
...
8ae26b832f
Author | SHA1 | Date | |
---|---|---|---|
|
8ae26b832f | ||
|
c87dfdb0d8 |
@ -12,7 +12,7 @@ IPsec VPN 可以加密你的网络流量,以防止在通过因特网传送时
|
|||||||
|
|
||||||
## 快速开始
|
## 快速开始
|
||||||
|
|
||||||
首先,在你的 Linux 服务器\* 上全新安装 Ubuntu, Debian 或者 CentOS。
|
首先,在你的 Linux 服务器\* 上安装 Ubuntu, Debian 或者 CentOS。
|
||||||
|
|
||||||
使用以下命令快速搭建 IPsec VPN 服务器:
|
使用以下命令快速搭建 IPsec VPN 服务器:
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ https://gitlab.com/hwdsl2/setup-ipsec-vpn/-/raw/master/vpnsetup.sh
|
|||||||
|
|
||||||
## 系统要求
|
## 系统要求
|
||||||
|
|
||||||
一个云服务器,虚拟专用服务器 (VPS) 或者专用服务器,全新安装以下操作系统之一:
|
一个云服务器,虚拟专用服务器 (VPS) 或者专用服务器,安装以下操作系统之一:
|
||||||
|
|
||||||
- Ubuntu 22.04, 20.04 或者 18.04
|
- Ubuntu 22.04, 20.04 或者 18.04
|
||||||
- Debian 11 或者 10
|
- Debian 11 或者 10
|
||||||
|
@ -12,7 +12,7 @@ We will use [Libreswan](https://libreswan.org/) as the IPsec server, and [xl2tpd
|
|||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
|
|
||||||
First, prepare your Linux server\* with a fresh install of Ubuntu, Debian or CentOS.
|
First, prepare your Linux server\* with an install of Ubuntu, Debian or CentOS.
|
||||||
|
|
||||||
Use this one-liner to set up an IPsec VPN server:
|
Use this one-liner to set up an IPsec VPN server:
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ A pre-built [Docker image](https://github.com/hwdsl2/docker-ipsec-vpn-server) is
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
A cloud server, virtual private server (VPS) or dedicated server, freshly installed with:
|
A cloud server, virtual private server (VPS) or dedicated server, with an install of:
|
||||||
|
|
||||||
- Ubuntu 22.04, 20.04 or 18.04
|
- Ubuntu 22.04, 20.04 or 18.04
|
||||||
- Debian 11 or 10
|
- Debian 11 or 10
|
||||||
|
@ -52,7 +52,7 @@ Libreswan 支持通过使用 RSA 签名算法的 X.509 Machine Certificates 来
|
|||||||
|
|
||||||
#### 自动导入配置
|
#### 自动导入配置
|
||||||
|
|
||||||
[**屏幕录影:** 自动导入 IKEv2 配置(支持者)](https://ko-fi.com/post/IKEv2-Auto-Import-Configuration-on-Windows-8-10-a-K3K1DQCHW)
|
[**屏幕录影:** 在 Windows 上自动导入 IKEv2 配置](https://ko-fi.com/post/IKEv2-Auto-Import-Configuration-on-Windows-8-10-a-K3K1DQCHW)
|
||||||
|
|
||||||
**Windows 8, 10 和 11** 用户可以自动导入 IKEv2 配置:
|
**Windows 8, 10 和 11** 用户可以自动导入 IKEv2 配置:
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ Libreswan 支持通过使用 RSA 签名算法的 X.509 Machine Certificates 来
|
|||||||
|
|
||||||
#### 手动导入配置
|
#### 手动导入配置
|
||||||
|
|
||||||
[**屏幕录影:** 手动导入 IKEv2 配置(支持者)](https://ko-fi.com/post/Video-IKEv2-Manually-Import-Configuration-H2H1DS8SV)
|
[**屏幕录影:** 在 Windows 上手动导入 IKEv2 配置(支持者)](https://ko-fi.com/post/Video-IKEv2-Manually-Import-Configuration-H2H1DS8SV)
|
||||||
|
|
||||||
或者,**Windows 7, 8, 10 和 11** 用户可以手动导入 IKEv2 配置:
|
或者,**Windows 7, 8, 10 和 11** 用户可以手动导入 IKEv2 配置:
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ In certain circumstances, you may need to change the IKEv2 server address. For e
|
|||||||
|
|
||||||
#### Auto-import configuration
|
#### Auto-import configuration
|
||||||
|
|
||||||
[**Screencast:** IKEv2 Auto Import Configuration (supporters)](https://ko-fi.com/post/IKEv2-Auto-Import-Configuration-on-Windows-8-10-a-K3K1DQCHW)
|
[**Screencast:** IKEv2 Auto Import Configuration on Windows](https://ko-fi.com/post/IKEv2-Auto-Import-Configuration-on-Windows-8-10-a-K3K1DQCHW)
|
||||||
|
|
||||||
**Windows 8, 10 and 11** users can automatically import IKEv2 configuration:
|
**Windows 8, 10 and 11** users can automatically import IKEv2 configuration:
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ If you get an error when trying to connect, see [Troubleshooting](#troubleshooti
|
|||||||
|
|
||||||
#### Manually import configuration
|
#### Manually import configuration
|
||||||
|
|
||||||
[**Screencast:** IKEv2 Manually Import Configuration (supporters)](https://ko-fi.com/post/Video-IKEv2-Manually-Import-Configuration-H2H1DS8SV)
|
[**Screencast:** IKEv2 Manually Import Configuration on Windows (supporters)](https://ko-fi.com/post/Video-IKEv2-Manually-Import-Configuration-H2H1DS8SV)
|
||||||
|
|
||||||
Alternatively, **Windows 7, 8, 10 and 11** users can manually import IKEv2 configuration:
|
Alternatively, **Windows 7, 8, 10 and 11** users can manually import IKEv2 configuration:
|
||||||
|
|
||||||
|
@ -184,10 +184,17 @@ update_sysctl() {
|
|||||||
if grep -qs "hwdsl2 VPN script" /etc/sysctl.conf; then
|
if grep -qs "hwdsl2 VPN script" /etc/sysctl.conf; then
|
||||||
bigecho "Updating sysctl settings..."
|
bigecho "Updating sysctl settings..."
|
||||||
conf_bk "/etc/sysctl.conf"
|
conf_bk "/etc/sysctl.conf"
|
||||||
|
count=17
|
||||||
|
line1=$(grep -A 18 "hwdsl2 VPN script" /etc/sysctl.conf | tail -n 1)
|
||||||
|
line2=$(grep -A 19 "hwdsl2 VPN script" /etc/sysctl.conf | tail -n 1)
|
||||||
|
if [ "$line1" = "net.core.default_qdisc = fq" ] \
|
||||||
|
&& [ "$line2" = "net.ipv4.tcp_congestion_control = bbr" ]; then
|
||||||
|
count=19
|
||||||
|
fi
|
||||||
if [ "$os_type" = "alpine" ]; then
|
if [ "$os_type" = "alpine" ]; then
|
||||||
sed -i '/# Added by hwdsl2 VPN script/,+17d' /etc/sysctl.conf
|
sed -i "/# Added by hwdsl2 VPN script/,+${count}d" /etc/sysctl.conf
|
||||||
else
|
else
|
||||||
sed --follow-symlinks -i '/# Added by hwdsl2 VPN script/,+17d' /etc/sysctl.conf
|
sed --follow-symlinks -i "/# Added by hwdsl2 VPN script/,+${count}d" /etc/sysctl.conf
|
||||||
fi
|
fi
|
||||||
if [ ! -f /usr/bin/wg-quick ] && [ ! -f /usr/sbin/openvpn ]; then
|
if [ ! -f /usr/bin/wg-quick ] && [ ! -f /usr/sbin/openvpn ]; then
|
||||||
echo 0 > /proc/sys/net/ipv4/ip_forward
|
echo 0 > /proc/sys/net/ipv4/ip_forward
|
||||||
|
Loading…
Reference in New Issue
Block a user