Skip to content

Instantly share code, notes, and snippets.

@ptantiku
Last active April 12, 2020 23:42
Show Gist options
  • Save ptantiku/c3ae072666a554ff83ec8e39269377c5 to your computer and use it in GitHub Desktop.
Save ptantiku/c3ae072666a554ff83ec8e39269377c5 to your computer and use it in GitHub Desktop.
Setting up Mahidol VPN on Ubuntu

Setting up Mahidol VPN on Ubuntu

  • Mahidol VPN is Juniper Pulse VPN
  • Ubuntu network connection is managed by Network Manager

Normal Steps

sudo apt install openconnect libopenconnect5 network-manager-openconnect network-manager-openconnect-gnome

After that, in Network Manage:

  1. create VPN "Cisco AnyConnect Compatible VPN (openconnect)"
  2. change VPN Protocol to "Juniper/Pulse Network Connect"
  3. change Gateway to "https://vpn.mahidol.ac.th/dana-na/auth/url_default/welcome.cgi"
  4. leave the rest as default (blanks and nones)

Unfortunately, when trying to connect the input boxes cannot be parsed successfully. There is a missing input box, named "username", because of misconfiguration on HTML like this.

<input type="username" name="username" placeholder="firstname.sur or uxxxx or gxxxx">

The log error appears as: Ignoring unknown form input type 'username'

Difficult Steps

The good news is in the new OpenConnect (currently v.8.08) is able to parse 'type="username"'. (see file auth-juniper.c in the source code)

sudo apt install git build-essentials automake libssl-dev
git clone git://git.infradead.org/users/dwmw2/openconnect.git
cd openconnect
./autogen.sh
./configure
make
sudo make install

The installed files are in /usr/local/sbin, /usr/local/lib, and /usr/local/shared. Just need to copy to /usr/sbin, /usr/lib to overwrite the version from Ubuntu package manager.

sudo cp /usr/local/sbin/openconnect /usr/sbin/
sudo cp /usr/local/lib/libopenconnect* /usr/lib/x86_64-linux-gnu/
cd /usr/lib/x86_64-linux-gnu/
sudo rm libopenconnect.so libopenconnect.so.5
sudo ln -s libopenconnect.so.5.6.0 libopenconnect.so
sudo ln -s libopenconnect.so.5.6.0 libopenconnect.so.5

(P.S. current version produces "libopenconnect.so.5.6.0" file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment