Last active
November 1, 2017 17:56
-
-
Save zdj/9477257 to your computer and use it in GitHub Desktop.
Use openconnect as an alternative to Cisco AnyConnect VPN client.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export VPN_USER=$YOUR_VPN_USER | |
export VPN_HOST=$YOUR_VPN_HOST |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install openconnect | |
brew search tuntap | |
brew install tuntap | |
sudo cp -pR /usr/local/Cellar/tuntap/20111101/Library/Extensions/tap.kext /Library/Extensions/ | |
sudo cp -pR /usr/local/Cellar/tuntap/20111101/Library/Extensions/tun.kext /Library/Extensions/ | |
sudo chown -R root:wheel /Library/Extensions/tap.kext | |
sudo chown -R root:wheel /Library/Extensions/tun.kext | |
sudo touch /Library/Extensions/ | |
sudo cp -pR /usr/local/Cellar/tuntap/20111101/tap /Library/StartupItems/ | |
sudo chown -R root:wheel /Library/StartupItems/tap | |
sudo cp -pR /usr/local/Cellar/tuntap/20111101/tun /Library/StartupItems/ | |
sudo chown -R root:wheel /Library/StartupItems/tun | |
sudo mkdir /var/run/vpnc | |
cd /usr/local/bin | |
ln -s /usr/local/opt/tuntap/tap . | |
ln -s /usr/local/opt/tuntap/tun . | |
cd /Library/Extensions | |
sudo kextload -v tun.kext | |
touch ~/openconnect.pid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo openconnect -u $VPN_USER -b -l --pid-file=$HOME/openconnect.pid $VPN_HOST |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo kill `cat ~/openconnect.pid` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
vpn_connect.zsh will run the VPN connection in the background and log to the system log.