Cisco anyconnect linux terminal

How To Connect To VPN Server with Cisco AnyConnect from Linux Terminal

Proceed with the way that how to Connect to VPN Server with Cisco AnyConnect from Linux Terminal. It’s easy to connect from desktop but this article help those who want to use Command line Interface. We have already covered how to Connect VPN from desktop. Let’s start with these steps to continue

Connecting to VPN Server with Cisco AnyConnect from Linux Terminal

Run the given command to check the status of being installed Cisco AnyConnect from the previous guide.

$ ls /opt/cisco/anyconnect/bin/ 
total 3.7M
-rwxr-xr-x. 1 root root 14K Dec 29 03:26 acinstallhelper
-rwxr-xr-x. 1 root root 783K Dec 29 03:26 acwebhelper
-rwxr-xr-x. 1 root root 688 Dec 29 03:26 anyconnect_uninstall.sh
-rwxr-xr-x. 1 root root 315 Dec 29 03:26 load_tun.sh
-rwxr-xr-x. 1 root root 506K Dec 29 03:26 manifesttool
drwxr-xr-x. 2 root root 4.0K Dec 29 03:26 plugins
-rwxr-xr-x. 1 root root 76K Dec 29 03:26 vpn
-rwxr-xr-x. 1 root root 999K Dec 29 03:26 vpnagentd
-rwxr-xr-x. 1 root root 418K Dec 29 03:26 vpndownloader
-rwxr-xr-x. 1 root root 398K Dec 29 03:26 vpndownloader-cli
-rwxr-xr-x. 1 root root 487K Dec 29 03:26 vpnui
-rwxr-xr-x. 1 root root 9.2K Dec 29 03:26 vpn_uninstall.sh

Check out the vpn connection script command options:

$ /opt/cisco/anyconnect/bin/vpn --help 
Usage: vpn [options] | [cmd] [host] options: -h Print this usage statement. -v Print version. -s Read commands from response file to work non-interactively. Example: vpn -s < response.txt commands: [connect|disconnect|hosts|state|stats]

See the connection example

$ /opt/cisco/anyconnect/bin/vpn -s connect 192.168.10.10

Allow untrusted connections upon Prompt & provide user details to login to VPN

Copyright (c) 2004 - 2019 Cisco Systems, Inc. All Rights Reserved. 
state: Disconnected
state: Disconnected
notice: Ready to connect.
registered with local VPN subsystem.
contacting host (192.168.10.10) for login information…
notice: Contacting 192.168.10.10.
AnyConnect cannot verify server: 192.168.10.10
- Certificate does not match the server name.
Connecting to this server may result in a severe security compromise!
Most users do not connect to untrusted servers unless the reason for the error condition is known.
Connect Anyway? [y/n]: y
Please enter your username and password.
Username: sabi0329
Password: xxxxxxxx
Second Password:

The connection should be initiated if correct credentials were provided.

state: Connecting 
notice: Establishing VPN session…
Connection will be established if you have provided the correct credentials.
state: Connecting
notice: Establishing VPN session…
The AnyConnect Downloader is analyzing this computer. Please wait…
Initializing the AnyConnect Downloader…
The AnyConnect Downloader is performing update checks…
notice: The AnyConnect Downloader is performing update checks…
notice: Checking for profile updates…
notice: Checking for product updates…
The AnyConnect Downloader updates have been completed.
Please wait while the VPN connection is established…
notice: Checking for customization updates…
notice: Performing any required updates…
notice: The AnyConnect Downloader updates have been completed.
state: Connecting
notice: Establishing VPN session…
notice: Establishing VPN - Initiating connection…
notice: Establishing VPN - Examining system…
notice: Establishing VPN - Activating VPN adapter…
notice: Establishing VPN - Configuring system…
notice: Establishing VPN…
state: Connected
$ /opt/cisco/anyconnect/bin/vpn state 
Cisco AnyConnect Secure Mobility Client (version 4.7.01076) .
Copyright (c) 2004 - 2019 Cisco Systems, Inc. All Rights Reserved.
state: Connected
state: Connected
state: Connected
registered with local VPN subsystem.
VPN>

Pull connection stats by typing

$ /opt/cisco/anyconnect/bin/vpn stats

How To Disconnect VPN

Use the following command to disconnect VPN.

$ /opt/cisco/anyconnect/bin/vpn -s disconnect 192.168.10.11

Note: Replaces IP with your VPN Server IP address.

Читайте также:  Настройка x11vnc astra linux

Automate VPN Connection from CLI

To create an automatic connection, make a script first creating user details.

$ vim ~/.vpn_creds 
username
Password
y

Set up username, password in the file. Then create a script file like below:

$ vim vpn_connect.sh
!/bin/bash

VPN_SERVER="192.168.10.10"

echo "Connecting to VPN.."
/opt/cisco/anyconnect/bin/vpn -s < ~/.vpn_creds connect $

Now, make the script executable to run because without executable it wouldn’t run.

Now, run the script to Connect to your VPN

$ ./vpn_connect.sh 
Connecting to VPN..
Cisco AnyConnect Secure Mobility Client (version 4.7.01076) .
Copyright (c) 2004 - 2019 Cisco Systems, Inc. All Rights Reserved.
state: Disconnected
state: Disconnected
notice: Ready to connect.
registered with local VPN subsystem.
contacting host (192.168.10.10) for login information…
notice: Contacting 192.168.10.10.
Please enter your username and password.
Username: [jkmutai] jmutai
Password:
state: Connecting
notice: Establishing VPN session…
The AnyConnect Downloader is analyzing this computer. Please wait…
Initializing the AnyConnect Downloader…
The AnyConnect Downloader is performing update checks…
notice: The AnyConnect Downloader is performing update checks…
notice: Checking for profile updates…
notice: Checking for product updates…
notice: Checking for customization updates…
The AnyConnect Downloader updates have been completed.
notice: Performing any required updates…
Please wait while the VPN connection is established…
notice: The AnyConnect Downloader updates have been completed.
state: Connecting
notice: Establishing VPN session…
notice: Establishing VPN - Initiating connection…
notice: Establishing VPN - Examining system…
notice: Establishing VPN - Activating VPN adapter…
notice: Establishing VPN - Configuring system…
notice: Establishing VPN…
state: Connected

Источник

Installing and Using AnyConnect on Ubuntu Desktop using the User Interface

The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.

Читайте также:  Kali linux open office

Objective

The objective of this article is to guide you through installing and using AnyConnect VPN Client v4.9.x on Ubuntu Desktop version 20.04 using the User Interface (UI).

Introduction

AnyConnect Secure Mobility Client is a modular endpoint software product. It not only provides Virtual Private Network (VPN) access through Secure Sockets Layer (SSL) and Internet Protocol Security (IPsec) Internet Key Exchange version2 (IKEv2) but also offers enhanced security through various built-in modules.

AnyConnect Software Version

Table of Contents

Installing AnyConnect Secure Mobility Client v4.9.x

This toggled section provides details and tips for beginners.

Prerequisites

  • You need to purchase client license(s) from a partner like CDW or through your company's device procurement. There are options for 1 user (L-AC-PLS-3Y-S5) or packets of licenses including one year for 25 users (AC-PLS-P-25-S). Other license options available as well, including perpetual licenses. For more details on licensing, check out the links in the Licensing Information section below.
  • Download the latest version of firmware available for your router.(Click here for step-by-step instructions on this process.)
  • Ubuntu 20.04 (LTS), 18.04 (LTS), and 16.04 (LTS) .

Applicable Devices | Software Version

Licensing Information

AnyConnect client licenses allow the use of the AnyConnect desktop clients as well as any of the AnyConnect mobile clients that are available. You will need a client license to download and use the Cisco AnyConnect Secure Mobility Client. A client license enables the VPN functionality and are sold in packs of 25 from partners like CDW or through your company's device procurement.

Want to know more about AnyConnect licensing? Here are some resources:

Step 1

Open a web browser and navigate to the Cisco Software Downloads webpage.

Navigate to Cisco Software Downloads webpage.

Step 2

In the search bar, start typing 'Anyconnect' and the options will appear. Select AnyConnect Secure Mobility Client v4.x.

Читайте также:  Установка scapy kali linux

Step 3

Download the Cisco AnyConnect VPN Client. Most users will select the AnyConnect Pre-Deployment Package (Linux 64-bit) option.

The images in this article are for AnyConnect v4.9.x, which was latest version at the time of writing this document.

Download the AnyConnect Pre-Deployment Package for Linux from Cisco Software Downloads.

If you purchased a license and you are unable to download AnyConnect, call +1 919-993-2724. Select option 2. You will need to know your Cisco ID (the one you use to log into Cisco.com) and the sales order number when you call. They will get that situation all straightened out.

Step 4

Navigate to the folder where you have downloaded the AnyConnect Client Package.

Navigate to the folder where you have downloaded the AnyConnect Client Package.

Step 5

The initial download is a tarball archive (*.TAR, several files packed into one), which must be extracted. To extract the files, right- click on the AnyConnect archive and choose Open with Archive Manager. Click Extract.

The initial download is a tarball archive (*.TAR, several files packed into one), which must be extracted. To extract the files, right- click on the AnyConnect archive and choose Open with Archive Manager. Click Extract.

Step 6

You will see a notification once the extraction is completed. Click Close.

You will see a notification once the extraction is completed. Click Close.

Step 7

Locate the vpn_install.sh file in the extracted folder.

Locate the vpn_install.sh file in the extracted folder.

To run the AnyConnect install script, open a Linux Terminal by pressing Ctrl+Alt+T on your keyboard.

Type ‘sudo ./vpn_install.sh’. This will begin the installation process. For more details on the ‘sudo’ command, click here.

To run the AnyConnect install script, open a Linux Terminal by pressing Ctrl+Alt+T on your keyboard. Type ‘sudo ./vpn_install.sh’.

Step 8

Accept the terms in the license agreement to complete the installation by typing ‘y’.

Accept the terms in the license agreement to complete the installation by typing ‘y’.

Using AnyConnect Secure Mobility Client v4.9.x

Step 1

To access the AnyConnect app, click on the start icon (appears as nine dots on the lower left corner). Choose the Cisco Anyconnect app.

To access the AnyConnect app, click on the start icon (appears as nine dots on the lower left corner). Choose the Cisco Anyconnect app.

Alternatively, press Super+A (Super key is the windows icon key) on your keyboard to bring up the search bar. Start typing 'Anyconnect' and the app will appear.

Alternatively, press Super+A (Super key is the windows icon key) on your keyboard to bring up the search bar. Start typing 'Anyconnect' and the app will appear.

Step 2

Click on the AnyConnect Secure Mobility Client icon.

Click on the AnyConnect Secure Mobility Client icon.

Step 3

Enter the IP Address or Hostname of your desired server followed by the port number.

For RV340 family, the default port number is 8443.

Enter the IP Address or Hostname of your desired server followed by the port number.

Step 4

Enter your Username and Password in the fields provided. Click Connect.

Enter your Username and Password in the fields provided. Click Connect.

Step 5

Some connections may not be secure using a trusted SSL certificate. By default, AnyConnect Client will block connection attempts to these servers.

Uncheck Block connections to untrusted servers under Preferences to connect to these servers.

Some connections may not be secure using a trusted SSL certificate. By default, AnyConnect Client will block connection attempts to these servers. Uncheck Block connections to untrusted servers under Preferences to connect to these servers.

Step 6

As soon as the connection is established, the login Banner will appear. Click Accept.

As soon as the connection is established, the login Banner will appear. Click Accept.

You will also see notification that the Cisco AnyConnect Secure Mobility Client is Connected.

You will also see notification that the Cisco AnyConnect Secure Mobility Client is Connected.

Conclusion

There you have it! You have now successfully learned the steps to install and use the Cisco AnyConnect Secure Mobility Client v4.9.x on Ubuntu Desktop using the UI.

Источник

Оцените статью
Adblock
detector