[GH-ISSUE #327] IKEv2、L2TP都无法链接 #305

Closed
opened 2026-03-02 08:01:13 +03:00 by kerem · 5 comments
Owner

Originally created by @CBillZhang on GitHub (Nov 26, 2022).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/327

服务器使用docker部署
image
image

但无法连接
无日志输出
使用七牛云服务器,500和4500udp端口都已打开
image

image

Mac用ikev2方式、iphone用l2tp方式,都无法正常连接
很奇怪的是docker log无连接日志

Originally created by @CBillZhang on GitHub (Nov 26, 2022). Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/327 服务器使用docker部署 <img width="708" alt="image" src="https://user-images.githubusercontent.com/12945259/204080793-e0504982-ad9a-4489-954d-ce38e28044e0.png"> <img width="625" alt="image" src="https://user-images.githubusercontent.com/12945259/204080830-c3d31bfd-696a-4a97-b19a-8ddbcca1c4a2.png"> 但无法连接 无日志输出 使用七牛云服务器,500和4500udp端口都已打开 <img width="1078" alt="image" src="https://user-images.githubusercontent.com/12945259/204080847-e4a57e22-1ff3-4fd8-9f42-64cb28d591e7.png"> <img width="482" alt="image" src="https://user-images.githubusercontent.com/12945259/204080882-43ca1fae-12a7-407a-9486-7c7a38200807.png"> Mac用ikev2方式、iphone用l2tp方式,都无法正常连接 很奇怪的是docker log无连接日志
kerem closed this issue 2026-03-02 08:01:14 +03:00
Author
Owner

@CBillZhang commented on GitHub (Nov 26, 2022):

补充下,七牛云硅谷服务器,centos8.5版本64位

<!-- gh-comment-id:1328075286 --> @CBillZhang commented on GitHub (Nov 26, 2022): 补充下,七牛云硅谷服务器,centos8.5版本64位
Author
Owner

@hwdsl2 commented on GitHub (Nov 26, 2022):

@CBillZhang 你好!我对这个服务器提供商(七牛云)不熟悉。根据你的描述,可能是防火墙的问题。在你的截图的防火墙配置中,请同时打开入站和出站方向的 UDP 500 和 4500 端口 (出站方向为源端口)。这可能与阿里云类似 (#433)。

你可以启用 Libreswan 日志,重新尝试连接,然后检查日志是否有错误:
https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/docs/advanced-usage-zh.md#%E5%90%AF%E7%94%A8-libreswan-%E6%97%A5%E5%BF%97

另外,你的 Docker 镜像较旧,可以更新镜像和容器:
https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/README-zh.md#%E6%9B%B4%E6%96%B0-docker-%E9%95%9C%E5%83%8F

<!-- gh-comment-id:1328076167 --> @hwdsl2 commented on GitHub (Nov 26, 2022): @CBillZhang 你好!我对这个服务器提供商(七牛云)不熟悉。根据你的描述,可能是防火墙的问题。在你的截图的防火墙配置中,请同时打开入站和出站方向的 UDP 500 和 4500 端口 (出站方向为源端口)。这可能与阿里云类似 ([#433](https://github.com/hwdsl2/setup-ipsec-vpn/issues/433))。 你可以启用 Libreswan 日志,重新尝试连接,然后检查日志是否有错误: https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/docs/advanced-usage-zh.md#%E5%90%AF%E7%94%A8-libreswan-%E6%97%A5%E5%BF%97 另外,你的 Docker 镜像较旧,可以更新镜像和容器: https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/README-zh.md#%E6%9B%B4%E6%96%B0-docker-%E9%95%9C%E5%83%8F
Author
Owner

@CBillZhang commented on GitHub (Nov 27, 2022):

image

你好,开启日志后,有链接日志
image

同时出方向端口也开了

<!-- gh-comment-id:1328160763 --> @CBillZhang commented on GitHub (Nov 27, 2022): <img width="1223" alt="image" src="https://user-images.githubusercontent.com/12945259/204117475-f27730f0-5332-42f5-9553-d1aa44e44076.png"> 你好,开启日志后,有链接日志 <img width="1178" alt="image" src="https://user-images.githubusercontent.com/12945259/204117492-0d8fa509-4e9d-4d65-97aa-80dd17670607.png"> 同时出方向端口也开了
Author
Owner

@hwdsl2 commented on GitHub (Nov 27, 2022):

@CBillZhang 你好!不需要打开 UDP 1701 端口。你的日志中的 retransmit 字样说明连接可能被 GFW 屏蔽了。建议你尝试其他解决方案比如 Shadowsocks。

<!-- gh-comment-id:1328168175 --> @hwdsl2 commented on GitHub (Nov 27, 2022): @CBillZhang 你好!不需要打开 UDP 1701 端口。你的日志中的 retransmit 字样说明连接可能被 GFW 屏蔽了。建议你尝试其他解决方案比如 Shadowsocks。
Author
Owner

@mengqingxiang commented on GitHub (Jan 2, 2025):

--network=host 可以试试这个,我进入到docker中的时候发现他ping不同任何域名,于是我尝试加了这个以后可以了

<!-- gh-comment-id:2567665917 --> @mengqingxiang commented on GitHub (Jan 2, 2025): --network=host 可以试试这个,我进入到docker中的时候发现他ping不同任何域名,于是我尝试加了这个以后可以了
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-ipsec-vpn-server#305
No description provided.