Replace AnyConnect with OpenConnect

The ISP upgraded my modem and router with IPv6 support, but the new environment caused some conflicts between the Cisco AnyConnect VPN and Apple Airplay.

When connecting to the VPN via IPv4 DTLS, every time I connected my MacBook with the HomePod mini through AirPlay, the VPN would disconnect and reconnect, meanwhile, I lost my Internet for a short period. Other devices under the same WiFi are not affected.

After spending quite some effort, I found many people have similar issues but there is no clear solution. Looks like the AnyConnect client frequently gets some bugs with IPv6, DTLS, and Apple’s ADWL protocol. Sometimes they get fixed with an update, sometimes not.

I had to look for an AnyConnect alternative and found OpenConnect. It’s open-source and supports most platforms. The only concern is it’s not been updated since mid 2020.

The installation on macOS is just one line if you have homebrew already installed:

brew install openconnect

After that, connect the VPN using the below command:

sudo openconnect --user=[username] [vpn_domain] # replace [username] and [vpn_domain]

You might see some messages regarding the server’s certificate, type “yes” if you trust the VPN server. You can follow the instructions and add the --servercert flag to skip this. There are also some scripts online that can automate the connection, authentication, and disconnection.

With OpenConnect, everything works perfectly fine including IPv6, interacting with HomePod mini is significantly more responsive and no more intermittent audios.

Licensed under CC BY-NC-SA 4.0
Built with Hugo
Theme Stack designed by Jimmy