diff --git a/docs/ikev2-howto-zh.md b/docs/ikev2-howto-zh.md index 7f6486a..3e1cece 100644 --- a/docs/ikev2-howto-zh.md +++ b/docs/ikev2-howto-zh.md @@ -195,7 +195,7 @@ wget https://git.io/ikev2setup -O ikev2.sh && sudo bash ikev2.sh 导出 `.p12` 文件: ```bash - pk12util -o vpnclient.p12 -n "vpnclient" -d sql:/etc/ipsec.d + pk12util -d sql:/etc/ipsec.d -n "vpnclient" -o vpnclient.p12 ``` ``` @@ -245,9 +245,9 @@ wget https://git.io/ikev2setup -O ikev2.sh && sudo bash ikev2.sh * [Windows 7, 8.x 和 10](#windows-7-8x-和-10) * [OS X (macOS)](#os-x-macos) +* [iOS (iPhone/iPad)](#ios) * [Android 10 和更新版本](#android-10-和更新版本) * [Android 4.x to 9.x](#android-4x-to-9x) -* [iOS (iPhone/iPad)](#ios) ### Windows 7, 8.x 和 10 @@ -276,7 +276,8 @@ wget https://git.io/ikev2setup -O ikev2.sh && sudo bash ikev2.sh 1. 单击 **创建**。 1. 在 **服务器地址** 字段中输入 `你的 VPN 服务器 IP` (或者域名)。 1. 在 **远程 ID** 字段中输入 `你的 VPN 服务器 IP` (或者域名)。 -1. 保持 **本地 ID** 字段空白。 +1. 在 **本地 ID** 字段中输入 `你的 VPN 客户端名称`。 + **注:** 该名称必须和你在 IKEv2 配置过程中指定的客户端名称一致。它与你的 `.p12` 文件名的第一部分相同。 1. 单击 **鉴定设置...** 按钮。 1. 从 **鉴定设置** 下拉菜单中选择 **无**。 1. 选择 **证书** 单选按钮,然后选择新的客户端证书。 @@ -285,6 +286,32 @@ wget https://git.io/ikev2setup -O ikev2.sh && sudo bash ikev2.sh 1. 单击 **应用** 保存VPN连接信息。 1. 单击 **连接**。 +### iOS + +首先,将生成的 `ikev2vpnca.cer` 和 `.p12` 文件安全地传送到你的 iOS 设备,并且逐个导入为 iOS 配置描述文件。要传送文件,你可以使用: + +1. AirDrop(隔空投送),或者 +1. 上传到设备,在 "文件" 应用程序中单击它们(必须首先移动到 "On My iPhone" 目录下),然后按照提示导入,或者 +1. 将文件放在一个你的安全的托管网站上,然后在 Mobile Safari 中下载并导入它们。 + +在完成之后,检查并确保新的客户端证书和 `IKEv2 VPN CA` 都显示在设置 -> 通用 -> 描述文件中。 + +1. 进入设置 -> 通用 -> VPN。 +1. 单击 **添加VPN配置...**。 +1. 单击 **类型** 。选择 **IKEv2** 并返回。 +1. 在 **描述** 字段中输入任意内容。 +1. 在 **服务器** 字段中输入 `你的 VPN 服务器 IP` (或者域名)。 +1. 在 **远程 ID** 字段中输入 `你的 VPN 服务器 IP` (或者域名)。 +1. 在 **本地 ID** 字段中输入 `你的 VPN 客户端名称`。 + **注:** 该名称必须和你在 IKEv2 配置过程中指定的客户端名称一致。它与你的 `.p12` 文件名的第一部分相同。 +1. 单击 **用户鉴定** 。选择 **无** 并返回。 +1. 启用 **使用证书** 选项。 +1. 单击 **证书** 。选择新的客户端证书并返回。 +1. 单击右上角的 **完成**。 +1. 启用 **VPN** 连接。 + +连接成功后,你可以到 这里 检测你的 IP 地址,应该显示为`你的 VPN 服务器 IP`。 + ### Android 10 和更新版本 1. 将生成的 `.p12` 文件安全地传送到你的 Android 设备。 @@ -314,31 +341,6 @@ wget https://git.io/ikev2setup -O ikev2.sh && sudo bash ikev2.sh 1. **(重要)** 单击 **Show advanced settings**。向下滚动,找到并启用 **Use RSA/PSS signatures** 选项。 1. 保存新的 VPN 连接,然后单击它以开始连接。 -### iOS - -首先,将生成的 `ikev2vpnca.cer` 和 `.p12` 文件安全地传送到你的 iOS 设备,并且逐个导入为 iOS 配置描述文件。要传送文件,你可以使用: - -1. AirDrop (隔空投送),或者 -1. 将文件上传到设备,在 "文件" 应用程序中单击它们(必须在 "On My iPhone" 目录下),然后按照提示导入,或者 -1. 将文件放在一个你的安全的托管网站上,然后在 Mobile Safari 中下载并导入它们。 - -在完成之后,检查并确保新的客户端证书和 `IKEv2 VPN CA` 都显示在设置 -> 通用 -> 描述文件中。 - -1. 进入设置 -> 通用 -> VPN。 -1. 单击 **添加VPN配置...**。 -1. 单击 **类型** 。选择 **IKEv2** 并返回。 -1. 在 **描述** 字段中输入任意内容。 -1. 在 **服务器** 字段中输入 `你的 VPN 服务器 IP` (或者域名)。 -1. 在 **远程 ID** 字段中输入 `你的 VPN 服务器 IP` (或者域名)。 -1. 保持 **本地 ID** 字段空白。 -1. 单击 **用户鉴定** 。选择 **无** 并返回。 -1. 启用 **使用证书** 选项。 -1. 单击 **证书** 。选择新的客户端证书并返回。 -1. 单击右上角的 **完成**。 -1. 启用 **VPN** 连接。 - -连接成功后,你可以到 这里 检测你的 IP 地址,应该显示为`你的 VPN 服务器 IP`。 - ## 添加一个客户端证书 如果要为更多的客户端生成证书,只需重新运行 [辅助脚本](#使用辅助脚本)。或者你可以看 [这一小节](#手动在-vpn-服务器上配置-ikev2) 的第 4 步。 @@ -432,7 +434,6 @@ wget https://git.io/ikev2setup -O ikev2.sh && sudo bash ikev2.sh ## 已知问题 1. Windows 自带的 VPN 客户端可能不支持 IKEv2 fragmentation。在有些网络上,这可能会导致连接错误或其它连接问题。你可以尝试换用 IPsec/L2TPIPsec/XAuth 模式。 -1. 不支持同时连接在同一个 NAT(比如家用路由器)后面的多个 IKEv2 客户端 (#237)。对于这个用例,请换用 IPsec/XAuth 模式。 1. Ubuntu 18.04 用户在尝试将生成的 `.p12` 文件导入到 Windows 时可能会遇到错误 "输入的密码不正确"。这是由 `NSS` 中的一个问题导致的。更多信息请看 这里。 1. 如果你使用 strongSwan Android VPN 客户端,则必须将服务器上的 Libreswan 升级到版本 3.26 或以上。 diff --git a/docs/ikev2-howto.md b/docs/ikev2-howto.md index 548334d..c4ceff4 100644 --- a/docs/ikev2-howto.md +++ b/docs/ikev2-howto.md @@ -195,7 +195,7 @@ The following example shows how to manually configure IKEv2 with Libreswan. Comm Export `.p12` file: ```bash - pk12util -o vpnclient.p12 -n "vpnclient" -d sql:/etc/ipsec.d + pk12util -d sql:/etc/ipsec.d -n "vpnclient" -o vpnclient.p12 ``` ``` @@ -245,9 +245,9 @@ Before continuing, you **must** restart the IPsec service. The IKEv2 setup on th * [Windows 7, 8.x and 10](#windows-7-8x-and-10) * [OS X (macOS)](#os-x-macos) +* [iOS (iPhone/iPad)](#ios) * [Android 10 and newer](#android-10-and-newer) * [Android 4.x to 9.x](#android-4x-to-9x) -* [iOS (iPhone/iPad)](#ios) ### Windows 7, 8.x and 10 @@ -276,7 +276,8 @@ First, securely transfer the generated `.p12` file to your Mac, then double-clic 1. Click **Create**. 1. Enter `Your VPN Server IP` (or DNS name) for the **Server Address**. 1. Enter `Your VPN Server IP` (or DNS name) for the **Remote ID**. -1. Leave the **Local ID** field blank. +1. Enter `Your VPN client name` in the **Local ID** field. + **Note:** This must match exactly the client name you specified during IKEv2 setup. Same as the first part of your `.p12` filename. 1. Click the **Authentication Settings...** button. 1. Select **None** from the **Authentication Settings** drop-down menu. 1. Select the **Certificate** radio button, then select the new client certificate. @@ -285,6 +286,30 @@ First, securely transfer the generated `.p12` file to your Mac, then double-clic 1. Click **Apply** to save the VPN connection information. 1. Click **Connect**. +### iOS + +First, securely transfer the generated `ikev2vpnca.cer` and `.p12` files to your iOS device, then import them one by one as iOS profiles. To transfer the files, you may use: + +1. AirDrop, or +1. Upload to your device, tap them in the "Files" app (must first move to the "On My iPhone" folder), then follow the prompts to import, or +1. Host the files on a secure website of yours, then download and import them in Mobile Safari. + +When finished, check to make sure both the new client certificate and `IKEv2 VPN CA` are listed under Settings -> General -> Profiles. + +1. Go to Settings -> General -> VPN. +1. Tap **Add VPN Configuration...**. +1. Tap **Type**. Select **IKEv2** and go back. +1. Tap **Description** and enter anything you like. +1. Tap **Server** and enter `Your VPN Server IP` (or DNS name). +1. Tap **Remote ID** and enter `Your VPN Server IP` (or DNS name). +1. Enter `Your VPN client name` in the **Local ID** field. + **Note:** This must match exactly the client name you specified during IKEv2 setup. Same as the first part of your `.p12` filename. +1. Tap **User Authentication**. Select **None** and go back. +1. Make sure the **Use Certificate** switch is ON. +1. Tap **Certificate**. Select the new client certificate and go back. +1. Tap **Done**. +1. Slide the **VPN** switch ON. + ### Android 10 and newer 1. Securely transfer the generated `.p12` file to your Android device. @@ -314,29 +339,6 @@ First, securely transfer the generated `.p12` file to your Mac, then double-clic 1. **(Important)** Tap **Show advanced settings**. Scroll down, find and enable the **Use RSA/PSS signatures** option. 1. Save the new VPN connection, then tap to connect. -### iOS - -First, securely transfer the generated `ikev2vpnca.cer` and `.p12` files to your iOS device, then import them one by one as iOS profiles. To transfer the files, you may use: - -1. AirDrop, or -1. Upload the files to your device, tap them in the "Files" app (must be in the "On My iPhone" folder), then follow the prompts to import, or -1. Host the files on a secure website of yours, then download and import them in Mobile Safari. - -When finished, check to make sure both the new client certificate and `IKEv2 VPN CA` are listed under Settings -> General -> Profiles. - -1. Go to Settings -> General -> VPN. -1. Tap **Add VPN Configuration...**. -1. Tap **Type**. Select **IKEv2** and go back. -1. Tap **Description** and enter anything you like. -1. Tap **Server** and enter `Your VPN Server IP` (or DNS name). -1. Tap **Remote ID** and enter `Your VPN Server IP` (or DNS name). -1. Leave the **Local ID** field blank. -1. Tap **User Authentication**. Select **None** and go back. -1. Make sure the **Use Certificate** switch is ON. -1. Tap **Certificate**. Select the new client certificate and go back. -1. Tap **Done**. -1. Slide the **VPN** switch ON. - Once successfully connected, you can verify that your traffic is being routed properly by looking up your IP address on Google. It should say "Your public IP address is `Your VPN Server IP`". ## Add a client certificate @@ -432,7 +434,6 @@ In certain circumstances, you may need to revoke a previously generated VPN clie ## Known issues 1. The built-in VPN client in Windows may not support IKEv2 fragmentation. On some networks, this can cause the connection to fail or have other issues. You may instead try the IPsec/L2TP or IPsec/XAuth mode. -1. Connecting multiple IKEv2 clients simultaneously from behind the same NAT (e.g. home router) is not supported (#237). For this use case, please instead use IPsec/XAuth mode. 1. Ubuntu 18.04 users may encounter the error "The password you entered is incorrect" when trying to import the generated `.p12` file into Windows. This is due to a bug in `NSS`. Read more here. 1. If using the strongSwan Android VPN client, you must upgrade Libreswan on your server to version 3.26 or above.