MACsec (802.1AE): encrypting Ethernet links between switches, routers and hosts
In short: MACsec encrypts and authenticates Ethernet frames on a single link, in hardware, at full line rate. Each link's keys are negotiated with MACsec Key Agreement using a pre-shared key or 802.1X. It is used to protect links between buildings and data centres, carrier Ethernet services and, with 802.1X, links from user devices to access switches.
Why encrypt a single link?
Inside your own buildings, you might trust the cables. But fibre between buildings may run through ducts shared with others, a "dark fibre" or carrier Ethernet service between data centres crosses someone else's equipment, and a tap on a link can copy every frame silently. MACsec (IEEE 802.1AE) encrypts every frame on a link, so a tap sees nothing useful and tampered frames are rejected.
How it works
- Each frame's payload is encrypted with AES-GCM (128 or 256-bit), and a security tag and integrity check are added. The MAC addresses stay visible so the link still works.
- It is hop by hop: the frame is decrypted at the next switch, processed normally, and re-encrypted on the next MACsec link.
- Encryption happens in the port hardware (PHY or ASIC), so there is no throughput penalty on ports that support it. Check the datasheet: MACsec support is often limited to specific ports or models and may need a licence.
- The added overhead (up to 32 bytes per frame) means you may need a larger MTU on the link.
Keys: MKA
MACsec Key Agreement (MKA), defined in 802.1X-2010, lets both ends prove they share a secret and then derive and rotate the encryption keys automatically. The shared secret, the CAK (connectivity association key), identified by a CKN, comes from either:
- a pre-shared key configured on both ends, usual for switch-to-switch links; or
- 802.1X authentication with a RADIUS server, usual for host-to-switch links.
Switch-to-switch example (IOS XE)
key chain KC-MACSEC macsec
key 01
cryptographic-algorithm aes-256-cmac
key-string 0 64-hex-character-example-key
lifetime local 00:00:00 Jan 1 2026 infinite
mka policy MKA-256
macsec-cipher-suite gcm-aes-256
!
interface TenGigabitEthernet1/1/1
description Link to building B
macsec network-link
mka policy MKA-256
mka pre-shared-key key-chain KC-MACSEC
Both ends need the same key and compatible policy. Check with show macsec summary and show mka sessions; a "Secured" session means traffic is encrypted.
WAN MACsec
Many providers' Ethernet services (E-Line, E-LAN) can carry MACsec end to end between your two routers, if the service passes the MACsec frames transparently. Routers such as Catalyst 8000 support WAN MACsec with options to work over 802.1Q-tagged services. This can replace IPsec on high-speed links where IPsec would need expensive crypto hardware.
Things to plan for
- Key management and rotation (key chains with lifetimes).
- What happens if keys mismatch:
should-securemode allows unencrypted traffic if MACsec fails;must-secureblocks it. Choose consciously. - Monitoring tools on the link (SPAN of the encrypted link shows only encrypted frames).
Real-world example: the shared duct
A hospital's fibre between two buildings ran through a duct shared with a telecoms company. An audit flagged that anyone with access to the duct could tap the link carrying patient records. Enabling MACsec with pre-shared keys on the 10 Gbps links between the two core switches encrypted all traffic with no change in performance and closed the finding.
Practice
Is MACsec end-to-end or hop-by-hop encryption?
Which protocol negotiates and rotates MACsec keys?
Name a common use case for MACsec.
Key takeaways
- MACsec encrypts and authenticates frames on each Ethernet link.
- It runs in hardware at line rate, decrypting and re-encrypting at each hop.
- MKA manages keys from a pre-shared key or 802.1X.
- Use it for inter-building, data centre and WAN Ethernet links.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.