Cisco IOS IKEv1 VPN Legacy Crypto Map with Pre-shared Keys — Grumpy Networkers Journal 0.0.7 documentation (2024)

In this section we will configure a pair of Cisco IOS routers to communicateover IPSec using IKEv1 using the older crypto map style of config andpre-shared key authentication

It is assumed that the router already has basic IP connectivity to the publicWAN and all private interfaces are configured. The default route is also assumedto be via the public WAN.

Configuration Steps

Step 2: Define the Phase 1 ISAKMP policy

crypto isakmp policy <priority-number> encryption <encryption-algorithm> hash <integrity-algorithm> group <dh-group> lifetime <seconds> authentication pre-share

Step 3: Define the Phase 2 IPSec Proposal

crypto ipsec transform-set <ts-name> <encryption-algorithm> <hashing-algorithm> mode tunnel

Step 4: Define the Encryption Domain

To define the traffic to be encrypted an ACL needs to be created.

Each entry in this access list will create a new Phase 2 Security Associationwhich will take up resources on the VPN gateways. Where it is possible to doso summarisation of networks should be done and also avoid the use ofper-host ACE’s or those specifying individual ports and protocols (interfaceACLS should be used for that purpose)

access-list <acl-id-or-name> permit <local-net> <local-wildcard> <remote-net> <remote-wildcard>

Step 5: Define the crypto map

crypto map <cm-name> <seq-number> ipsec-isakmp match address <acl-id-or-name> set transform-set <ts-name> set security-association lifetime seconds <seconds> set peer <ip-of-peer>

Step 6: Bind the Crypto Map to the receiving interface

interface <type><slot/num> crypto map <cm-name>

Complete example

The example below is based of the below topology:

Todo

Insert topology image

On the VPN Hub configure the following:

crypto isakmp key mysecretkey address 192.168.2.2crypto isakmp policy 10 encryption aes hash sha lifetime 86400 group 14 authentication pre-sharecrypto ipsec transform-set ESP-AES128-SHA1 esp-aes 128 esp-sha-hmac mode tunnelip access-list extended EACL-R1-TO-R2 permit ip 10.1.0.0 0.0.255.255 10.2.0.0 0.0.255.255crypto map CM-PUBLIC-WAN 10 ipsec-isakmp match address EACL-R1-TO-R2 set peer 192.168.2.2 set transform-set ESP-AES128-SHA1 set security-association lifetime seconds 28800interface FastEthernet0/0 crypto map CM-PUBLIC-WAN

On the VPN Spoke configure the following:

crypto isakmp key mysecretkey address 192.168.1.1crypto isakmp policy 10 encryption aes hash sha lifetime 86400 group 14 authentication pre-sharecrypto ipsec transform-set ESP-AES128-SHA1 esp-aes 128 esp-sha-hmac mode tunnelip access-list extended EACL-R2-TO-R1 permit ip 10.2.0.0 0.0.255.255 10.1.0.0 0.0.255.255crypto map CM-PUBLIC-WAN 10 ipsec-isakmp match address EACL-R2-TO-R1 set peer 192.168.1.1 set transform-set ESP-AES128-SHA1 set security-association lifetime seconds 28800interface FastEthernet0/0 crypto map CM-PUBLIC-WAN

Verification

Once the VPN configuration has been applied, it will likely be necesary togenerate some traffic which matches the encryption domain in order for thevpn establishment to start.

In this example we have a loopback interface configured on both the hub (10.1.1.1) and spoke (10.2.1.2) so initiating a ping between these hosts shouldbe sufficient.

Because the Hub could be busy with dealing with other VPNs, lets does this onthe spoke instead as follows:

ping 10.1.1.1 source 10.2.1.2

The first few pings are likely to fail whilst the VPN is coming up but afterthat they should reply without issue.

If the pings are replying we can probably assume that the VPN is up but howdo we know for sure.

Firstly lets check if the Phase 1 SA is up:

show crypto isakmp sa detail

The output should be similar to that below:

C-id Local Remote I-VRF Status Encr Hash Auth DH Lifetime Cap.1001 192.168.2.2 192.168.1.1 ACTIVE aes sha psk 14 23:59:53

If the status is showing a ACTIVE that is good as it means the VPN is believedto be stable and no further action is being taken. If is saying anything elseit could indicate the VPN is having issues or that it is renegotiating (such asduring a rekey after the lifetime has expired).

We can also see that the Phase 1 properties have negotiated to what weconfigured.

Assuming all is well, lets check that packets are being successfully encryptedand decrypted as follows:

show crypto ipsec sa peer 192.168.1.1

And the output should then be as follows:

interface: FastEthernet0/0 Crypto map tag: CM-PUBLIC-WAN, local addr 192.168.2.2 protected vrf: (none) local ident (addr/mask/prot/port): (10.2.0.0/255.255.0.0/0/0) remote ident (addr/mask/prot/port): (10.1.0.0/255.255.0.0/0/0) current_peer 192.168.1.1 port 500 PERMIT, flags={origin_is_acl,} #pkts encaps: 9, #pkts encrypt: 9, #pkts digest: 9 #pkts decaps: 9, #pkts decrypt: 9, #pkts verify: 9 #pkts compressed: 0, #pkts decompressed: 0 #pkts not compressed: 0, #pkts compr. failed: 0 #pkts not decompressed: 0, #pkts decompress failed: 0 #send errors 0, #recv errors 0 local crypto endpt.: 192.168.2.2, remote crypto endpt.: 192.168.1.1 path mtu 1500, ip mtu 1500, ip mtu idb FastEthernet0/0 current outbound spi: 0xA464B844(2758064196) PFS (Y/N): N, DH group: none inbound esp sas: spi: 0xAA697053(2859036755) transform: esp-aes esp-sha-hmac , in use settings ={Tunnel, } conn id: 5, flow_id: 5, sibling_flags 80004040, crypto map: CM-PUBLIC-WAN sa timing: remaining key lifetime (k/sec): (4311956/28771) IV size: 16 bytes replay detection support: Y Status: ACTIVE(ACTIVE) outbound esp sas: spi: 0xA464B844(2758064196) transform: esp-aes esp-sha-hmac , in use settings ={Tunnel, } conn id: 6, flow_id: 6, sibling_flags 80004040, crypto map: CM-PUBLIC-WAN sa timing: remaining key lifetime (k/sec): (4311956/28771) IV size: 16 bytes replay detection support: Y Status: ACTIVE(ACTIVE)

The key information here, is whether packets are being encrypted and decrypted.If they are all is well and no futher action should be necessary.

Other details that can be found out are whether the correct encryption andhashing is in place, whether PFS is being used, if reply detection is enabledand finally the remaining lifetime of the IPSec SA.

The SPI’s shown for both the inbound and outbound direct can be useful whenperforming packet captures as part of troubleshooting as they are not encryptedso can be used to identify a given VPN connection where possible a few arecoming from the same IP address (e.g. with multiple ACE entries in theencryption domain)

Troubleshooting

Problem: ISAKMP SA state reports ‘MM_KEY_EXCH’ and remote peer reports‘%CRYPTO-4-IKMP_BAD_MESSAGE: IKE message from <ip> failed its sanitycheck or is malformed’

Solution: Verify that the pre-shared key is configured correctly on bothpeers.

Problem: Report peer reports ‘phase 1 SA policy not acceptable!’ and localpeer does not establish an ISAKMP SA.

Solution: Verify that both peers have a matchin Phase 1 Policy, encryption,hashing and DH group need to be the same on at least one policy.

Cisco IOS IKEv1 VPN Legacy Crypto Map with Pre-shared Keys — Grumpy Networkers Journal 0.0.7 documentation (2024)

FAQs

How to configure IKEV1 on Cisco router? ›

Configuration on Branch1 ASA (firewall):-
  1. Step 1:- Create Crypto Ikev1 Policy. ...
  2. Step 2:- Create A Tunnel-Group To Specify A Pre-Shared Key For Peer. ...
  3. Step 3:- Create IPsec Transform-Set. ...
  4. Step 4:- Define Interesting Traffic ACCESS-LIST. ...
  5. Step 5:- Create A Crypto Map. ...
  6. Step 6:- Enable IKEV1 And Apply Crypto Map On The Interface.
Jan 25, 2022

What is IKEV1 VPN? ›

Internet Key Exchange (IKE) is a standard protocol used to set up a secure and authenticated communication channel between two parties via a virtual private network (VPN). The protocol ensures security for VPN negotiation, remote host and network access.

What is crypto map in IPSec? ›

This chapter describes the various types of IPsec crypto maps supported under StarOS. A crypto map is a software configuration entity that performs two primary functions: • Selects data flows that need security processing. • Defines the policy for these flows and the crypto peer to which that traffic needs to go.

How do I enable crypto IKEv2 on my Cisco router? ›

Make sure you can reach all the devices by pinging all IP Addresses.
  1. Step 1: Configure Host name and Domain name in IPSec peer Routers. ...
  2. Step 2: Define IKEv2 Keyring. ...
  3. Step 3: Define IKEv2 Proposal. ...
  4. Step 4: Define IKEv2 Policies. ...
  5. Step 5: Define Crypto ACL to identify IPSec secured traffic. ...
  6. Step 6: Define Transform Sets.

Is IKEv1 obsolete? ›

Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017 , <https://www.rfc-editor.org/info/rfc8174>.
...
Internet-DraftDeprecation of IKEv1 and some algorithmsOctober 2022
WoutersExpires 14 April 2023[Page]
Oct 11, 2022

What is the main difference between IKEv1 and IKEv2? ›

IKEv2 is better than IKEv1. IKEv2 supports more features and is faster and more secure than IKEv1. IKEv2 uses leading encryption algorithms and high-end ciphers such as AES and ChaCha20, making it more secure than IKEv1. Its support for NAT-T and MOBIKE also makes it faster and more reliable than its predecessor.

Does VPN access private data? ›

VPNs use encryption to create a secure connection over unsecured Internet infrastructure. VPNs are one way to protect corporate data and manage user access to that data. VPNs protect data as users interact with apps and web properties over the Internet, and they can keep certain resources hidden.

What is IKEv2 on Iphone? ›

Internet Key Exchange version 2 (IKEv2) is the default VPN setting for iOS. The IKEv2 is used to create a security association in the IPSec (Internet Protocol Security) suite. A security association (SA) establishes shared security attributes between two network entities to support secure communication.

What is IKEv1 aggressive mode? ›

The IKE: Initiate Aggressive Mode feature allows you to specify RADIUS tunnel attributes for an IP security (IPsec) peer and to initiate an Internet Key Exchange (IKE) aggressive mode negotiation with the tunnel attributes.

Why do people use VPN for crypto? ›

VPN adds another layer of security against malware, viruses, and phishing attacks. It hides your IP address to prevent IP tracking by hackers, government officials, and forensic analysis firms, so you can buy and sell crypto completely anonymously (if you avoid KYC/AML exchanges).

Should I mine crypto with VPN? ›

Having a VPN in place will protect your IP. This will make it much harder for hackers to trace your Bitcoin wallet address. So, when you transfer your mined Bitcoin to your wallet, the address won't be available, and it won't be compromised by hackers.

Should I use a VPN with crypto? ›

If you're in the business of crypto trading and wondering, “Should I use a VPN for cryptocurrency?”the short answer is yes. A virtual private network, or VPN, works to protect your data and keep your information safe, which is essential when trading cryptocurrencies.

What does crypto IKEv2 proposal do? ›

IKEv2 Policy. An IKEv2 policy contains proposals that are used to negotiate the encryption, integrity, PRF algorithms, and DH group in the IKE_SA_INIT exchange. It can have match statements, which are used as selection criteria to select a policy during negotiation.

What ports need to be open for IKEv2? ›

By default, IKEv2 uses IPSec, which requires UDP ports 500 and 4500, and ESP IP Protocol 50.

What is remote ID for IKEv2 VPN? ›

The Remote ID is the server address and the Local ID is the vpn username. Then the Remote ID will be also eu-fr.321inter.net, and the Local ID will be same as your username. Of course your username you have to replace by your real username and put in your VPN password.

Is IKEv1 safe? ›

Huawei Cloud recommends IKEv2 for negotiation because IKEv1 is not secure. In addition, IKEv2 performs better than IKEv1 in terms of connection negotiation and establishment, authentication methods, DPD timeout, and SA timeout. Huawei Cloud will not support IKEv1 soon.

Is IKEv1 still supported? ›

IKEv1 is an older version of the key exchange protocol used in IPsec, but is still officially supported in IOS, Cisco Systems' operating system for networking devices.

Why is IKEv1 deprecated? ›

In order to guarantee the safety of Liferay Cloud customers, we're deprecating the IKEv1 protocol and recommending the use of IKEv2. IKEv2 has now seen wide deployment and provides a full replacement for all IKEv1 functionality.

When should I use IKEv2? ›

If you want a security service that is a robust and strong VPN, IKEv2 can help provide good assurances. For the technically minded, IKEv2/IPsec uses the AES-256-GCM cypher for encryption, coupled with SHA2-384 for integrity. This is combined with perfect forward secrecy (PFS), using 3072-bit Diffie Hellmann keys.

Should I use IKEv2 or IPsec? ›

IPSec is considered secure and reliable, while IKEv2 is extremely fast and stable – IKEV2 offers quick re-connections when switching networks or during sudden drops. Thus, a combination of IKEv2/IPsec forms one of the best VPN protocols that exhibits the advantages of the two.

Is IKEv2 any good? ›

A Good VPN protocol for our daily use

IKEv2 is our primary VPN protocol in Apple endpoints. We widely use the this VPN for most of the daily use cases. Even though it offers only little set of features, it does it job up to the best. It seems faster and secure with reliability.

Can hackers see you on VPN? ›

Can someone track you through a VPN? It depends on your VPN. Reliable VPN services prevent tracking altogether, even in those countries where ISPs are legally obligated to keep online activity logs. That said, sketchy and free VPN services will make it easier for you to get hacked.

Can you be tracked on a VPN? ›

There is no way to track live, encrypted VPN traffic.

That's why police or government agencies who need information about websites you visited have to contact your internet service provider (ISP for short), and only then your VPN provider.

Does a VPN hide you from hackers? ›

So, in short, yes, a virtual private network (VPN) can protect you from hackers because it makes it impossible to track you. It redirects your internet traffic to a VPN server, where the data gets encrypted, and obfuscated.

Does IKEv2 hide IP address? ›

Save this question.

What does LTE VPN mean on iPhone? ›

VPN stands for virtual private network. It encrypts your online traffic and hides your IP. A VPN service routes your traffic via remote VPN servers, so neither your internet provider nor other third parties can intercept and snoop your traffic and sensitive data.

What is iPhone VPN used for? ›

A VPN, or Virtual Private Network, routes all of your internet activity through a secure, encrypted connection, which prevents others from seeing what you're doing online and from where you're doing it.

How do I set up E1? ›

  1. Set the system name, territory, contact and location on each router. ...
  2. Set the local time on the routers. ...
  3. Confirm the current state of the E1/PRI interface. ...
  4. Set the mode. ...
  5. Set the clock source. ...
  6. Set the CRC-4 mode. ...
  7. Confirm the configuration of the E1/PRI interface. ...
  8. Create an Unstructured TDM over the E1/PRI interface.

How do I enable E1 card on Cisco router? ›

Select the E1 controller and enter controller configuration mode. The slot number is always 0. Set a diagnostic loopback on the E1 line. Set a network payload loopback on the E1 line.

How to configure IPSec VPN Cisco router? ›

Configure IPSec - 4 Simple Steps
  1. Create extended ACL.
  2. Create IPSec Transform.
  3. Create Crypto Map.
  4. Apply crypto map to the public interface.

Top Articles
Latest Posts
Article information

Author: Cheryll Lueilwitz

Last Updated:

Views: 6147

Rating: 4.3 / 5 (54 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Cheryll Lueilwitz

Birthday: 1997-12-23

Address: 4653 O'Kon Hill, Lake Juanstad, AR 65469

Phone: +494124489301

Job: Marketing Representative

Hobby: Reading, Ice skating, Foraging, BASE jumping, Hiking, Skateboarding, Kayaking

Introduction: My name is Cheryll Lueilwitz, I am a sparkling, clean, super, lucky, joyous, outstanding, lucky person who loves writing and wants to share my knowledge and understanding with you.