From 954b2acb7c3150b6b641fed431a7d518e6abf94d Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Mon, 1 Feb 2021 21:31:40 -0600 Subject: [PATCH] Fix for IKEv2 - Fix an issue where multiple IKEv2 clients behind the same NAT cannot connect simultaneously to the VPN server. Note that before this fix, this issue only occurs when using an IP address (instead of a DNS name) for IKEv2 for the VPN server. - This issue is found to be related to Libreswan's matching of local IDs when checking connections. A local ID with '@' prefix has type ID_FQDN, which does not match the ID_IPV4_ADDR type that the peer expects. This prevents connection switching from working correctly for the scenario above. Removing the prefix fixed the issue. - Fixes #924 --- docs/ikev2-howto-zh.md | 4 +++- docs/ikev2-howto.md | 4 +++- extras/ikev2setup.sh | 11 ++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/ikev2-howto-zh.md b/docs/ikev2-howto-zh.md index cc7e1c3..1ebb1cb 100644 --- a/docs/ikev2-howto-zh.md +++ b/docs/ikev2-howto-zh.md @@ -407,13 +407,15 @@ To customize IKEv2 or client options, run this script without arguments. fi ``` + **注:** 如果你在上面的第一步指定了服务器的域名(而不是 IP 地址),则必须将以下命令中的 `leftid=$PUBLIC_IP` 换成 `leftid=@$PUBLIC_IP`。 + ```bash cat > /etc/ipsec.d/ikev2.conf < /etc/ipsec.d/ikev2.conf < /etc/ipsec.d/ikev2.conf <> /etc/ipsec.d/ikev2.conf <> /etc/ipsec.d/ikev2.conf <