Usingthis information, I've set it so that the WiFi doesn't disconnect when I lock my mac. To lock the mac, I'm using this alias to lock my screen from the command line:
alias lockscreen='/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend' obtained from this article.
Unfortunately, when I lock my screen and come back, the WiFi stays connected but Viscosity, the VPN client I use, doesn't. I went to this website and it gave me the advice to keep my network adapter always on and linked to the same StackOverflow link I linked at the top. Is there a way I can keep Viscosity connected? I'm open to other VPN clients as well, I just need a good one that stays connected when I lock the screen and the wireless is connected.
I'm running Viscosity version 1.7 and my Mac information is as follows:
Could it be that the VPN adapter is using a different interface than ens0 and therefore I need to set the DisconnectLogout line in /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources to NO for that interface as well?
Edit: The wireless adapter still disconnects upon screen lock, so disregard my earlier claim. It worked fine when I slept it but when I used the screen lock alias, it didn't work. Not sure why this would be, so I'll need to look into this as well.