Preface#
I'm tired of the ugly interface of Pulse Secure, its incompatibility with ClashX, and the various issues of constantly restarting on startup and occupying my menu bar with its ugly icon. But because I'm not very skilled in technology, I don't know how to bypass this program and use Peking University VPN. Recently, I came across this project on Github, downloaded and tried it, and found that it really works, and can be used simultaneously with ClashX (using both the proxy and the school VPN). So I'm recording it here.
Instructions for use: Before using, please make sure you have carefully and completely read this document, including the Q&A section.
Configuration#
-
Clone this project to your local machine, and then change the startup password, IAAA username, and IAAA password in startvpn.sh.
-
Copy the entire folder (make sure the folder is named PKU-VPN) to your
~/
directory. -
Enter the following command in the terminal:
echo "\nstartvpn () {\n exec ~/PKU-VPN/startvpn.sh\n}\nstopvpn () {\n exec ~/PKU-VPN/stopvpn.sh\n}" >> ~/.zshrc
Purpose: Write the
startvpn()
andstopvpn()
functions into your.zshrc
for easy future use. -
Enter
brew install openconnect
in the terminal to download the openconnect library. -
Enter
source ~/.zshrc
to reload your configuration.
Usage#
- Connect to VPN: Enter
startvpn
in the terminal. Keep the window open during the connection process. - Disconnect from VPN: First, use
ctrl+C
to terminate the VPN connection process. Then open a new terminal window and enterstopvpn
.
Q&A#
After entering startvpn
, the program terminates and exits directly?#
This is because startvpn.sh
lacks executable permissions. Please enter the following command in the terminal:
chmod +x ~/PKU-VPN/startvpn.sh; chmod +x ~/PKU-VPN/stopvpn.sh
After completing the above steps, it can be used normally.
After disconnecting from VPN, I lose internet connection?#
I'm not sure about the reason for this, it may be caused by the openconnect
library. After actual testing, I found that simply disconnecting and reconnecting the network is enough to solve the problem. That's why I added an additional stopvpn.sh
to automate this process (its actual function is to disconnect the network and then reconnect, to be honest, it's a bit helpless).
If anyone knows the reason, please contact me to improve this project.
Update: According to pkuvpn#1, it may be a DNS issue.