Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Configuring Media Access Control Security (MACsec) on Routers

Media Access Control Security (MACsec) is an industry-standard security technology that provides secure communication for almost all types of traffic on Ethernet links. MACsec provides point-to-point security on Ethernet links between directly-connected nodes and is capable of identifying and preventing most security threats, including denial of service, intrusion, man-in-the-middle, masquerading, passive wiretapping, and playback attacks. MACsec is standardized in IEEE 802.1AE.

Starting with Junos OS Release 15.1, you can configure MACsec to secure point-to-point Ethernet links connecting MX Series routers with MACsec-capable MICs, or on Ethernet links connecting a switch to a host device such as a PC, phone, or server. Each point-to-point Ethernet link that you want to secure using MACsec must be configured independently. You can enable MACsec on router-to-router links using static connectivity association key (CAK) security mode. The process is provided in this document.

Configuring MACsec Using Preshared Key Hitless Rollover Keychain (Recommended for Enabling MACsec on Router-to-Router Links)

In the MACsec implementation using static connectivity association key (CAK) prior to release 17.4R1, the user is allowed to configure one static CAK for every connectivity association. Whenever CAK configuration changes, the MACsec session is dropped, resetting peer sessions or interrupting the routing protocol.

For increased security and to prevent session drops when the CAK configuration changes, the hitless rollover keychain feature is implemented. In this implementation, a key chain that has the multiple security keys, key names and start times is used. Each key in the keychain has a unique start time. At the next key’s start time, a rollover occurs from the current key to the next key, and the next key becomes the current key. With the implementation of the hitless rollover keychain feature, the MACsec Key Agreement (MKA) protocol establishes MACsec sessions successfully without any session drop when the CAK configuration changes.

For a successful MACsec configuration using preshared key (PSK) hitless rollover keychain:

  • The keychain names, keys and start time of each key must be the same in both the participating nodes.

  • The order of the keychain names, keys and start time must be same in both the participating nodes.

  • The time must be synchronized in the participating nodes.

The existing authentication-key-chains and macsec connectivity-association commands are used for implementing hitless rollover keychain with the addition of two new attributes:

  • key-name—Authentication key name, and this key-name is used as the CKN for MACsec.

  • pre-shared-key-chain—The preshared connectivity association keychain name.

To secure a router-to-router Ethernet link by using MACsec with PSK hitless rollover keychain configuration:

Note:

Ensure that you execute the following steps in both the participating nodes in the same order.

  1. Synchronize the time in the participating nodes to the same NTP server.

    For instance, to set the date and time as per the NTP server 192.168.40.1, enter:

  2. Configure a set of PSKs in a keychain. A keychain consists of a security key, key name, and start time.

    To configure a keychain:

    1. Create the secret password to use. It is a string of hexadecimal digits up to 64 characters long. The password can include spaces if the character string is enclosed in quotation marks. The keychain's secret-data is used as a CAK.

      For instance, to create the secret password 01112233445566778899aabbccddeeff for the keychain macsec_key_chain and key 1, enter:

    2. Configure the authentication key name. It is a string of hexadecimal digits up to 32 characters long.

      For instance, to create the key name 01112233445566778899aabbccddeefe, enter:

    3. Configure the time when the preshared rollover keychain starts.

      For instance, if you want the key name with 01112233445566778899aabbccddeefe to start rollover at 2017-12-18.20:55:00 +0000, enter:

  3. Associate the newly created keychain with a MACsec connectivity association.
    1. Configure the MACsec security mode for the connectivity association.

      For instance, to configure the connectivity association ca1 with security mode static-cak, enter:

    2. Associate the preshared keychain name with the connectivity association.

      For instance, if you want to associate the keychain name macsec_key_chain with the connectivity association ca1, enter:

  4. Assign the configured connectivity association with a specified MACsec interface.

    For instance, to assign the connectivity association ca1 to the interface ge-0/0/1:

Configuring MACsec Key Agreement Protocol in Fail Open Mode

You can configure fail open mode for MACsec to prevent traffic from being dropped when the MKA session is inactive. This is recommended for service providers that prioritize network availability over information security.

MACsec maintains data integrity by appending a MACsec header to Ethernet frames transmitted on a MACsec-secured link. When the MKA session is active, traffic is allowed on the link only for frames with a MACsec header. When the MKA session is inactive, frames do not receive a MACsec header. All traffic, both ingress and egress, is dropped. The only exception is EAPoL traffic.

You can configure fail open mode using the should-secure CLI statement. This allows traffic on the MACsec-secured link even when the MKA session is inactive. Traffic is transmitted as cleartext, without MACsec headers.

To configure the MKA Protocol in Fail Open Mode:

Configuring MACsec with Fallback PSK

When you enable MACsec using static CAK security mode, a preshared key (PSK) is exchanged between the devices on each end of the point-to-point Ethernet link. The PSK is includes a connectivity association name (CKN) and a connectivity association key (CAK). The PSK must match across devices for a MACsec session to be established. If there is a mismatch, the session will not be established and all packets will be dropped.

You can configure a fallback PSK to prevent traffic loss in case the primary PSK fails to establish a connection. The fallback PSK is used when primary keys do not match for the initial MACsec negotiation.

If a MACsec session has already been established, and the primary PSK is changed on one device but not the other, the resulting mismatch is resolved by using the older primary PSK. The older primary PSK is a temporary key known as the preceding PSK.

With fallback PSK configured, a MACsec session can be secured with one of the following keys:

  • Primary PSK (configurable)—The preferred key.

  • Fallback PSK (configurable)—Used when the primary PSK fails to establish a MACsec session.

  • Preceding PSK (non-configurable)—When a new primary PSK is configured, the old primary PSK becomes the preceding PSK.

The status of the CAK for each key can be either live, active or in-progress. See Table 1 for a description of each status.

Table 1: CAK status descriptions
CAK Status Description

Live

  • CAK has been validated by MKA.

  • MACsec session is live.

  • SAK is successfully generated using this key.

  • CAK is used for encryption and decryption of the MACsec session.

  • MKA hello packets are sent and received for this key at a configured interval.

Active

  • CAK has been validated by MKA.

  • MACsec session is live.

  • SAK is not generated using this key.

  • CAK is not used for encryption and decryption of the MACsec session.

  • MKA hello packets are sent and received for this key at a configured interval.

In-progress

  • No valid live or potential peer is found.

  • The MACsec session is in-progress to find a peer.

  • MKA hello packets are sent for this key at a configured interval.

A mismatch of keys occurs when a new PSK is configured on one side of the MACsec link and the other side is either misconfigured or not configured with the new key. The fallback behavior depends on which components of the PSK are changed (CAK, CKN, or both). Each mismatch scenario is described below:

  • If the CAK is changed, and the CKN remains the same, the existing MACsec session will be disconnected. A new session will be initiated with the old CKN and new CAK value.

  • If the CKN is changed, and the CAK remains the same, the old CKN paired with the existing CAK becomes the preceding PSK, and the session will be live with preceding PSK. A new session is initiated with the newly-created CKN and the CAK, which will be in-progress until the peer node is also configured with the same CKN.

  • If both the CAK and the CKN are changed, the old CAK+CKN pair becomes the preceding PSK, and the session will be live with the preceding PSK. A new session is initiated with the new CAK+CKN pair, which will be in-progress until the peer node is also configured with the same CAK+CKN.

Note:

The preceding PSK takes priority over the fallback PSK, so if the session is live with the preceding PSK, the fallback PSK will not take effect. If you want the session to be live with the fallback PSK, you must configure the disable-preceding-key statement.

Fallback PSK is supported for preshared keychains. You can configure a fallback PSK along with a preshared key, or with a preshared keychain. The preshared key and preshared keychain are mutually exclusive.

If only a fallback PSK is configured, and there is no primary PSK, both devices attempt to establish a session with the fallback PSK. If the session comes up, the SAK derived from the fallback PSK is used for data traffic encryption. If the established session is broken, the devices continue attempting to reestablish the session and traffic will be dropped until the session is reestablished.

The fallback PSK is configured as part of the connectivity association (CA). The CA can be configured globally for all interfaces or on a per-interface basis, allowing different fallback keys for different interfaces.

To configure the fallback PSK, configure the CAK and the CKN as part of the CA:

The following restrictions apply to fallback PSK configuration:

  • Fallback CAK and CKN should not match the preshared key CKN and CAK or any key configured in the keychain under the same CA.

  • Security mode configuration must be present to configure the fallback key.

  • Key length restrictions for the configured cipher suite apply to the fallback CAK and CKN.

Release History Table
Release
Description
16.1R2
Starting in Junos OS Release 16.1R2, when Media Access Control Security (MACsec) is enabled on an interface, the interface flow control capability is enabled by default, regardless of the configuration that you set using the (flow-control | no-flow-control) statement at the [edit interfaces interface- name gigether-options] hierarchy level.
15.1
Starting with Junos OS Release 15.1, you can configure MACsec to secure point-to-point Ethernet links connecting MX Series routers with MACsec-capable MICs, or on Ethernet links connecting a switch to a host device such as a PC, phone, or server.