VPN openconnect pulse disconnects itself in Ubuntu 20

Solution 1:

Openconnect pulse VPN disconnects itself after sometime with "ESP detected dead peer" error in ubuntu 20. In ubuntu 18 it worked fine and kept on connected for long hours. Please help to resolve this.

I presume you are actually using the --protocol=nc option, and thereby connecting with the older Juniper/oNCP protocol, rather than the newer (but less well-supported) Pulse protocol. (Most Juniper/Pulse servers support both.) Assuming so…

We've discovered a subtle bug in Juniper rekey/reconnection which was introduced in OpenConnect v8.04. Thanks to the efforts of a dedicated user who was able to contribute detailed logs (see issue #322), I've been able to write a fix for it: merge request !293.

Please compile from source and test, so we can confidently include this in the next release.

(I am one of the core OpenConnect developers.)

Solution 2:

Problem is UDP. you disable DTLS and ESP. "openconnect --no-dtls" if you use NetworkManager,

sudo mv /usr/sbin/openconnect /usr/sbin/openconnect.bin;
sudo vi /usr/sbin/openconnect
#!/bin/bash
/usr/sbin/openconnect.bin --no-dtls "$@"

save /usr/sbin/openconnect

sudo chmod 755 /usr/sbin/openconnect;