docker - 无法从 docker 容器访问主机 VPN
问题描述
我已连接到主机中的 VPN(Docker for Windows),当我尝试在 network=bridge 或 network=host 模式下从 docker 容器 ping VPN 后面的端点时,出现以下错误:
root@linux:/# ping 172.XX.XX.X
From 172.XX.XX.X icmp_seq=15 Destination Host Unreachable
主机 ipconfig
Windows IP configuration
VEthernet Ethernet Adapter (Pre Modifier):
Specific DNS suffix for the connection. . :
Link: local IPv6 address. . . : fe70 :: adaf2: d383d1b8% 27
IPv4 address. . . . . . . . . . . . . . : 172.11.123.225
Subnet mask . . . . . . . . . . . . : 255.255.255.240
Default Gateway . . . . . :
Ethernet ethernet adapter (DockerNAT):
Specific DNS suffix for the connection. . :
IPv4 address. . . . . . . . . . . . . . : 10.0.75.1
Subnet mask . . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . :
Wi-Fi wireless LAN adapter:
IPv4 address. . . . . . . . . . . . . . : 192.178.1.14
Subnet mask . . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . : 192.168.1.1
Docker 容器 (ubuntu) ifconfig:
root@linuxki:/# ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe8223::42:dtff:fe62:f670 prefixlen 64 scopeid 0x20<link>
ether 01:30:dc:62:d6:551 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 168 (168.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.65.3 netmask 255.255.255.0 broadcast 192.168.65.255
inet6 fedtrss0::50:fqws:fe00:1 prefixlen 64 scopeid 0x20<link>
ether 02:50:00:10:03432:01 txqueuelen 1000 (Ethernet)
RX packets 66298 bytes 96432923 (96.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 23123 bytes 1318183 (1.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
hvint0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.75.2 netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::215:5dff:febc:e103 prefixlen 64 scopeid 0x20<link>
ether 00:45:5d:jc:e1:03 txqueuelen 1000 (Ethernet)
RX packets 857 bytes 142179 (142.1 KB)
RX errors 0 dropped 8 overruns 0 frame 0
TX packets 18 bytes 1408 (1.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 20 bytes 1900 (1.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 20 bytes 1900 (1.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
有什么帮助吗?
解决方案
推荐阅读
- drools - Drools - Kie Spring 集成 - 接口
- php - 带有浮点数的for循环中的PHP if条件
- c - 为什么我的函数中的数据没有传回 Main?
- angular - Angular CDK 拖动和复制行为问题
- javascript - 数字之间的Reactjs css空白
- scala - 在 Scala 中有没有办法拥有“ad-hoc”ADT?
- html - 我的 style.css 文件不适用于 html,当我保存文件时它显示记事本 + 设置
- python-3.x - 如何在 PyTorch 中嵌入一行标志(不是 nn.Embedding)?
- google-cloud-endpoints - 上次部署的 API 和实际使用的 API 之间似乎不匹配
- javascript - 将标题复制到剪贴板 HTML/JS