Configuration Guide for Cisco NCS 1004, IOS XR Release 25.x.x

PDF

Configuration Guide for Cisco NCS 1004, IOS XR Release 25.x.x

IKEv2 certificate-based authentication methods

Want to summarize with AI?

Log in

Explains how IKEv2 uses RSA digital signatures and PKI to authenticate peer devices during the establishment of security associations.


A certificate-based authentication method is a network security mechanism that

  • uses digital certificates issued by a trusted authority to validate the identity of devices,

  • relies on public key cryptography, and

  • enables secure exchange of cryptographic keys during the establishment of security associations (SAs).

Certification Authority (CA) interoperability allows Cisco NCS 1004 devices to communicate with CAs, enabling the devices to obtain and use digital certificates. A CA manages certificate requests and issues certificates to participating network devices, ensuring each device receives a unique, validated certificate

In public key cryptography, such as the RSA encryption system, each user has a key pair containing both a public and a private key. The keys act as complements, and anything encrypted with one of the keys can be decrypted with the other. In simple terms, a signature is formed when data is encrypted with a user's private key. The receiver verifies the signature by decrypting the message with the sender's public key. The fact that the message could be decrypted using the sender's public key indicates that the holder of the private key, the sender, must have created the message. This process relies on the receiver's having a copy of the sender's public key and knowing with a high degree of certainty that it does belong to the sender and not to someone pretending to be the sender.

With certificate-based authentication, each router authenticates itself to a remote peer by sending its CA-issued digital certificate and performing public key cryptography. A router proves its identity by using an RSA digital signature, which is verified by the remote peer using the public key encapsulated within the certificate. The validation process works because all participating routers trust the CA as a common authenticating authority.

In public key cryptography, like RSA, each user has a key pair (public and private keys). A signature is created when a sender encrypts data with its private key. The receiver verifies the signature by decrypting the data with the sender’s public key. Successful decryption proves the data came from the legitimate sender. In IKEv2, this signature process confirms the identity of each peer before establishing secure connections.

Configure IKEv2 certificate-based authentication

Use this supertask to configure IKEv2 certificate-based authentication by configuring RSA keys, CA certificates, IKEv2 profiles, and OTNSec.

Procedure

1.

Configure RSA keys and CA certificates. For more information, see Configure RSA keys and CA certificates.

2.

Configure IKEv2 profile and OTNSec. For more information, see Configure IKEv2 profile and OTNSec.


Configure RSA keys and CA certificates

Set up RSA key pairs and CA certificates on your device to enable secure authentication of IKEv2 peers with digital certificates.
Use this task when you need to configure secure, certificate-based authentication for routers or network devices using IKEv2.

Procedure

1.

Configure router hostname and IP domain name.

  1. Assign a unique hostname and domain name to your router. The router uses this information to create a fully qualified domain name (FQDN), which is required for key and certificate generation.

Note

The FQDN is included in the keys and certificates used by OTNsec.

Example:

RP/0/RP0/CPU0:ios#configure
RP/0/RP0/CPU0:IOS(config)#hostname myhost
RP/0/RP0/CPU0:IOS(config)#domain name mydomain.com
RP/0/RP0/CPU0:IOS(config)#commit
2.

Generate RSA key pair using the crypto key generate rsa command.

The RSA key pair is required before you can obtain a certificate for your router.

Example:

RP/0/RP0/CPU0:ios#crypto key generate rsa tp
Thu May  7 16:18:44.243 IST
The name for the keys will be: tp
Do you really want to replace them? [yes/no]: yes 
  Choose the size of the key modulus in the range of 512 to 4096 for your General Purpose Keypair. Choosing a key modulus greater than 512 may take a few minutes.

How many bits in the [2048]: 
Generating RSA keys ...
Done w/ crypto generate keypair
[OK]

RP/0/RP0/CPU0:ios#show crypto key mypubkey rsa 
Thu May  7 16:19:06.606 IST
Key label: tp
Type     : RSA General purpose
Size     : 2048
Created  : 16:18:49 IST Thu May 07 2020
3.

Declare the Certification Authority and configure a trustpoint.

Example:

RP/0/RP0/CPU0:ios#configure
RP/0/RP0/CPU0:ios (config)# crypto ca trustpoint myca
RP/0/RP0/CPU0:ios(config-trustp)# enrollment url http://209.165.200.226
RP/0/RP0/CPU0:ios(config-trustp)# subject-name CN=ncs,OU=BU,O=Govt,L=Newyork,ST=NY,C=US
RP/0/RP0/CPU0:ios(config-trustp)#serial-number
RP/0/RP0/CPU0:ios(config-trustp)# rsakeypair tp
RP/0/RP0/CPU0:ios(config-trustp)# crl optional
RP/0/RP0/CPU0:ios(config-trustp)# ip-address 10.0.0.100
RP/0/RP0/CPU0:ios(config-trustp)# commit
4.

Authenticate the CA using the crypto ca authenticate command.

The router must authenticate the CA by obtaining the self-signed certificate of the CA, which contains the public key of the CA. As the CA signs its own certificate, manually authenticate the public key of the CA by contacting the CA administrator to compare the fingerprint of the CA certificate.

Example:

RP/0/RP0/CPU0:ios#crypto ca authenticate myca
Thu May  7 16:20:08.458 IST
  Serial Number  : 01
   CN=ncs,OU=BU,O=Govt,L=Newyork,ST=NY,C=US
  Issued By      :
        CN=ncs,OU=BU,O=Govt,L=Newyork,ST=NY,C=US
  Validity Start : 11:55:46 UTC Wed Jan 08 2020
  Validity End   : 11:55:46 UTC Sat Jan 07 2023
  SHA1 Fingerprint:
         70562AA850DE24B2D94AACF62528042E53C33D23 
Do you accept this certificate? [yes/no]: yes
5.

Request device certificates using the crypto ca enroll command.

You must obtain a signed certificate from the CA for each of your router's RSA key pairs.

Example:

RP/0/RP0/CPU0:ios#crypto ca enroll myca
Thu May  7 16:20:34.776 IST
% Start certificate enrollment ... 
% Create a challenge password. You will need to verbally provide this
  password to the CA Administrator in order to revoke your certificate.
% For security reasons your password will not be saved in the configuration.
% Please make a note of it.

Password: 
Re-enter Password: 

% The subject name in the certificate will include: CN=ncs,OU=BU,O=Govt,L=Newyork,ST=NY,C=US
% The subject name in the certificate will include: myhost.mydomain.com
% The serial number in the certificate will be: 93f379c1
% The IP address in the certificate is 10.0.0.100
    Fingerprint:  41304434 42393333 45314143 42443134
6.

Verify the CA certificate using the show crypto ca certificates command.

Example:

RP/0/RP0/CPU0:ios#show crypto ca certificates myca
Thu May  7 16:21:24.633 IST

Trustpoint       : myca
==================================================
CA certificate 
  Serial Number  : 01
  Subject:
        CN=ncs,OU=BU,O=Govt,L=Newyork,ST=NY,C=US
  Issued By      :
        CN=ncs,OU=BU,O=Govt,L=Newyork,ST=NY,C=US
  Validity Start : 11:55:46 UTC Wed Jan 08 2020
  Validity End   : 11:55:46 UTC Sat Jan 07 2023
  SHA1 Fingerprint:
         70562AA850DE24B2D94AACF62528042E53C33D23 
Router certificate
  Key usage      : General Purpose 
  Status         : Available
RSA keys and CA certificates are now configured on your device. The device can authenticate IKEv2 peers using digital certificates.

Configure IKEv2 profile and OTNSec

Establish certificate-based authentication using IKEv2 and OTNSec to create a secure connection between network peers.
Use this task to secure OTN connections by configuring both IKEv2 profiles and OTNSec on ODU4 and ODUC4 controllers. This setup is used on various Cisco line cards such as 1.2T, 1.2TL, and OTN-XP cards for authenticated secure communications.

Procedure

1.

Configure the IKEv2 profile.

Example:

RP/0/RP0/CPU0:ios#configure
Thu May  7 16:22:33.804 IST
RP/0/RP0/CPU0:ios(config)#ikev2 profile IP1
RP/0/RP0/CPU0:ios(config-ikev2-profile-IP1)#match identity remote address 10.0.0.2 255.255.255.255
RP/0/RP0/CPU0:ios(config-ikev2-profile-IP1)#pki trustpoint myca
RP/0/RP0/CPU0:ios(config-ikev2-profile-IP1)#lifetime 86400
RP/0/RP0/CPU0:ios(config-ikev2-profile-IP1)#authentication local rsa-signature
RP/0/RP0/CPU0:ios(config-ikev2-profile-IP1)#authentication remote rsa-signature
RP/0/RP0/CPU0:ios(config-ikev2-profile-IP1)#commit
2.

Configure the GCC2 interface. For details on how to configure the GCC2 interface, refer to Configure the GCC interface.

3.

Configure OTNsec on ODU4 controller for 1.2T and 1.2TL line cards.

Example:

RP/0/RP0/CPU0:ios#configure
Thu May  7 16:27:57.294 IST
RP/0/RP0/CPU0:ios(config)#controller ODU4 0/1/0/0/1
RP/0/RP0/CPU0:ios(config-odu4)#otnsec
RP/0/RP0/CPU0:ios(config-otnsec)#source ipv4 10.0.0.1
RP/0/RP0/CPU0:ios(config-otnsec)#destination ipv4 10.0.0.2
RP/0/RP0/CPU0:ios(config-otnsec)#session-id 1
RP/0/RP0/CPU0:ios(config-otnsec)#policy OP1
RP/0/RP0/CPU0:ios(config-otnsec)#ikev2 IP1
RP/0/RP0/CPU0:ios(config-otnsec)#commit
4.

Configure OTNsec on ODUC4 controller for OTN-XP card.

Example:

RP/0/RP0/CPU0:ios#configure
Thu May  7 16:27:58.394 IST
RP/0/RP0/CPU0:ios(config)#controller ODUC4 0/0/0/12
RP/0/RP0/CPU0:ios(config-odu4)#otnsec
RP/0/RP0/CPU0:ios(config-otnsec)#source ipv4 10.0.0.1
RP/0/RP0/CPU0:ios(config-otnsec)#destination ipv4 10.0.0.2
RP/0/RP0/CPU0:ios(config-otnsec)#session-id 1
RP/0/RP0/CPU0:ios(config-otnsec)#policy OP1
RP/0/RP0/CPU0:ios(config-otnsec)#ikev2 IP1
RP/0/RP0/CPU0:ios(config-otnsec)#commit
5.

Verify the IKEv2 session is established.

Example:

RP/0/RP0/CPU0:ios#show ikev2 session 
Wed Sep 22 21:09:38.363 IST

Session ID                             : 4
===============================================================================
 Status                                : UP-ACTIVE
 IKE Count                             : 1
 Child Count                           : 1
 IKE SA ID                             : 373
-------------------------------------------------------------------------------
  Local                                : 10.0.0.1/500
  Remote                               : 10.0.0.2/500
  Status(Description)                  : READY (Negotiation done)
  Role                                 : Initiator

Make sure the session status is "UP-ACTIVE" and "Negotiation done".

Certificate-based OTNSec connectivity is established between peers and the IKEv2 session is active and verified.