mirror of
https://github.com/hwdsl2/docker-ipsec-vpn-server.git
synced 2026-04-26 01:55:53 +03:00
[GH-ISSUE #325] 由于iptables相关错误,无法连接IKEv2 VPN #302
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @openegg on GitHub (Nov 23, 2022).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/325
任务列表
问题描述
启动ipsec-vpn-server Container后,无法连接VPN,用docker logs获取日志如下:
重现步骤
重现该 bug 的步骤:
期待的正确结果
简要地描述你期望的正确结果。
日志
检查日志及 VPN 状态,并添加错误日志以帮助解释该问题(如果适用)。
服务器信息(请填写以下信息)
客户端信息(请填写以下信息)
其它信息
@hwdsl2 commented on GitHub (Nov 23, 2022):
@openegg 你好!你的 Docker 主机操作系统缺少某些 IPTables 功能或内核支持,不能使用这个 Docker 镜像。请换用比如 Ubuntu, Debian, CentOS 等系统。
@hwdsl2 commented on GitHub (Nov 23, 2022):
@openegg 你可以尝试在 Docker 主机上运行 modprobe ip_tables 然后重新创建Docker容器。
@openegg commented on GitHub (Nov 24, 2022):
试过modprobe 还是不行。我的另一个docker容器,运行着aliyundrive-webdav,使用的是tcp端口,就没有问题
@openegg commented on GitHub (Nov 24, 2022):
这是iptables的设置,里面有500 4500端口的转发,能帮忙分析下有什么问题么?
CoreELEC:~ # iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:500
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:4500
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:500
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:4500
Chain FORWARD (policy DROP)
target prot opt source destination
DOCKER-USER all -- 0.0.0.0/0 0.0.0.0/0
DOCKER-OVERLAY all -- 0.0.0.0/0 0.0.0.0/0
DOCKER-ISOLATION-STAGE-1 all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
DOCKER all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
DOCKER all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
DROP all -- 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DOCKER-OVERLAY all -- 0.0.0.0/0 0.0.0.0/0
Chain DOCKER (2 references)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 172.17.0.3 tcp dpt:8080
ACCEPT udp -- 0.0.0.0/0 172.17.0.2 udp dpt:4500
ACCEPT udp -- 0.0.0.0/0 172.17.0.2 udp dpt:500
Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target prot opt source destination
DOCKER-ISOLATION-STAGE-2 all -- 0.0.0.0/0 0.0.0.0/0
DOCKER-ISOLATION-STAGE-2 all -- 0.0.0.0/0 0.0.0.0/0
RETURN all -- 0.0.0.0/0 0.0.0.0/0
Chain DOCKER-ISOLATION-STAGE-2 (2 references)
target prot opt source destination
DROP all -- 0.0.0.0/0 0.0.0.0/0
DROP all -- 0.0.0.0/0 0.0.0.0/0
RETURN all -- 0.0.0.0/0 0.0.0.0/0
Chain DOCKER-OVERLAY (2 references)
target prot opt source destination
wqpck5m64fk3 all -- 0.0.0.0/0 0.0.0.0/0
RETURN all -- 0.0.0.0/0 0.0.0.0/0
Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- 0.0.0.0/0 0.0.0.0/0
Chain wqpck5m64fk3 (1 references)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
DROP all -- 0.0.0.0/0 0.0.0.0/0
@openegg commented on GitHub (Nov 24, 2022):
我查到这个系统的iptable可配置的文件目录是 /storage/.config/iptables/rules.v4,是否和目录有关?
@hwdsl2 commented on GitHub (Nov 24, 2022):
@openegg 应该和目录无关。你提供的是 Docker 主机的 IPTables 规则。IPTables 的错误是在容器内部发生的,你可以尝试在容器中运行 Bash shell,然后尝试添加 VPN 相关的 IPTables 规则(参见 run.sh),应该会出现你之前所说的错误信息。
https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/docs/advanced-usage-zh.md#%E5%9C%A8%E5%AE%B9%E5%99%A8%E4%B8%AD%E8%BF%90%E8%A1%8C-bash-shell