CiscoVPN Ubuntu

Installing CiscoVPN on Ubuntu 20.x

How to setup AnyConnect and OpenConnect in Ubuntu (GUI & CLI)

Select one of these tutorials

    Installing AnyConnect in Ubuntu 20.x using command line (Credit goes to: socsci.uci.edu)

  1. First, install necessary packages:
  2. sudo apt-get update
    sudo apt-get install lib32z1 lib32ncurses6
    sudo apt-get install network-manager-openconnect
    sudo apt-get install libcanberra-gtk-module

    Now Download the 64 bit client file and save it to your Downloads folder.
  3. Go to the Downloads folder and extract the file:
  4. cd ~/Downloads
    tar -xzvf anyconnect-linux64-4.8.03043-predeploy-k9.tar.gz

  5. cd anyconnect-linux64-4.8.03043/
    cd vpn
    sudo ./vpn_install.sh

    Accept the license:

    How to install AnyConnect in Ubuntu CLI - Step 3

  6. Reload systemd, scanning for new or changed units:
  7. sudo systemctl daemon-reload

  8. Verify if the vpnagentd daemon is set up to be started each time your system is booted:
  9. ls -l /etc/rc?.d/*vpn*
    lrwxrwxrwx 1 root root 17 Apr 23 22:39 /etc/rc0.d/K01openvpn -> ../init.d/openvpn
    lrwxrwxrwx 1 root root 17 Apr 23 22:39 /etc/rc1.d/K01openvpn -> ../init.d/openvpn
    lrwxrwxrwx 1 root root 17 Apr 23 22:39 /etc/rc2.d/S01openvpn -> ../init.d/openvpn
    lrwxrwxrwx 1 root root 17 Apr 23 22:39 /etc/rc3.d/S01openvpn -> ../init.d/openvpn
    lrwxrwxrwx 1 root root 17 Apr 23 22:39 /etc/rc4.d/S01openvpn -> ../init.d/openvpn
    lrwxrwxrwx 1 root root 17 Apr 23 22:39 /etc/rc5.d/S01openvpn -> ../init.d/openvpn
    lrwxrwxrwx 1 root root 17 Apr 23 22:39 /etc/rc6.d/K01openvpn -> ../init.d/openvpn

  10. Make command aliases to point to the vpn and vpnui commands:
  11. alias vpn='/opt/cisco/anyconnect/bin/vpn'
    alias vpnui='/opt/cisco/anyconnect/bin/vpnui'

  12. Also add these aliases to the end of your ~/.bashrc or ~/.bash_aliases file:
  13. cat >> ~/.bash_aliases
    alias vpn='/opt/cisco/anyconnect/bin/vpn'
    alias vpnui='/opt/cisco/anyconnect/bin/vpnui'

    At the end press Ctrl+D to finish
    ^D

  14. cd /opt/.cisco/certificates
    sudo mv ca ca.orig
    sudo ln -sf /etc/ssl/certs/ ca
    sudo /etc/init.d/vpnagentd restart
  15. If restart command not found, please issue a reboot


  16. Connecting and disconnecting method 1 (Recommended):
  17. vpnui
    How to install AnyConnect in Ubuntu CLI - Step 9
  18. Go to the setting and make sure " Block connections to untrusted servers" is unchecked:
  19. How to install AnyConnect in Ubuntu CLI - Step 10
  20. Enter your server IP, username and password and then hit the connect button and click on " Connect Anyway":
  21. How to install AnyConnect in Ubuntu CLI - Step 11

    Note: To see your server IP address, login here with your username and password.

    How to install AnyConnect in Ubuntu CLI - Step 11
    To disconnect, just click " Disconnect" in the window
  22. Connecting and disconnecting method 2:
  23. vpn

    At the VPN> prompt, type connect Your Server Address and press Enter. Example:

    connect https://81.22.216.194:8080/

  24. Connect Anyway? [y/n]: y
      >> Please enter your username.
    
    Username: [Your Username] 
    
      >> Please enter your password.
    Password: 

  25. To disconnect, type disconnect and then quit to exit application

    Installing OpenConnect in Ubuntu 20.x using command line

  1. Install/update the latest packages:
  2. sudo apt-get update

  3. Enable TUN module:
  4. sudo /sbin/modprobe tun

  5. Install OpenConnect:
  6. sudo apt-get install openconnect

  7. Connecting and disconnecting:
  8. sudo openconnect Server IP

    Note: To see your server IP address, login here with your username and password.


    To disconnect VPN, just close the terminal

    Installing AnyConnect OpenConnect in Ubuntu 20.x using GUI (Graphical User Interface)

  1. Install necessary packages:
  2. sudo apt-get update
    sudo apt install network-manager-openconnect network-manager-openconnect-gnome

    Type y when ask to continue

    How to install AnyConnect in Ubuntu GUI - Step 1
  3. Go to the Setting > Network and click on " +" icon in VPN section:
  4. How to install AnyConnect in Ubuntu GUI - Step 2
  5. In "Add VPN" window select " Multi-protocol VPN client (openconnect)":
  6. How to install AnyConnect in Ubuntu GUI - Step 3
  7. In the name box type a proper name such as " RapidVPN AnyConnect".
    Add your Server IP in " Gateway" and then click " Add" button:
  8. Note: To see your server IP address, login here with your username and password.

    How to install AnyConnect in Ubuntu GUI - Step 4
  9. Hit the toggle button and enter your username and password by clicking on " Login" button:
  10. How to install AnyConnect in Ubuntu GUI - Step 5
    How to install AnyConnect in Ubuntu GUI - Step 5

    Click " Login" agian after your enter your password to establish VPN connection:

    How to install AnyConnect in Ubuntu GUI - Step 5
  11. Done! to disconnect just toggle connect button:
  12. How to install AnyConnect in Ubuntu GUI - Step 6