mirror of
https://github.com/hwdsl2/docker-ipsec-vpn-server.git
synced 2026-04-26 10:05:48 +03:00
[GH-ISSUE #399] 不能访问vpn容器加入到其他network下的容器 #372
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 @Dlinw on GitHub (Sep 8, 2023).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/399
任务列表
问题描述
将当前vpn容器加入到另外一个network,访问不到另外一个network中的容器。
但在vpn容器内部可以访问到该network下的其他容器。
客户端连接vpn后只能访问到默认网卡bridge下的容器。
重现步骤
重现该 bug 的步骤:
期待的正确结果
希望可以访问到vpn容器加入到的任意一个network中的其他服务。
其它信息
添加关于该 bug 的其它信息。
@hwdsl2 commented on GitHub (Sep 8, 2023):
@Dlinw 你好!请参见 “访问 VPN 服务器的网段” 中需要添加的 IPTables 转发规则:
https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/advanced-usage-zh.md#%E8%AE%BF%E9%97%AE-vpn-%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E7%BD%91%E6%AE%B5
以上链接是关于不使用 Docker 直接创建的 VPN 服务器,对于 Docker 容器的用例,首先在容器中运行 Bash shell:
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
然后在容器内添加以上所述的 IPTables 规则。要在重启后继续有效,你可以将相关命令添加到 /opt/src/run.sh.