How to setup a VPN using openconnect on Linux

In January 2017 I was using vpnc to setup a VPN.

Howerver, I run into disconnect problems after 8 hours. I asked here but didn't receive any answer. Then a network administrator said the following:

When using vpnc, the connection will always be dropped after it has been up for at most 8 hours, when rekeying occurs. This is because rekeying is not yet supported in vpnc, and Cisco's default rekey-intervall is 8 hours. Usually this is not too inconvenient, but you may want to consider using either GNU screen or TightVNC if you want to make sure you don't loose any state if you are disconnected unexpectedly.
Since this appears to be a vpnc limitation he further suggested that I try openconnect istead.

You first need to install openconnect:

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

… and follow the prompts. After that, I opened the network manager (or the nm-applet if you're using the i3 window manager) and configured the VPN as shown in the figure below (the name of the gateway was given to me by networks people) :

Following that, I selected the connection I had just configured from the network manager (or the nm-applet) as shown below:

… and was met with the following message which I simply dismissed (it's not consequential):

… then I was prompted to enter my credentials which I did as shown below:

… and the connection was established!

In case of failure this is the message that was shown on my screen (under the i3 window manager):