cisco Catalyst 9300 Series Switches — Example: Configuring MACsec MKA Using PSK

Device(config-if)# switchport mode access Device(config-if)# macsec Device(config-if)# authentication event linksec fail action authorize vlan 1 Device(config-if)# authentication host-mode multi-domain Device(config-if)# authentication linksec policy must-secure Device(config-if)# authentication port-control auto Device(config-if)# authentication periodic Device(config-if)# authentication timer reauthenticate Device(config-if)# authentication violation protect Device(config-if)# mka policy mka_policy Device(config-if)# dot1x pae authenticator Device(config-if)# spanning-tree portfast Device(config-if)# end Example:

Configuring MACsec MKA Using PSK This example shows how to configure MACsec MKA using PSK: Device> enable Device# configure terminal Device(config)# key chain keychain1 macsec Device(config-keychain)# key 1000 Device(config-keychain-key)# cryptographic-algorithm aes-128-cmac Device(config-keychain-key)# key-string 12345678901234567890123456789012 Device(config-keychain-key)# lifetime local 12:12:00 July 28 2016 12:19:00 July 28 2016 Device(config-keychain-key)# end This example shows how to configure MACsec MKA on an interface using PSK:

Device> enable Device# configure terminal Device(config)# interface GigabitEthernet 0/0/0 Device(config-if)# mka policy mka_policy Device(config-if)# mka pre-shared-key key-chain key-chain-name Device(config-if)# macsec replay-protection window-size 10 Device(config-if)# end MKA-PSK: CKN Behavior Change Starting Cisco IOS XE Fuji 16.8.1 release, for MKA PSK sessions, the CKN uses exactly the same string as the CKN which is configured as the hex-string for the key, instead of the fixed 32 bytes.

Device> enable Device# configure terminal Device(config)# key chain abc macsec Device(config-keychain)# key 11 Device(config-keychain-key)# cryptographic-algorithm aes-128-cmac Device(config-keychain-key)# key-string 12345678901234567890123456789013 Device(config-keychain-key)# lifetime local 12:21:00 Sep 9 2015 infinite Device(config-keychain-key)# end The following is sample output of the show mka session command for the above configuration: Device# show mka session Total MKA Sessions....... 1 Secured Sessions... 1 Pending Sessions...

0 ==================================================================================================== Interface Local-TxSCI Policy-Name Inherited Key-Server Port-ID Peer-RxSCI MACsec-Peers Status CKN Configuring MACsec Encryption Example: Configuring MACsec MKA Using PSK Configuring MACsec Encryption 37