mirror of
https://github.com/hwdsl2/docker-ipsec-vpn-server.git
synced 2026-04-26 10:05:48 +03:00
[GH-ISSUE #436] 能ping通服务器同网段其他主机,但没法http访问 #408
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 @shushenghong on GitHub (Jun 23, 2024).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/436
1、vpn server:mac os通过docker 安装,配置了ikev2 vpn分流,配置为
leftsubnet=192.168.0.0/242、http server:是一台和vpnserver在同一个局域网的内网http服务器,ip是192.168.0.172
3、client:macos通过ikev2连接vpn,已经连接上
能ping通http server,但没法http访问http server
4、日志为
@shushenghong commented on GitHub (Jun 23, 2024):
观察trafficstatus发现curl调用时inBytes outBytes确实在涨,但很慢
@hwdsl2 commented on GitHub (Jun 23, 2024):
@shushenghong 你好!对于你的用例,你提供的日志显示 VPN 已成功连接。请检查以下项目:
192.168.43.0/24的流量。检查 HTTP 服务器的监听 IP 和端口是否正确。@shushenghong commented on GitHub (Jun 24, 2024):
iptables -D FORWARD -j DROP后确实可以访问了这是啥原因呢,加上这个后会有其他问题吗?
@hwdsl2 commented on GitHub (Jun 24, 2024):
@shushenghong 在容器内运行
iptables -D FORWARD -j DROP会允许所有转发的流量。这样可以达到你的用例的需求,但是会有安全风险,比如因特网上的主机可能可以访问你的 VPN 客户端的端口。对于你的用例,在运行
iptables -D FORWARD -j DROP后可以访问,这说明你需要在 IPTables FORWARD Chain 添加合适的防火墙规则。如果要找到更好的解决方案的话,你可以添加一个 LOG 规则来记录被禁止的流量。
重新测试到 HTTP 服务器的连接后,使用 dmesg 命令查看 IPTables 防火墙记录。然后根据结果添加合适的 IPTables 规则。
在完成后,恢复删除的规则以提高安全性:
@shushenghong commented on GitHub (Jun 24, 2024):
感谢,dmesg里看不到任何iptables的日志,是需要哪里配置么
@shushenghong commented on GitHub (Jun 24, 2024):
我在vpn server的docker里,抓了个包

其中192.168.43.10是客户端ip,172.18.0.2是docker容器eth0虚拟网卡的ip
@shushenghong commented on GitHub (Jun 24, 2024):
这个192.168.65.1是个什么含义,我没太明白
@shushenghong commented on GitHub (Jul 21, 2024):
现在又再也不通了,关iptables都不行了,还是只能ping通,江湖救急
@shushenghong commented on GitHub (Jul 22, 2024):
临时换了台linux服务器,一切正常了,估计还是和mac作为host有关系