Cannot force docker machine to work with virtual unit when using Cisco VPN AnyConnect

When I use the Cisco VPN Anyconnect to connect to my corporate network, I cannot get the docker machine to connect to my virtual virtual machine. This is because Cisco Anyconnect uses all 192.168 .. routes. I also tried using a completely different cidr range (25.0.1.100/24), but still cannot get the docker machine to talk to VM. When I check the route table, the route is added to utun0 instead of vboxnet0. I assume utun0 is the network interface of the VPN host. Here's the docker machine output:

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 
+7
docker virtualbox boot2docker docker-machine vpn
source share
3 answers

I had a similar problem with IP conflicts on 192.168.xx I decided that this change to the network subnet is for the VirtualBox host only.

1) run docker-machine rm dev

2) Go to VirtualBox settings and delete the host-only network

3) run docker-machine create --driver virtualbox --virtualbox-hostonly-cidr "25.0.1.100/24" dev

Github is also discussed here: https://github.com/docker/kitematic/issues/1029#issuecomment-156219462

+13
source share

I have the same problem and this docker post on github.com resolves it.

 sudo ifconfig vboxnet0 down && sudo ifconfig vboxnet0 up 

You can also use port 2377 as discussed here.

+2
source share

If you have the option of starting the Cisco VPN in Split Tunnel mode (instead of Full Tunnel), this seems to work fine, but it allows you to access your corporate network.

0
source share

All Articles