Preface#
I'm fed up with 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. However, because of my limited technical skills, I didn't know how to bypass this program and use Peking University VPN. Recently, I came across this project on Github and decided to give it a try. It turned out that it really works and can be used simultaneously with ClashX (using both the VPN and the school VPN). So, I'm writing this to document the process.
Usage Notice: Before using, please make sure you have carefully read this document, including the Q&A section.
Configuration#
-
Clone this project to your local machine, and then modify 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 access. -
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 immediately?#
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 should work normally.
After disconnecting from VPN, I lose internet connection?#
I'm not sure about the exact reason for this, it may be caused by the openconnect
library. In my actual testing, I found that simply disconnecting and reconnecting to the network solves the issue. That's why I added the stopvpn.sh
script to automate this process (basically disconnecting from the network and then reconnecting, to be honest, it's a bit helpless).
If anyone knows the reason, please feel free to contact me to improve this project.
Update: According to pkuvpn#1, it may be a DNS issue.