10

My Mac Book pro with 10.11.2 has this annoying feature that it disconnects Cisco AnyConnect VPN every time I lock the screen.

I found some instructions on how to prevent Wi-Fi disconnection when locking the screen, but I could not apply those instructions to the AnyConnect network. I´m usually connected with Ethernet cable, if that matters.

Is there some way to disable such feature?

  • Did you find a solution to this? – thenakulchawla Jul 3 '18 at 19:51
6

TL;DR

Launch Terminal and run:

ifconfig | grep -B 6 'status: active' | head -n 1 | cut -d : -f 1

Then run (replace en0 below with the output of the command above):

cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources
sudo ./airport en0 prefs DisconnectOnLogout=NO
sudo pmset -a sleep 0

Long version

I am on MacOS Mojave (10.14).
For me this helped against automatically disconnecting from Cisco AnyConnect while on WiFi:

Open the Terminal app and paste:

ifconfig | grep -B 6 'status: active' | head -n 1 | cut -d : -f 1

This returned:

en0

Then type (replace en0 on line 2 with the returned value above):

cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources
sudo ./airport en0 prefs DisconnectOnLogout=NO

Type your password.
Check if the setting was saved by typing:

sudo ./airport prefs

Which should return this:

AirPort preferences for en0:

DisconnectOnLogout=NO
Unable to retrieve JoinMode
JoinModeFallback=DoNothing
RememberRecentNetworks=YES
RequireAdminIBSS=NO
RequireAdminNetworkChange=NO
RequireAdminPowerToggle=NO
WoWEnabled=YES

DisconnectOnLogout should be set to NO.

Next, prevent the system from going to sleep after locking:

sudo pmset -a sleep 0

That should do the trick, worked for me.

1

I have the same problem - my internet connection is 10/100 USB LAN. If I have Cisco anyconnect connected to the vpn and lock the screen it drops the vpn. The screensaver locking it seemed to not disconnect.

I am on 10.11.6 - El Capitan.

I use the lock screen solution described here:

MBP Lock screen hotkey without sleeping?

Did you find a solution? This is widely reported when people have wifi connections and lock the screen but there seem to be many potential solutions with nothing definitive. Your post seems to be somewhat unique in that it is a wired setup like mine. Any thoughts appreciated.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .