Skip to content

Commit b30b951

Browse files
committed
Update docs
1 parent ea9b0dc commit b30b951

2 files changed

Lines changed: 38 additions & 4 deletions

File tree

docs/advanced-usage-zh.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,31 @@ sh vpn.sh
262262

263263
如果你的 VPN 服务器拥有公共(全局单播)IPv6 地址并且满足以下要求,IKEv2 客户端的 IPv6 支持将在 VPN 安装时自动启用,无需手动配置。
264264

265-
**注:** IPv6 支持已在 Android 上使用 strongSwan VPN 客户端进行测试,以及在 Windows 上使用以下注释中的额外步骤进行测试。其他平台(例如 macOS、iOS)可能存在限制,或者需要进行额外配置才能使 IPv6 通过 IKEv2 VPN 正常工作
265+
**注:** Android 上使用 strongSwan VPN 客户端时,IPv6 无需额外配置即可正常工作。对于 Windows macOS 客户端,请按照以下平台特定步骤进行配置。iOS 客户端目前不支持通过 IKEv2 VPN 路由 IPv6 流量
266266

267-
**注:** 对于 **Windows** 客户端,如果你使用了 `ikev2_config_import.cmd` 脚本导入 IKEv2 配置,可以在提示时输入 **y** 以自动添加 IPv6 路由。否则,你需要在 PowerShell 窗口中运行以下命令一次,以通过 VPN 路由 IPv6 流量。将 `IKEv2 VPN X.X.X.X` 替换为你的 VPN 连接的实际名称。完成后,重新连接到 IKEv2 VPN。
267+
<details>
268+
<summary>
269+
Windows:通过 VPN 路由 IPv6 流量
270+
</summary>
271+
272+
如果你使用了 `ikev2_config_import.cmd` 脚本导入 IKEv2 配置,可以在提示时输入 **y** 以自动添加 IPv6 路由。否则,你需要在 PowerShell 窗口中运行以下命令一次,以通过 VPN 路由 IPv6 流量。将 `IKEv2 VPN X.X.X.X` 替换为你的 VPN 连接的实际名称。完成后,重新连接到 IKEv2 VPN。
268273

269274
```powershell
270275
Add-VpnConnectionRoute -ConnectionName "IKEv2 VPN X.X.X.X" -DestinationPrefix ::/1
271276
Add-VpnConnectionRoute -ConnectionName "IKEv2 VPN X.X.X.X" -DestinationPrefix 8000::/1
272277
```
278+
</details>
279+
<details>
280+
<summary>
281+
macOS:通过 VPN 路由 IPv6 流量
282+
</summary>
283+
284+
连接到 IKEv2 VPN 后,需要在终端中运行以下命令以通过 VPN 路由 IPv6 流量。每次连接后都需要运行此命令。断开 VPN 时,该路由将自动删除。接口通常为 `ipsec0`;如果同时有多个 VPN 连接处于活动状态,可能为 `ipsec1` 等,运行 `ifconfig | grep ipsec` 确认。
285+
286+
```
287+
sudo route -n add -inet6 default -interface ipsec0
288+
```
289+
</details>
273290

274291
启用 IPv6 后,IKEv2 VPN 客户端将同时获得来自 `192.168.43.0/24` 地址池的 IPv4 地址和来自 `fddd:500:500:500::/64` 地址池的 IPv6 地址。VPN 服务器通过将客户端地址池的 IPv6 流量伪装(NAT)为服务器自身的 IPv6 地址,从而使 VPN 客户端能够通过该隧道获得完整的 IPv6 互联网访问。
275292

docs/advanced-usage.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,31 @@ In the examples above, `VPN_L2TP_LOCAL` is the VPN server's internal IP for IPse
262262

263263
If your VPN server has a public (global unicast) IPv6 address and the requirements below are met, IPv6 support for IKEv2 clients is automatically enabled during VPN setup. No manual configuration is needed.
264264

265-
**Note:** IPv6 support has been tested on Android using the strongSwan VPN client, and on Windows with the additional steps in the note below. Other platforms (e.g. macOS, iOS) may have limitations or require additional configuration for IPv6 to work over the IKEv2 VPN.
265+
**Note:** IPv6 works without additional configuration when using the strongSwan VPN client on Android. For Windows and macOS clients, follow the platform-specific steps below. iOS clients do not currently support routing IPv6 traffic through the IKEv2 VPN.
266266

267-
**Note:** For **Windows** clients, if you used the `ikev2_config_import.cmd` script to import IKEv2 configuration, you can answer **y** when prompted to automatically add IPv6 routes. Otherwise, run the following commands once in a PowerShell window to route IPv6 traffic through the VPN. Replace `IKEv2 VPN X.X.X.X` with the actual name of your VPN connection. When finished, reconnect to the IKEv2 VPN.
267+
<details>
268+
<summary>
269+
Windows: Route IPv6 traffic through the VPN
270+
</summary>
271+
272+
If you used the `ikev2_config_import.cmd` script to import IKEv2 configuration, you can answer **y** when prompted to automatically add IPv6 routes. Otherwise, run the following commands once in a PowerShell window to route IPv6 traffic through the VPN. Replace `IKEv2 VPN X.X.X.X` with the actual name of your VPN connection. When finished, reconnect to the IKEv2 VPN.
268273

269274
```powershell
270275
Add-VpnConnectionRoute -ConnectionName "IKEv2 VPN X.X.X.X" -DestinationPrefix ::/1
271276
Add-VpnConnectionRoute -ConnectionName "IKEv2 VPN X.X.X.X" -DestinationPrefix 8000::/1
272277
```
278+
</details>
279+
<details>
280+
<summary>
281+
macOS: Route IPv6 traffic through the VPN
282+
</summary>
283+
284+
After connecting to the IKEv2 VPN, run the following command in Terminal to route IPv6 traffic through the VPN. This command must be run each time you connect. The route is automatically removed when you disconnect from the VPN. The interface is usually `ipsec0`; if you have multiple VPN connections active it may be `ipsec1`, etc. Run `ifconfig | grep ipsec` to confirm.
285+
286+
```
287+
sudo route -n add -inet6 default -interface ipsec0
288+
```
289+
</details>
273290

274291
When IPv6 is enabled, IKEv2 VPN clients receive both an IPv4 address from the `192.168.43.0/24` pool and an IPv6 address from the `fddd:500:500:500::/64` pool. The VPN server masquerades IPv6 traffic from the client pool through the server's own IPv6 address, giving VPN clients full IPv6 internet access through the tunnel.
275292

0 commit comments

Comments
 (0)