Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Configure IPsec VPN with OCSP for Certificate Revocation Status

This example shows how to improve security by configuring two peers using the Online Certificate Status Protocol (OCSP) to check the revocation status of the certificates used in Phase 1 negotiations for the IPsec VPN tunnel.

Requirements

On each device:

  • Obtain and enroll a local certificate. This can be done either manually or by using the Simple Certificate Enrollment Protocol (SCEP).

  • Optionally, enable automatic renewal of the local certificate.

  • Configure security policies to permit traffic to and from the peer device.

Overview

On both peers, a certificate authority (CA) profile OCSP-ROOT is configured with the following options:

  • CA name is OCSP-ROOT.

  • Enrollment URL is http://10.1.1.1:8080/scep/OCSP-ROOT/. This is the URL where SCEP requests to the CA are sent.

  • The URL for the OCSP server is http://10.157.88.56:8210/OCSP-ROOT/.

  • OCSP is used first to check the certificate revocation status. If there is no response from the OCSP server, then the certificate revocation list (CRL) is used to check the status. The CRL URL is http://10.1.1.1:8080/crl-as-der/currentcrl-45.crlid=45.

  • The CA certificate received in an OCSP response is not checked for certificate revocation. Certificates received in an OCSP response generally have shorter lifetimes and a revocation check is not required.

Table 1 shows the Phase 1 options used in this example.

Table 1: Phase 1 Options for OCSP Configuration Example

Option

Peer A

Peer B

IKE proposal

ike_prop

ike_prop

Authentication method

RSA signatures

RSA signatures

DH group

group2

group2

Authentication algorithm

SHA 1

SHA 1

Encryption algorithm

3DES CBC

3DES CBC

IKE policy

ike_policy

ike_policy

Mode

aggressive

aggressive

Proposal

ike_prop

ike_prop

Certificate

local-certificate localcert1

local-certificate localcert1

IKE gateway

jsr_gateway

jsr_gateway

Policy

ike_policy

ike_policy

Gateway address

198.51.100.50

192.0.2.50

Remote identity

localcert11.example.net

-

Local identity

-

localcert11.example.net

External interface

reth1

ge-0/0/2.0

Version

v2

v2

Table 2 shows the Phase 2 options used in this example.

Table 2: Phase 2 Options for OCSP Configuration Example

Option

Peer A

Peer B

IPsec proposal

ipsec_prop

ipsec_prop

Protocol

ESP

ESP

Authentication algorithm

HMAC SHA1-96

HMAC SHA1-96

Encryption algorithm

3DES CBC

3DES CBC

Lifetime seconds

1200

1200

Lifetime kilobytes

150,000

150,000

IPsec policy

ipsec_policy

ipsec_policy

PFC keys

group2

group2

Proposal

ipsec_prop

ipsec_prop

VPN

test_vpn

test_vpn

Bind interface

st0.1

st0.1

IKE gateway

jsr_gateway

jsr_gateway

Policy

ipsec_policy

ipsec_policy

Establish tunnels

-

immediately

Topology

Figure 1 shows the peer devices that are configured in this example.

Figure 1: OCSP Configuration ExampleOCSP Configuration Example

Configuration

Configuring Peer A

CLI Quick Configuration

To quickly configure VPN peer A to use OCSP, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the [edit] hierarchy level, and then enter commit from configuration mode.

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.

To configure VPN peer A to use OCSP:

  1. Configure interfaces.

  2. Configure the CA profile.

  3. Configure Phase 1 options.

  4. Configure Phase 2 options.

Results

From configuration mode, confirm your configuration by entering the show interfaces, show security pki ca-profile OCSP-ROOT, show security ike, and show security ipsec commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

If you are done configuring the device, enter commit from configuration mode.

Configuring Peer B

CLI Quick Configuration

To quickly configure VPN peer B to use OCSP, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the [edit] hierarchy level, and then enter commit from configuration mode.

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.

To configure VPN peer B to use OCSP:

  1. Configure interfaces.

  2. Configure the CA profile.

  3. Configure Phase 1 options.

  4. Configure Phase 2 options.

Results

From configuration mode, confirm your configuration by entering the show interfaces, show security pki ca-profile OCSP-ROOT, show security ike, and show security ipsec commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

If you are done configuring the device, enter commit from configuration mode.

Verification

Confirm that the configuration is working properly.

Verifying CA Certificates

Purpose

Verify the validity of a CA certificate on each peer device.

Action

From operational mode, enter the show security pki ca-certificate ca-profile OCSP-ROOT or show security pki ca-certificate ca-profile OCSP-ROOT detail command.

In this example, IP addresses are used in the URLs in the CA profile configuration. If IP addresses are not used with CA-issued certificates or CA certificates, DNS must be configured in the device’s configuration. DNS must be able to resolve the host in the distribution CRL and in the CA URL in the CA profile configuration. Additionally, you must have network reachability to the same host to receive revocation checks.

Meaning

The output shows the details and validity of CA certificate on each peer as follows:

  • C—Country.

  • O—Organization.

  • CN—Common name.

  • Not before—Begin date of validity.

  • Not after—End date of validity.

Verifying Local Certificates

Purpose

Verify the validity of a local certificate on each peer device.

Action

From operational mode, enter the show security pki local-certificate certificate-id localcert1 detail command.

Meaning

The output shows the details and validity of a local certificate on each peer as follows:

  • DC—Domain component.

  • CN—Common name.

  • OU—Organizational unit.

  • O—Organization.

  • L—Locality

  • ST—State.

  • C—Country.

  • Not before—Begin date of validity.

  • Not after—End date of validity.

Verifying IKE Phase 1 Status

Purpose

Verify the IKE Phase 1 status on each peer device.

Action

From operational mode, enter the show security ike security-associations command.

From operational mode, enter the show security ike security-associations detail command.

Meaning

The flags field in the output shows that, IKE security association is created.

Verifying IPsec Phase 2 Status

Purpose

Verify the IPsec Phase 2 status on each peer device.

Action

From operational mode, enter the show security ipsec security-associations command.

From operational mode, enter the show security ipsec security-associations detail command.

Meaning

The output shows the ipsec security associations details.