当我使用Cisco VPN Anyconnect加入我的公司网络时,我无法让docker-machine连接到我的虚拟机VM。它与Cisco Anyconnect接管所有192.168。。路由有关。我也尝试使用完全不同的cidr范围(25.0.1.100/24),但仍然无法让docker-machine与VM通信。当我检查路由表时,路由被添加到utun0而不是vboxnet0。我假设utun0是VPN的主机网络接口。这里是docker-machine输出:
docker-machine create -d virtualbox dev
Running pre-create checks...
Creating machine...
Waiting for machine to be running, this may take a few minutes...
Machine is running, waiting for SSH to be available...
Detecting operating system of created instance...
Provisioning created instance...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
WARNING >>>
This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.
SSH for the machine should still work, but connecting to exposed ports, such as
the Docker daemon port (usually <ip>:2376), may not work properly.
You may need to add the route manually, or use another related workaround.
This could be due to a VPN, proxy, or host file configuration issue.
You also might want to clear any VirtualBox host only interfaces you are not using.
To see how to connect Docker to this machine, run: docker-machine env dev
答案 0 :(得分:13)
我在192.168.x.x上遇到类似的IP冲突问题。我解决了它改变VirtualBox主机网络的子网。
1)运行docker-machine rm dev
2)进入VirtualBox偏好设置并删除仅限主机的网络
3)运行docker-machine create --driver virtualbox --virtualbox-hostonly-cidr "25.0.1.100/24" dev
此处还有关于Github的讨论:https://github.com/docker/kitematic/issues/1029#issuecomment-156219462
答案 1 :(得分:2)
我遇到了同样的问题,this post on docker at github.com解决了这个问题。
sudo ifconfig vboxnet0 down && sudo ifconfig vboxnet0 up
您也可以将端口2377用作discussed here
答案 2 :(得分:0)
如果您可以选择在拆分隧道(而不是完全隧道)模式下运行Cisco VPN,那么这似乎运行良好,同时仍允许您访问公司网络。