Vpnc Ipsec

Vpn


IPsec is often used to set up VPNs, and it works by encrypting IP packets, along with authenticating the source where the packets come from. Within the term 'IPsec,' 'IP' stands for 'Internet Protocol' and 'sec' for 'secure.'

IPSec VPN is a security feature that allow you to create secure communication link (also called VPN Tunnel) between two different networks located at different sites. Cisco IOS routers can be used to setup VPN tunnel between two sites. Traffic like data, voice, video, etc. can be securely transmitted through the VPN tunnel. In this post, I will show steps to Configure Site to Site IPSec VPN Tunnel in Cisco IOS Router. You can also setup Configure IPSec VPN With Dynamic IP in Cisco IOS Router.

Configure Site to Site IPSec VPN Tunnel in Cisco IOS Router

IPsec has been around for decades and is the tried-and-true solution. As time goes on, IPsec adapts by adding supported encryption and hash algorithms, like DES, which gave way to 3DES, which gave way to AES and so on. Every IPsec VPN connection goes through two phases. IPsec is a group of protocols that are used together to set up encrypted connections between devices. It helps keep data sent over public networks secure. IPsec is often used to set up VPNs, and it works by encrypting IP packets, along with authenticating the source where the packets come from. IPsec State of Deployment: The host to gateway and gateway to gateway IPv4 IPsec models are well deployed today in our system of VPNs and site-to-site bulk encryption gateways, so we will examine the deployment limitations of the newer host-to-host model often touted as a “killer applications” for.

Diagram below shows our simple scenario. The two sites have static public IP address as shown in the diagram. R1 is configured with 70.54.241.1/24 and R2 is configured with 199.88.212.2/24 IP address. As of now, both routers have very basic setup like, IP addresses, NAT Overload, default route, hostnames, SSH logins, etc.

There are two phases in IPSec configuration called Phase 1 and Phase 2. Let’s start the configuration with R1. Before you start configuring the IPSec VPN, make sure both routers can reach each other. I have already verified that both routers can ping each other so let’s start the VPN configuration.

Step 1. Configuring IPSec Phase 1 (ISAKMP Policy)


Here is the details of each commands used above,

  • crypto isakmp policy 5 – This command creates ISAKMP policy number 5. You can create multiple policies, for example 7, 8, 9 with different configuration. Routers participating in Phase 1 negotiation tries to match a ISAKMP policy matching against the list of policies one by one. If any policy is matched, the IPSec negotiation moves to Phase 2.
  • hash sha – SHA algorithm will be used.
  • authentication pre-share – Authentication method is pre-shared key.
  • group 2 – Diffie-Hellman group to be used is group 2.
  • encryption 3des – 3DES encryption algorithm will be used for Phase 1.
  • lifetime 86400 – Phase 1 lifetime is 86400 seconds.
  • crypto isakmp key [email protected] address 199.88.212.2 – The Phase 1 password is [email protected] and remote peer IP address is 199.88.212.2.

Step 2. Configuring IPSec Phase 2 (Transform Set)

Here is the detail of command used above,

  • crypto ipsec transform-set MY-SET – Creates transform-set called MY-SET
  • esp-aes – AES encryption method and ESP IPSec protocol will be used.
  • esp-md5-hmac – MD5 hashing algorithm will be used.
  • crypto ipsec security-association lifetime seconds – This is the amount to time that the phase 2 session exists before re-negotiation.

Step 3. Configuring Extended ACL for interesting traffic.

This ACL defines the interesting traffic that needs to go through the VPN tunnel. Here, traffic originating from 192.168.1.0 network to 192.168.2.0 network will go via VPN tunnel. This ACL will be used in Step 4 in Crypto Map.

Step 4. Configure Crypto Map.

Here is the detail of command used above,

  • crypto map IPSEC-STE-TO-STE-VPN 10 ipsec-isakmp – Creates new crypto map with sequence number 10. You can create more sequence numbers with same crypto map name if you have multiple sites.
  • match address VPN-TRAFFIC – Its matches interesting traffic from ACL named VPN-TRAFFIC.
  • set peer 199.88.212.2 – This is public IP address of R2.
  • set transform-set MY-SET – This links the transform-set in this crypto map configuration.

Step 5. Apply Crypto Map to outgoing interface of R1.

Step 6. Exclude VPN traffic from NAT Overload.

Ipsec

Above ACL 101 will exclude interesting traffic from NAT.

Now, repeat same steps in R2.

Step 1. Configuring IPSec Phase 1 (ISAKMP Policy)

Step 2. Configuring IPSec Phase 2 (Transform Set)

Step 3. Configuring Extended ACL for interesting traffic.

Step 4. Configure Crypto Map.

Step 5. Apply Crypto Map to outgoing interface

Step 6. Exclude VPN traffic from NAT Overload.

Verification and testing.

Vpn Ipsec Ios

To test the VPN connection let’s ping from R1 to PC2.

Vpnc Ipsec

As you can see, the ping from R1 to PC2 is successful. Don’t forget to ping from inside IP address while testing the VPN tunnel from the router. You can also ping from PC1 to PC2.

To verify the IPSec Phase 1 connection, type show crypto isakmp sa as shown below.

To verify IPSec Phase 2 connection, type show crypto ipsec sa as shown below.

You can also view active IPSec sessions using show crypto session command as shown below.

In this way you can configure Site to Site IPSec VPN tunnel in Cisco IOS Router.

Vpn ipsec ios

Vpn Ipsec/l2tp

You may also like -

The following two tabs change content below.
Bipin is a freelance Network and System Engineer with expertise on Cisco, Juniper, Microsoft, VMware, and other technologies. You can hire him on UpWork. Bipin enjoys writing articles and tutorials related to Network technologies. Some of his certifications are, MCSE:Messaging, JNCIP-SEC, JNCIS-ENT, and others.

Vpnc Ipsec Vs

  • Install Exchange 2019 in Windows Server 2019 - November 28, 2020
  • Why Backup your Microsoft Office 365 - November 27, 2020
  • What’s New in VMware vSphere 7 - September 18, 2020