Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Improving Digital Certificate Validation by Configuring Policy OIDs on an MX Series Device

In some situations, it might be desirable to only accept certificates with known policy object identifiers (OIDs) from peers. This optional configuration allows certificate validation to succeed only if the certificate chain received from the peer contains at least one policy OID that is configured on the MX Series device. This example shows how to configure policy OIDs in the IKE policy on an MX Series device.

Note:

You must ensure that at least one of the policy OIDs configured on the MX Series device is included in a peer’s certificate or certificate chain. Note that the policy-oids field in a peer’s certificate is optional. If you configure policy OIDs in an IKE policy and the peer’s certificate chain does not contain any policy OIDs, certificate validation for the peer fails.

Requirements

Before you begin:

  • Ensure that you are using Junos OS Release 16.1 or later for MX Series devices.

  • Configure an IPsec VPN tunnel.

Overview

This example shows an IKE policy configuration where policy OIDs 2.16.840.1.101.3.1.48.2 and 5.16.40.1.101.3.1.55.2 are specified. The IKE policy ike_cert_pol references the IKE proposal ike_cert_prop, which is not shown. The local certificate on the MX Series device is lc-igloo-root.

Configuration

Procedure

CLI Quick Configuration

To quickly configure this example, 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 CLI User Guide.

To configure policy OIDs for certificate validation:

  • Configure the IKE policy:

Results

From configuration mode, confirm your configuration by entering the show services ipsec-vpn ike policy ike_cert_pol command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

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

Verification

Confirm that the configuration is working properly.

Verifying the CA Certificate

Purpose

Display the CA certificate configured on the device.

Action

From operational mode, enter the show security pki ca-certificate ca-profile ca-tmp command.

Verifying Policy OID Validation

Purpose

If the peer’s certificate is successfully validated, IKE and IPsec security associations are established. If the validation of the peer’s certificate fails, no IKE security association is established.

Action

From operational mode, enter the show services ipsec-vpn ike security-associations and show services ipsec-vpn ipsec security-associations commands.

Meaning

The show services ipsec-vpn ike security-associations command lists all active IKE Phase 1 SAs. If no SAs are listed, there was a problem with Phase 1 establishment. In this case, check for the PKID_CERT_POLICY_CHECK_FAIL message in the system logs. This message indicates that the peer’s certificate chain does not contain a policy OID that is configured on the MX Series device. Check the policy-oids values in the peer’s certificate chain with the values configured on the MX Series device.

It might also be that the peer’s certificate chain does not contain any policy-oids fields, which are optional fields. If this is the case, certificate validation fails if there are any policy OIDs configured on the MX Series device.