1
0
mirror of synced 2024-11-23 21:36:09 +03:00

Compare commits

...

2 Commits

Author SHA1 Message Date
hwdsl2
1dd7835107 Update docs 2022-05-15 15:07:23 -05:00
hwdsl2
3378f540c6 Update docs 2022-05-15 09:50:49 -05:00
10 changed files with 56 additions and 44 deletions

View File

@ -38,6 +38,8 @@ curl -fsSL https://get.vpnsetup.net -o vpn.sh && sudo sh vpn.sh
```bash ```bash
curl -fsSL https://gitlab.com/hwdsl2/setup-ipsec-vpn/-/raw/master/vpnsetup.sh -o vpn.sh && sudo sh vpn.sh curl -fsSL https://gitlab.com/hwdsl2/setup-ipsec-vpn/-/raw/master/vpnsetup.sh -o vpn.sh && sudo sh vpn.sh
``` ```
如果无法下载,点[这里](https://github.com/hwdsl2/setup-ipsec-vpn/raw/master/vpnsetup.sh)查看脚本。按快捷键 `Ctrl/Cmd+A` 全选,`Ctrl/Cmd+C` 复制,然后粘贴到你喜欢的编辑器。
</details> </details>
<details> <details>
<summary> <summary>
@ -229,6 +231,8 @@ curl -fsSL https://get.vpnsetup.net/upg -o vpnup.sh && sudo sh vpnup.sh
```bash ```bash
curl -fsSL https://gitlab.com/hwdsl2/setup-ipsec-vpn/-/raw/master/extras/vpnupgrade.sh -o vpnup.sh && sudo sh vpnup.sh curl -fsSL https://gitlab.com/hwdsl2/setup-ipsec-vpn/-/raw/master/extras/vpnupgrade.sh -o vpnup.sh && sudo sh vpnup.sh
``` ```
如果无法下载,点[这里](https://github.com/hwdsl2/setup-ipsec-vpn/raw/master/extras/vpnupgrade.sh)查看脚本。按快捷键 `Ctrl/Cmd+A` 全选,`Ctrl/Cmd+C` 复制,然后粘贴到你喜欢的编辑器。
</details> </details>
当前支持的 Libreswan 最新版本是 `4.6`。查看已安装版本:`ipsec --version`。 当前支持的 Libreswan 最新版本是 `4.6`。查看已安装版本:`ipsec --version`。
@ -245,11 +249,12 @@ curl -fsSL https://gitlab.com/hwdsl2/setup-ipsec-vpn/-/raw/master/extras/vpnupgr
## 卸载 VPN ## 卸载 VPN
**警告:** 此[辅助脚本](../extras/vpnuninstall.sh)将从你的服务器中删除 IPsec VPN。所有的 VPN 配置将被**永久删除**,并且 Libreswan 和 xl2tpd 将被移除。此操作**不可撤销** **警告:** 此辅助脚本将从你的服务器中删除 IPsec VPN。所有的 VPN 配置将被**永久删除**,并且 Libreswan 和 xl2tpd 将被移除。此操作**不可撤销**
要卸载 IPsec VPN运行[辅助脚本](extras/vpnuninstall.sh)
```bash ```bash
wget -nv -O vpnunst.sh https://get.vpnsetup.net/unst wget https://get.vpnsetup.net/unst -qO vpnunst.sh && sudo bash vpnunst.sh
sudo bash vpnunst.sh
``` ```
更多信息请参见 [卸载 VPN](docs/uninstall-zh.md)。 更多信息请参见 [卸载 VPN](docs/uninstall-zh.md)。

View File

@ -38,6 +38,8 @@ Alternative setup URL:
```bash ```bash
curl -fsSL https://gitlab.com/hwdsl2/setup-ipsec-vpn/-/raw/master/vpnsetup.sh -o vpn.sh && sudo sh vpn.sh curl -fsSL https://gitlab.com/hwdsl2/setup-ipsec-vpn/-/raw/master/vpnsetup.sh -o vpn.sh && sudo sh vpn.sh
``` ```
If you are unable to download, click [here](https://github.com/hwdsl2/setup-ipsec-vpn/raw/master/vpnsetup.sh) to view the script. Press `Ctrl/Cmd+A` to select all, `Ctrl/Cmd+C` to copy, then paste into your favorite editor.
</details> </details>
<details> <details>
<summary> <summary>
@ -229,6 +231,8 @@ Alternative update URL:
```bash ```bash
curl -fsSL https://gitlab.com/hwdsl2/setup-ipsec-vpn/-/raw/master/extras/vpnupgrade.sh -o vpnup.sh && sudo sh vpnup.sh curl -fsSL https://gitlab.com/hwdsl2/setup-ipsec-vpn/-/raw/master/extras/vpnupgrade.sh -o vpnup.sh && sudo sh vpnup.sh
``` ```
If you are unable to download, click [here](https://github.com/hwdsl2/setup-ipsec-vpn/raw/master/extras/vpnupgrade.sh) to view the script. Press `Ctrl/Cmd+A` to select all, `Ctrl/Cmd+C` to copy, then paste into your favorite editor.
</details> </details>
The latest supported Libreswan version is `4.6`. Check installed version: `ipsec --version`. The latest supported Libreswan version is `4.6`. Check installed version: `ipsec --version`.
@ -245,11 +249,12 @@ See [Advanced usage](docs/advanced-usage.md).
## Uninstall the VPN ## Uninstall the VPN
**Warning:** This [helper script](../extras/vpnuninstall.sh) will remove IPsec VPN from your server. All VPN configuration will be **permanently deleted**, and Libreswan and xl2tpd will be removed. This **cannot be undone**! **Warning:** This helper script will remove IPsec VPN from your server. All VPN configuration will be **permanently deleted**, and Libreswan and xl2tpd will be removed. This **cannot be undone**!
To uninstall IPsec VPN, run the [helper script](extras/vpnuninstall.sh):
```bash ```bash
wget -nv -O vpnunst.sh https://get.vpnsetup.net/unst wget https://get.vpnsetup.net/unst -qO vpnunst.sh && sudo bash vpnunst.sh
sudo bash vpnunst.sh
``` ```
For more information, see [Uninstall the VPN](docs/uninstall.md). For more information, see [Uninstall the VPN](docs/uninstall.md).

View File

@ -45,9 +45,9 @@ sudo VPN_DNS_NAME='vpn.example.com' ikev2.sh --auto
```bash ```bash
# 下载脚本 # 下载脚本
wget -nv -O ikev2onlymode.sh https://get.vpnsetup.net/ikev2only wget https://get.vpnsetup.net/ikev2only -nv -O ikev2only.sh
# 运行脚本并按提示操作 # 运行脚本并按提示操作
sudo bash ikev2onlymode.sh sudo bash ikev2only.sh
``` ```
要禁用仅限 IKEv2 模式,再次运行辅助脚本并选择适当的选项。 要禁用仅限 IKEv2 模式,再次运行辅助脚本并选择适当的选项。

View File

@ -45,9 +45,9 @@ To enable IKEv2-only mode, first install the VPN server and set up IKEv2 using i
```bash ```bash
# Download the script # Download the script
wget -nv -O ikev2onlymode.sh https://get.vpnsetup.net/ikev2only wget https://get.vpnsetup.net/ikev2only -nv -O ikev2only.sh
# Run the script and follow the prompts # Run the script and follow the prompts
sudo bash ikev2onlymode.sh sudo bash ikev2only.sh
``` ```
To disable IKEv2-only mode, run the helper script again and select the appropriate option. To disable IKEv2-only mode, run the helper script again and select the appropriate option.

View File

@ -766,13 +766,13 @@ REG ADD HKLM\SYSTEM\CurrentControlSet\Services\RasMan\Parameters /v NegotiateDH2
在某些情况下,你可能需要在配置之后更改 IKEv2 服务器地址。例如切换为使用域名,或者在服务器的 IP 更改之后。请注意,你在 VPN 客户端指定的服务器地址必须与 IKEv2 辅助脚本输出中的服务器地址 **完全一致**,否则客户端可能无法连接。 在某些情况下,你可能需要在配置之后更改 IKEv2 服务器地址。例如切换为使用域名,或者在服务器的 IP 更改之后。请注意,你在 VPN 客户端指定的服务器地址必须与 IKEv2 辅助脚本输出中的服务器地址 **完全一致**,否则客户端可能无法连接。
要更改服务器地址,运行这个 [辅助脚本](../extras/ikev2changeaddr.sh) 并按提示操作。 要更改服务器地址,运行[辅助脚本](../extras/ikev2changeaddr.sh)
```bash ```bash
# 下载脚本 # 下载脚本
wget -nv -O ikev2changeaddr.sh https://get.vpnsetup.net/ikev2addr wget https://get.vpnsetup.net/ikev2addr -nv -O ikev2addr.sh
# 运行脚本并按照提示操作 # 运行脚本并按照提示操作
sudo bash ikev2changeaddr.sh sudo bash ikev2addr.sh
``` ```
**重要:** 运行此脚本后,你必须手动更新任何现有 IKEv2 客户端设备上的服务器地址以及 Remote ID如果适用。对于 iOS 客户端,你需要使用 IKEv2 [辅助脚本](#使用辅助脚本配置-ikev2) 导出然后重新导入客户端配置。 **重要:** 运行此脚本后,你必须手动更新任何现有 IKEv2 客户端设备上的服务器地址以及 Remote ID如果适用。对于 iOS 客户端,你需要使用 IKEv2 [辅助脚本](#使用辅助脚本配置-ikev2) 导出然后重新导入客户端配置。

View File

@ -768,13 +768,13 @@ If you are unable to connect multiple IKEv2 clients from behind the same NAT (e.
In certain circumstances, you may need to change the IKEv2 server address after setup. For example, to switch to use a DNS name, or after server IP changes. Note that the server address you specify on VPN client devices must **exactly match** the server address in the output of the IKEv2 helper script. Otherwise, devices may be unable to connect. In certain circumstances, you may need to change the IKEv2 server address after setup. For example, to switch to use a DNS name, or after server IP changes. Note that the server address you specify on VPN client devices must **exactly match** the server address in the output of the IKEv2 helper script. Otherwise, devices may be unable to connect.
To change the server address, run this [helper script](../extras/ikev2changeaddr.sh) and follow the prompts. To change the server address, run the [helper script](../extras/ikev2changeaddr.sh):
```bash ```bash
# Download the script # Download the script
wget -nv -O ikev2changeaddr.sh https://get.vpnsetup.net/ikev2addr wget https://get.vpnsetup.net/ikev2addr -nv -O ikev2addr.sh
# Run the script and follow the prompts # Run the script and follow the prompts
sudo bash ikev2changeaddr.sh sudo bash ikev2addr.sh
``` ```
**Important:** After running this script, you must manually update the server address (and remote ID, if applicable) on any existing IKEv2 client devices. For iOS clients, you'll need to export and re-import client configuration using the IKEv2 [helper script](#set-up-ikev2-using-helper-script). **Important:** After running this script, you must manually update the server address (and remote ID, if applicable) on any existing IKEv2 client devices. For iOS clients, you'll need to export and re-import client configuration using the IKEv2 [helper script](#set-up-ikev2-using-helper-script).

View File

@ -13,7 +13,7 @@
*其他语言版本: [English](manage-users.md#manage-vpn-users-using-helper-scripts), [简体中文](manage-users-zh.md#使用辅助脚本管理-vpn-用户)。* *其他语言版本: [English](manage-users.md#manage-vpn-users-using-helper-scripts), [简体中文](manage-users-zh.md#使用辅助脚本管理-vpn-用户)。*
你可以使用辅助脚本 [添加](../extras/add_vpn_user.sh), [删除](../extras/del_vpn_user.sh) 或者 [更新所有的](../extras/update_vpn_users.sh) VPN 用户。它们将同时更新 IPsec/L2TP 和 IPsec/XAuth ("Cisco IPsec") 模式的用户。对于 IKEv2 模式,请另外参见 [管理客户端证书](ikev2-howto-zh.md#管理客户端证书)。 你可以使用辅助脚本添加,删除或者更新 VPN 用户。它们将同时更新 IPsec/L2TP 和 IPsec/XAuth ("Cisco IPsec") 模式的用户。对于 IKEv2 模式,请参见 [管理客户端证书](ikev2-howto-zh.md#管理客户端证书)。
**注:** 将下面的命令的参数换成你自己的值。VPN 用户信息保存在文件 `/etc/ppp/chap-secrets``/etc/ipsec.d/passwd`。脚本在修改这些文件之前会先做备份,使用 `.old-日期-时间` 为后缀。 **注:** 将下面的命令的参数换成你自己的值。VPN 用户信息保存在文件 `/etc/ppp/chap-secrets``/etc/ipsec.d/passwd`。脚本在修改这些文件之前会先做备份,使用 `.old-日期-时间` 为后缀。
@ -21,7 +21,7 @@
添加一个新 VPN 用户,或者为一个已有的 VPN 用户更改密码。 添加一个新 VPN 用户,或者为一个已有的 VPN 用户更改密码。
运行脚本并按提示操作: 运行[辅助脚本](../extras/add_vpn_user.sh)并按提示操作:
```bash ```bash
sudo addvpnuser.sh sudo addvpnuser.sh
@ -35,7 +35,7 @@ sudo addvpnuser.sh
如果你使用了较早版本的 VPN 安装脚本,这是正常的。首先下载辅助脚本: 如果你使用了较早版本的 VPN 安装脚本,这是正常的。首先下载辅助脚本:
```bash ```bash
wget -nv -O /opt/src/addvpnuser.sh https://get.vpnsetup.net/adduser wget https://get.vpnsetup.net/adduser -nv -O /opt/src/addvpnuser.sh
chmod +x /opt/src/addvpnuser.sh && ln -s /opt/src/addvpnuser.sh /usr/bin chmod +x /opt/src/addvpnuser.sh && ln -s /opt/src/addvpnuser.sh /usr/bin
``` ```
@ -56,7 +56,7 @@ sudo addvpnuser.sh '要更新的用户名' '新密码'
删除指定的 VPN 用户。 删除指定的 VPN 用户。
运行脚本并按提示操作: 运行[辅助脚本](../extras/del_vpn_user.sh)并按提示操作:
```bash ```bash
sudo delvpnuser.sh sudo delvpnuser.sh
@ -70,7 +70,7 @@ sudo delvpnuser.sh
如果你使用了较早版本的 VPN 安装脚本,这是正常的。首先下载辅助脚本: 如果你使用了较早版本的 VPN 安装脚本,这是正常的。首先下载辅助脚本:
```bash ```bash
wget -nv -O /opt/src/delvpnuser.sh https://get.vpnsetup.net/deluser wget https://get.vpnsetup.net/deluser -nv -O /opt/src/delvpnuser.sh
chmod +x /opt/src/delvpnuser.sh && ln -s /opt/src/delvpnuser.sh /usr/bin chmod +x /opt/src/delvpnuser.sh && ln -s /opt/src/delvpnuser.sh /usr/bin
``` ```
@ -87,17 +87,17 @@ sudo delvpnuser.sh '要删除的用户名'
### 更新所有的 VPN 用户 ### 更新所有的 VPN 用户
移除所有的 VPN 用户并替换为你指定的列表中的用户。 移除 **所有的 VPN 用户** 并替换为你指定的列表中的用户。
首先下载脚本: 首先下载[辅助脚本](../extras/update_vpn_users.sh)
```bash ```bash
wget -nv -O updatevpnusers.sh https://get.vpnsetup.net/updateusers wget https://get.vpnsetup.net/updateusers -nv -O updatevpnusers.sh
``` ```
要使用这个脚本,从以下选项中选择一个: **重要:** 这个脚本会将你当前 **所有的 VPN 用户** 移除并替换为你指定的列表中的用户。如果你需要保留已有的 VPN 用户,则必须将它们包含在下面的变量中。
**重要:** 这个脚本会将你当前**所有的** VPN 用户移除并替换为你指定的列表中的用户。如果你需要保留已有的 VPN 用户,则必须将它们包含在下面的变量中。 要使用这个脚本,从以下选项中选择一个:
**选项 1:** 编辑脚本并输入 VPN 用户信息: **选项 1:** 编辑脚本并输入 VPN 用户信息:

View File

@ -13,7 +13,7 @@ By default, a single user account for VPN login is created. If you wish to view
*Read this in other languages: [English](manage-users.md#manage-vpn-users-using-helper-scripts), [简体中文](manage-users-zh.md#使用辅助脚本管理-vpn-用户).* *Read this in other languages: [English](manage-users.md#manage-vpn-users-using-helper-scripts), [简体中文](manage-users-zh.md#使用辅助脚本管理-vpn-用户).*
You may use helper scripts to [add](../extras/add_vpn_user.sh), [delete](../extras/del_vpn_user.sh) or [update all](../extras/update_vpn_users.sh) VPN users for both IPsec/L2TP and IPsec/XAuth ("Cisco IPsec") modes. For IKEv2 mode, please instead see [Manage client certificates](ikev2-howto.md#manage-client-certificates). You may use helper scripts to add, delete or update VPN users for both IPsec/L2TP and IPsec/XAuth ("Cisco IPsec") modes. For IKEv2 mode, see [Manage client certificates](ikev2-howto.md#manage-client-certificates).
**Note:** Replace command arguments below with your own values. VPN users are stored in `/etc/ppp/chap-secrets` and `/etc/ipsec.d/passwd`. The scripts will backup these files before making changes, with `.old-date-time` suffix. **Note:** Replace command arguments below with your own values. VPN users are stored in `/etc/ppp/chap-secrets` and `/etc/ipsec.d/passwd`. The scripts will backup these files before making changes, with `.old-date-time` suffix.
@ -21,7 +21,7 @@ You may use helper scripts to [add](../extras/add_vpn_user.sh), [delete](../extr
Add a new VPN user, or update an existing VPN user with a new password. Add a new VPN user, or update an existing VPN user with a new password.
Run the script and follow the prompts: Run the [helper script](../extras/add_vpn_user.sh) and follow the prompts:
```bash ```bash
sudo addvpnuser.sh sudo addvpnuser.sh
@ -35,7 +35,7 @@ Error: "sudo: addvpnuser.sh: command not found".
This is normal if you used an older version of the VPN setup script. First, download the helper script: This is normal if you used an older version of the VPN setup script. First, download the helper script:
```bash ```bash
wget -nv -O /opt/src/addvpnuser.sh https://get.vpnsetup.net/adduser wget https://get.vpnsetup.net/adduser -nv -O /opt/src/addvpnuser.sh
chmod +x /opt/src/addvpnuser.sh && ln -s /opt/src/addvpnuser.sh /usr/bin chmod +x /opt/src/addvpnuser.sh && ln -s /opt/src/addvpnuser.sh /usr/bin
``` ```
@ -56,7 +56,7 @@ sudo addvpnuser.sh 'username_to_update' 'new_password'
Delete the specified VPN user. Delete the specified VPN user.
Run the script and follow the prompts: Run the [helper script](../extras/del_vpn_user.sh) and follow the prompts:
```bash ```bash
sudo delvpnuser.sh sudo delvpnuser.sh
@ -70,7 +70,7 @@ Error: "sudo: delvpnuser.sh: command not found".
This is normal if you used an older version of the VPN setup script. First, download the helper script: This is normal if you used an older version of the VPN setup script. First, download the helper script:
```bash ```bash
wget -nv -O /opt/src/delvpnuser.sh https://get.vpnsetup.net/deluser wget https://get.vpnsetup.net/deluser -nv -O /opt/src/delvpnuser.sh
chmod +x /opt/src/delvpnuser.sh && ln -s /opt/src/delvpnuser.sh /usr/bin chmod +x /opt/src/delvpnuser.sh && ln -s /opt/src/delvpnuser.sh /usr/bin
``` ```
@ -87,17 +87,17 @@ sudo delvpnuser.sh 'username_to_delete'
### Update all VPN users ### Update all VPN users
Remove all existing VPN users and replace with the list of users you specify. Remove **all existing VPN users** and replace with the list of users you specify.
First, download the script: First, download the [helper script](../extras/update_vpn_users.sh):
```bash ```bash
wget -nv -O updatevpnusers.sh https://get.vpnsetup.net/updateusers wget https://get.vpnsetup.net/updateusers -nv -O updatevpnusers.sh
``` ```
To use this script, choose one of the following options: **Important:** This script will remove **all existing VPN users** and replace with the list of users you specify. Therefore, you must include any existing user(s) you want to keep in the variables below.
**Important:** This script will remove **ALL** existing VPN users and replace them with the list of users you specify. Therefore, you must include any existing user(s) you want to keep in the variables below. To use this script, choose one of the following options:
**Option 1:** Edit the script and enter VPN user details: **Option 1:** Edit the script and enter VPN user details:

View File

@ -7,16 +7,17 @@
## 使用辅助脚本卸载 VPN ## 使用辅助脚本卸载 VPN
**警告:** 此[辅助脚本](../extras/vpnuninstall.sh)将从你的服务器中删除 IPsec VPN。所有的 VPN 配置将被**永久删除**,并且 Libreswan 和 xl2tpd 将被移除。此操作**不可撤销** **警告:** 此辅助脚本将从你的服务器中删除 IPsec VPN。所有的 VPN 配置将被**永久删除**,并且 Libreswan 和 xl2tpd 将被移除。此操作**不可撤销**
要卸载 IPsec VPN运行[辅助脚本](../extras/vpnuninstall.sh)
```bash ```bash
wget -nv -O vpnunst.sh https://get.vpnsetup.net/unst wget https://get.vpnsetup.net/unst -qO vpnunst.sh && sudo bash vpnunst.sh
sudo bash vpnunst.sh
``` ```
## 手动卸载 VPN ## 手动卸载 VPN
另外,你也可以手动卸载 VPN。按照以下步骤操作。这些命令需要用 `root` 账户运行,或者使用 `sudo` 另外,你也可以手动卸载 IPsec VPN。按照以下步骤操作。这些命令需要用 `root` 账户运行,或者使用 `sudo`
**警告:** 以下步骤将从你的服务器中删除 IPsec VPN。所有的 VPN 配置将被**永久删除**,并且 Libreswan 和 xl2tpd 将被移除。此操作**不可撤销** **警告:** 以下步骤将从你的服务器中删除 IPsec VPN。所有的 VPN 配置将被**永久删除**,并且 Libreswan 和 xl2tpd 将被移除。此操作**不可撤销**

View File

@ -7,16 +7,17 @@
## Uninstall using helper script ## Uninstall using helper script
**Warning:** This [helper script](../extras/vpnuninstall.sh) will remove IPsec VPN from your server. All VPN configuration will be **permanently deleted**, and Libreswan and xl2tpd will be removed. This **cannot be undone**! **Warning:** This helper script will remove IPsec VPN from your server. All VPN configuration will be **permanently deleted**, and Libreswan and xl2tpd will be removed. This **cannot be undone**!
To uninstall IPsec VPN, run the [helper script](../extras/vpnuninstall.sh):
```bash ```bash
wget -nv -O vpnunst.sh https://get.vpnsetup.net/unst wget https://get.vpnsetup.net/unst -qO vpnunst.sh && sudo bash vpnunst.sh
sudo bash vpnunst.sh
``` ```
## Manually uninstall the VPN ## Manually uninstall the VPN
Alternatively, you may manually uninstall the VPN by following these steps. Commands must be run as `root`, or with `sudo`. Alternatively, you may manually uninstall IPsec VPN by following these steps. Commands must be run as `root`, or with `sudo`.
**Warning:** These steps will remove IPsec VPN from your server. All VPN configuration will be **permanently deleted**, and Libreswan and xl2tpd will be removed. This **cannot be undone**! **Warning:** These steps will remove IPsec VPN from your server. All VPN configuration will be **permanently deleted**, and Libreswan and xl2tpd will be removed. This **cannot be undone**!