ON THIS PAGE
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 Static Connectivity Association Key (CAK) Mode
You can enable MACsec using static CAK security mode on a point-to-point Ethernet link connecting routers.
When you enable MACsec using static CAK security mode, a preshared key is exchanged between the routers on each end of the point-to-point Ethernet link. The preshared key includes a connectivity association name (CKN) and a connectivity association key (CAK). The CKN and CAK are configured by the user in the connectivity association and must match on both ends of the link to initially enable MACsec.
After the preshared keys are exchanged and verified, the MACsec Key Agreement (MKA) protocol is enabled. The MKA enables and maintains MACsec on the link, and is responsible for selecting one of the two routers on the point-to-point link as the key server. The key server then creates a randomized security key that is shared only with the other device over the MACsec-secured link. The randomized security key enables and maintains MACsec on the point-to-point link. The key server will continue to periodically create and share a randomly-created security key over the point-to-point link for as long as MACsec is enabled.
You enable MACsec using static CAK security mode by configuring a connectivity association on both ends of the link. All configuration is done within the connectivity association but outside of the secure channel. Two secure channels—one for inbound traffic and one for outbound traffic—are automatically created when using static CAK security mode. The automatically-created secure channels do not have any user-configurable parameters that cannot already be configured in the connectivity association.
To configure MACsec using static CAK security mode to secure a router-to-router Ethernet link:
When assigning a CA to a logical interface, the following limitations apply:
Configuring a CA on a physical interface and a logical interface is mutually exclusive.
MACsec is not supported on logical interfaces with a native VLAN configuration.
MACsec is not supported for logical aggregated interfaces.
Assigning the connectivity association to an interface is the final configuration step to enabling MACsec on an interface.
MACsec using static CAK security mode is not enabled until a connectivity association on the opposite end of the link is also configured, and contains preshared keys that match on both ends of the link.
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. When MACsec is disabled,
interface flow control is restored to the configuration that you set
using the flow-control
statement at the [edit interfaces]
hierarchy level. When MACsec is enabled, additional header bytes
are added to the packet by the MACsec PHY. With line rate traffic,
when MACsec is enabled and flow control is disabled, the pause frames
sent by the MACsec PHY are terminated by the MIC’s MAC (enhanced
20-port Gigabit Ethernet MICs on MX Series routers) and not transferred
to the Packet Forwarding Engine, causing framing errors. Therefore,
when MACsec is enabled on an interface, flow control is also automatically
enabled on such an interface.
See Also
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:
[edit security macsec connectivity-association connectivity-association-name] user@host# set mka should-secure;
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.
CAK Status | Description |
---|---|
Live |
|
Active |
|
In-progress |
|
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.
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:
[edit security macsec connectivity-association ca-name] user@switch# set fallback-key cak key user@switch# set fallback-key ckn key-name
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.