How to Connect to Cisco AnyConnect using KDE NetworkManager (GUI)

Step 1 | Installing Dependencies

Step 1.1 | Installing NetworkManager OpenConnect

From Discover, Search for anyconnect package and select "NetworkManager - OpenConnect"

Or from commandline

apt install network-manager-openconnect openconnect

Step 2 | Configuring KDE Network Manager

Step 2.1 | Create a New VPN Connection

1. System Settings >> Connections >> Press the + sign to create a new connect

  1. System Settings >> Connections

  2. Press the + sign to create a new connection

  3. Select Cisco AnyConnect Compatible VPN (openconnect) option

  4. Press Create button

Step 2.2 | Add Connection Settings

5. Add the VPN server's (VPN Gateway) IP address or hostname

6. If your organization enforces MFA/2FA, press Token Authentication button

7. Select your MFA mechanizm (you should know yours)

8. Select how you would like to store the OTP. Most of the time you have a new token every time so you should not save the token and select "Ask for this password every time" then press OK.

Step 2.3 | Connect to the VPN

Once all is saved, now you have a VPN connection to use.

9. Select your VPN connection and the following window will show up. Press on the connect icon button.

At the first look, the popup window looks confusing as I was expecting to be prompted to enter my username, password, and passcode without the need to press the connect icon.

It would be much better if there was an obvious button called "Connect" on it right beside the Cancel button.

10. You will be prompt to enter your username, password, and token passcode.

You can find your configuration file for the above settings under the following path

/etc/NetworkManager/system-connections/YOUR_CONNECTION_NAME.nmconnection

In our case, its "New vpn connection" as follows

/etc/NetworkManager/system-connections/New\ vpn\ connection.nmconnection

And this is how the file content looks like

[connection]
id=New vpn connection
uuid=60384096-3397-4ac8-8d9e-b6b35a292435
type=vpn
permissions=user:YOUR_LINUX_LOGGED_USER:;

[vpn]
cookie-flags=2
enable_csd_trojan=yes
form:main:password-flags=2
form:main:secondary_password-flags=2
gateway=VPN_SERVER_IP_ADDRESS
gateway-flags=2
gwcert-flags=2
pem_passphrase_fsid=no
prevent_invalid_cert=no
protocol=anyconnect
reported_os=linux-64
stoken_source=totp
stoken_string-flags=2
service-type=org.freedesktop.NetworkManager.openconnect

[ipv4]
dns=DNS_SERVER1;DNS_SERVER2;DNS_SERVER3;
dns-search=DNS_SERVER_MAIN;
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

[proxy]

That's it

Last updated