Anyconnect VPN using local account

Network diagram


Configure inside and outside interface

ciscoasa(config)# int gi0/1
ciscoasa(config-if)# nameif outside
INFO: Security level for "outside" set to 0 by default.
ciscoasa(config-if)# ip address dhcp setroute
ciscoasa(config-if)# no shut
ciscoasa(config-if)# int gi0/0
ciscoasa(config-if)# nameif inside
INFO: Security level for "inside" set to 100 by default.
ciscoasa(config-if)# ip address
ciscoasa(config-if)# no shut

Self signed certificate

ciscoasa(config)# hostname vpn
vpn(config)# domain-name
vpn(config)# clock timezone SGT 8
vpn(config)# ntp server prefer

vpn(config)# sh ntp associations
      address         ref clock     st  when  poll reach  delay  offset    disp
 ~     2     3    64    0     8.5  35742.  16000.
 * master (synced), # master (unsynced), + selected, - candidate, ~ configured

vpn(config)# crypto key generate rsa label rsa-key modulus 2048 noconfirm
INFO: The name for the keys will be: rsa-key
Keypair generation process begin. Please wait...

vpn(config)# crypto ca trustpoint self
vpn(config-ca-trustpoint)# keypair rsa-key
vpn(config-ca-trustpoint)# fqdn
vpn(config-ca-trustpoint)# subject-name
vpn(config-ca-trustpoint)# enrollment self
vpn(config-ca-trustpoint)# exit
vpn(config)# crypto ca enroll self

% The fully-qualified domain name in the certificate will be:

% Include the device serial number in the subject name? [yes/no]: yes

Generate Self-Signed Certificate? [yes/no]: yes

Trustpoint is the container for certificate. The enrollment self command means self-signed certificate.

Enable the self-signed trustpoint

The self-signed certificate will be enabled on the interface where the VPN will terminate, in this lab is outside interface

vpn(config)# ssl trust-point self outside

Export the certificate to the vpn user computer

vpn(config)# crypto ca export self identity-certificate

The PEM encoded identity certificate follows:

Copy and paste from BEGIN CERTIFICATE until END CERTIFICATE and save as cert.cer. If you are using Windows you can use certmgr.msc and import the certificate. See screenshot below.


On Linux:
cyrus@cyrus-vm:~$ sudo nano /usr/local/share/ca-certificates/cert.cer
Then copy the certificate:


SSL VPN begins….

vpn(config)# username cyrus password P@ssw0rd
vpn(config)# username cyrus attributes
vpn(config-username)# service-type remote-access

This account solely for remote access vpn only.

vpn(config)# ip local pool VPN mask

Allocate a pool for vpn user after successfully login.

vpn(config)# webvpn
vpn(config-webvpn)#anyconnect image disk0:/anyconnect-linux-64-4.0.00048-k9.pkg
vpn(config-webvpn)# anyconnect enable
vpn(config-webvpn)# enable outside
INFO: WebVPN and DTLS are enabled on 'outside'.
vpn(config-webvpn)# tunnel-group-list enable

anyconnect enable to enable anyconnect and enable outside and enable webvpn on the outside interface. tunnel-group-list enable to enable drop down box on the anyconnect vpn client for group selection.

vpn(config)# group-policy VPN internal

Internal means the group-policy is stored locally.

vpn(config)# group-policy VPN attributes
vpn(config-group-policy)# address-pools value VPN
vpn(config-group-policy)# dns-server value
vpn(config-group-policy)# gateway-fqdn value
vpn(config-group-policy)# vpn-tunnel-protocol ssl-client ssl-clientless
vpn(config)#access-list SPLIT-TUNNEL standard permit
vpn(config)# group-policy VPN attributes
vpn(config-group-policy)# split-tunnel-policy tunnelspecified
vpn(config-group-policy)# split-tunnel-network-list value SPLIT-TUNNEL
vpn(config-group-policy)# split-tunnel-all-dns disable
vpn(config-group-policy)# split-dns value
vpn(config-group-policy)# default-domain value
vpn(config-group-policy)# vpn-idle-timeout 60
vpn(config-group-policy)# vpn-simultaneous-logins 1

This group-policy defines which VPN address assignment after successfully login, and also perform split tunnel.
Any traffic that matches SPLIT-TUNNEL is tunneled through the vpn.
Only DNS query for * will be tunneled through else the rest of the dns queries will not be tunneled.
The vpn idle timeout is set to 1 hour and only one login at any time no concurrent login is allowed.
To specify for ssl anyconnect client connection or webvpn (browser based) clientless connection methods.

vpn(config)# tunnel-group VPN type remote-access
vpn(config)# tunnel-group VPN general-attributes
vpn(config-tunnel-general)# default-group-policy VPN

Only need to define the default group policy, the rest leave as default. Anything default will be inherited from this “invisible” default group-policy DfltGrpPolicy, you can only see this group-policy when you issue show run all group-policy. This default group-policy cannot be deleted.

vpn(config-tunnel-general)# tunnel-group VPN webvpn-attributes
vpn(config-tunnel-webvpn)# group-alias VPN

Only create a group which will be displayed as a drop down box in Anyconnect client. The rest will be default settings inherited from “invisible” default tunnel group known as DefaultWEBVPNGroup similar to DfltGrpPolicy this cannot be deleted and can only be shown by using show run all tunnel-group

vpn(config)# vpn-sessiondb max-anyconnect-premium-or-essentials-limit 2

Ok this is stupid in my opinion, this command should not even exist!

If you do not specify there will be no connection available! If you buy license for example like 300 make sure you use this command and make the number to 300! Otherwise you will have users complaining cannot connect! This command simply means allowing 2 concurrent anyconnect vpn.

vpn(config)# sysopt connection permit-vpn

This command tells ASA to close a blind-eye whenever vpn traffic enters. Yeah it simply bypass whatever rules you set…

vpn(config)# http redirect outside 80

Ok simply to redirect http request to https… make your vpn user easier when they use the clientless.

Let’s test it!


Ok the redirection works, i used http instead of https…


On linux is a bit problematic on installing Cisco anyconnect client, so I use openconnect instead

apt install network-manager-openconnect

It is command line….:

cyrus@cyrus-vm:~/Downloads/binaries$ sudo openconnect
Attempting to connect to server
SSL negotiation with
Server certificate verify failed: signer not found

Certificate from VPN server "" failed verification.
Reason: signer not found
Enter 'yes' to accept, 'no' to abort; anything else to view: yes
Connected to HTTPS on
Got HTTP response: HTTP/1.0 302 Object Moved
Attempting to connect to server
SSL negotiation with
Server certificate verify failed: signer not found
Connected to HTTPS on
Got HTTP response: HTTP/1.0 302 Object Moved
SSL negotiation with
Server certificate verify failed: signer not found
Connected to HTTPS on
Please enter your username and password.
Please enter your username and password.
Got CONNECT response: HTTP/1.1 200 OK
CSTP connected. DPD 30, Keepalive 20
Connected tun0 as, using SSL
Established DTLS connection (using GnuTLS). Ciphersuite (DTLS0.9)-(RSA)-(AES-256-CBC)-(SHA1).

Ok a new virtual interface appears known as tun0


Ok so from my Cisco ASA gateway I can see this connection:


Posted in General stuffs, VPN | Tagged , , , , , | Leave a comment

[CISCO ACI] Inter tenant contract

The ACI configuration for inter tenant contract is complicated.

A contract provides two functions:

  1. Provide filter.
  2. Provide route leak.

A tenant is considered a VRF itself. In this example there are two tenants T05 and T06.

T05 exports the contract to T06, and T05 provide the contract. T06 consumed the contract exported by T06.

tenant to tenant contract4

Shared my bridge domain subnet.

tenant to tenant contract1

Export the contract. The contract created has a GLOBAL scope.

tenant to tenant contract2

Give a meaningful name of this export, because the target tenant can only see the name of the contract. Choose the GLOBAL scope contract which is ICMP-GLOBAL. Choose the target Tenant which is T06.

tenant to tenant contract3

Provide the ICMP-GLOBAL contract in EPG which you want to route leak to another tenant.

T06 will need to consume the contract exported from T05. T06 also follows the same steps as above. Now T05 will need to consume the exported contract from T06.

tenant to tenant contract5

On T05 tenant, select Application Profile > EPG > Contracts and right click to choose Add Consumed Contract Interface.

tenant to tenant contract6

Now T05 and T06 can ping to each other.

There is a common tenant which is a built-in in APIC, common tenant to another tenant communication does not need to do export, common tenant’s contract is visible by all tenants, but a contract created by a tenant is only visible by its own creator. Which is why tenant T05 need to export the contract to T06, and T06 did vice versa.



Posted in General stuffs, Software Defined Network | Tagged , | Leave a comment

[CISCO ACI] Same VRF contract

I have an EPG Web and an EPG DB, I have provided a contract in EPG web and consumed contract in EPG DB. The results are:

DB server can ping to Web server, and Web server can ping to DB server. How is this possible?

See the below screenshots. EPG Web provided the icmp contract, and EPG DB consumed the icmp contract.


EPG Web provided the contract


EPG db consumed the contract

The above is achieved due to these condition:

  1. The EPGs are under one VRF. No route leaking is required.
  2. The contracts have these defaults: Apply Both Directions and Reverse Filter Ports.


Posted in Software Defined Network | Tagged , , | Leave a comment

bigip snat automap

You created a forwarder virtual server for your servers behind the bigip appliance to access the internet, your server could not get a respond back. You troubleshoot the problem and found that:

  1. Default route is configured in the bigip.
  2. You cannot ping the next hop gateway specified in the default route.
  3. You could not determine if this is the cause of routing because the next hop router is not in your governance.

To troubleshoot the problem you can try using SNAT automap. SNAT automap will translate the address in this sequence:

  1. floating self ip of the egress vlan.
  2. floating self ip of a different vlan.
  3. non-floating self ip of an egress vlan.
  4. non-floating selfip of a different vlan.


After you have turned on the SNAT automap your server is able to get external updates


Now you can conclude that it is highly possible that the next hop router does not have a route back to your server.


what this means is that your server’s traffic is being translated into the floating self ip address of vlan internet, and the firewall thought that the incoming request is from a directly connected route.



Posted in F5, General stuffs | Tagged | Leave a comment

Is bigip packet filter stateful or stateless?

Packet filter
I have allowed vmnet5 to http and dns to any destination, and drop all for the rest.


Nmap from client


Actually nmap could not determine whether port 80 is opened or closed because there is no response.

Packet filter log


Looks like the packet filter accept despite TCP FIN was sent…

The below tcpdump proves that TCP FIN was sent over.


So based on the packet filter log I should conclude that packet filter is a stateless access control?

Posted in General stuffs | Leave a comment

Upgrade bigip image in active/standby HA

Import the latest iso to both the active and standby bigip


Install latest iso on standby bigip


On command line:

[root@bigip2:Standby:In Sync] config # tmsh
root@(bigip2)(cfg-sync In Sync)(Standby)(/Common)(tmos)# /sys software image
root@(bigip2)(cfg-sync In Sync)(Standby)(/Common)( install BIGIP- volume HD1.1

HD1.1 currently has the base version 12 image, we will want to overwrite this.


Activate the new image on the standby bigip


After the standby unit has finished rebooted the configsync status will be disconnected. This means latest configuration cannot be sync over to the standby unit. This is caused by version mismatch.

The active bigip will still be accepting traffic, failover to the standby unit is still possible. Hence after the active bigip finished installation, do a failover to the standby unit.

root@(bigip1)(cfg-sync Disconnected)(Active)(/Common)(tmos)# run /sys failover standby

Install the latest image on the active unit

The installation process is the same when upgrading the standby unit. The active bigip will still accept traffic hence till now there should be no disruption to the clients.


When finished installation, make this unit a standby bigip by issuing the command in tmsh.

root@(bigip1)(cfg-sync Disconnected)(Active)(/Common)(tmos)# run /sys failover standby

The failover should be transparent to the client, traffic will still be processed on the newly active bigip the state should also be failed over.


Activate the latest image.

Config sync device to group

Do a config sync and overwrite the config after the standby has finished reboot.

sync the configsync the config 2

Client’s impact


0% packet loss while doing the upgrade and failover


Posted in F5, General stuffs, High Availability | Tagged , | Leave a comment