Docker Cisco Anyconnect Vpn



If you are working with Cisco AnyConnect you will find that the normal docker address of 192.168.99.100 will be blocked. This means that although you can start the docker server (docker-machine start), you won't be able to connect to it with the client (docker ps -a, for example), even when you've set the docker variables (docker-machine env).

Work around

When using VPN VPN (Cisco AnyConnect. To share C: on did not record the AnyConnect — IP range of 172.18.0.0/16 AnyConnect VPN client. I AnyConnect — to fix Docker Connection - jetbrains-infra/ docker - While on VPN - with a private network. Cisco's AnyConnect VPN to Get Docker Working not record the console issues when I tried — closed. AnyConnect breaks docker networks in a weird way and they stay broken even after you exit the VPN (even if you stop vpnagentd afterwards). The workaround is to stop docker, clear all its networks and bridges and only then start the AnyConnect VPN. You can start docker after the VPN session ends and it will re-create all necessary stuff.

Change the docker server default IP address and use the open source open connect version

Change the Docker server default address

Edit C:Users<username>.dockermachinemachinesdefaultconfig.json and changing 'HostOnlyCIDR': '10.168.99.1/24'.

You might optionally need to created a new HostOnly network adapter for the '10.168.99.1/24' in the VirtualBox default machine. You can do this by copying and pasting the existing one, and changing 192.* to 10.*.

Try without first and see if it works.

Any running docker images (not the docker-machine itself) might need restarting after connecting to the VPN.

Use Open Connect

Download the windows version:

Start the GUI, add a new Profile, and enter your company VPN hostname for the hostname (no need to enter any protocol or ports), and enter your VPN username.

NOTE: Make sure the Batch mode is not selected otherwise it will try and connect multiple times without prompting (as it will assume the credentials are in a default location). This could block you out from your company VPN, needing them to reset the connection

Click 'Connect', and then enter your VPN password prefix + your Symantec 6 digit code from your app in the prompt and it should connect.

I have been waiting in anticipation for WSL2 (Windows Subsystem for Linux) and on May 28th when the update released for general availability I updated immediately.

At first I was super hyped. WSL2 and the Ubuntu 20.04 image just worked and ran smoothly and quickly. Combined it with the release version of Windows Terminal it was a real delight.

VpnVpn

I also went and grabbed Docker Desktop for Windows as it now has support for WSL2 as the underlying system. And joy it just installed and worked. Now being capable of running Docker containers directly from my shell without doing some of doing it the way I did before having a Ubuntu VM running in VMware Workstation and connecting to it via docker-machine on my WSL1 Ubuntu image. A hassle to get to work and not a very smooth operation.

Install Cisco Anyconnect Vpn

Having the option to just start Docker containers is amazing!

But then I had to get some actual work done and booted up VMware Workstation to boot a VM. And it failed. With a Device Guard error. I followed the guides and attempted to disable Device Guard to no avail. Then it dawned on my. WSL2 probably enables the Hyper-V role! And that is exactly what happened.

Hyper-V and Workstation (or VirtualBox for that matter) do not mix well – that is until VMware released Workstation 15.5.5 to fix this exact problem just the day after WSL2 released. Perfect timing!

Simple fix – just update Workstation to 15.5.5 and reboot and WSL2 and Workstation now coexisted fine!

I played a bit more with WSL2 in the following days but ended up hitting some wierd issues where networking would stop working in the WSL2 image. No real fixes found. Many indicate DNS issues and stuff like that. Just Google “WSL2 DNS not working” and look at the mountains of issues.

Cisco Anyconnect Vpn Client Download

But I suspected something else because DNS not working was just a symptom – routing out of the WSL2 image was not working. Pinging IPs outside the image did not work. Not even the gateway IP. And if the default gateway is not working of course DNS is not working.

I found that restarting fixed the issue so got past it that way but today it was back. I was very interested in figuring out what happened. And then I realized the potential problem and tested the fix. I was connected to my work network via Cisco AnyConnect. I tried disconnecting from VPN and testing connectivity in WSL again – now it works. Connected to VPN again and connectivity was gone.

Okay – source found – what’s the fix? I found this thread on Github that mentions issues with other VPN providers even when not connected. Looking through the comments I found a reference to a different issue of the same problem but regarding AnyConnect specifically.

I looked through the comments and many fixes around changing DNS IP and other things but the fix that seem to do the trick was running the following two lines of Powershell in an elevated shell after connecting to VPN

Those two lines change the Interface Metric so that the WSL interface has a higher priority than the VPN connection. This inadvertently also fixed an issue that I had with local breakout when on VPN not working correctly.

Downside of the fix is that this needs to be run every time you connect to VPN. I implemented a simple Powershell function in my profile so I just have to open an elevated shell and type “Fix-WSLNet”.

Docker

Docker Cisco Anyconnect Vpn Client Download

That is all for now!