System Security Configuration Guide for Cisco 8000 Series Routers, IOS XR Releases

PDF

System Security Configuration Guide for Cisco 8000 Series Routers, IOS XR Releases

Type 6 password encryption

Want to summarize with AI?

Log in

Introduces Type 6 password encryption, covering prerequisites such as enabling the primary key after iPXE boot and detailing encryption operation, configuration tasks, and key management principles for secure network authentication.


A Type 6 password encryption mechanism is a security feature that

  • uses a reversible 128-bit Advanced Encryption Standard (AES) algorithm to securely store plain-text key strings

  • allows devices to decrypt the encrypted strings to their original plain-text form, and

  • supports secure storage and authentication for network session protocols.

Additional reference information

Type 6 password encryption supports secure storage of plain-text key strings used to authenticate BGP, IP SLA, IS-IS, MACsec, OSPF, and RSVP sessions.


Requirement: Enable the Type 6 primary key after an iPXE boot

After an iPXE boot, enable the Type 6 primary key using the key config-key password-encryption command.


How Type 6 password encryption works

Type 6 password encryption is commonly used to secure routing protocol sessions, such as BGP, by ensuring that authentication keys remain confidential. While this example focuses on BGP between routers R1 and R2, the process also applies to OSPF, IS-IS, and other protocols.

Summary

The key components involved in the process are:

  • Type 6 server: Creates and manages the primary key used for encrypting client key strings.

  • Type 6 client: Utilizes the primary key to protect authentication key strings in key chains.

  • Routing protocol: Uses the configured key chain to authenticate sessions between routers.

Type 6 password encryption provides enhanced session security by encrypting authentication keys used in routing protocol sessions.

For MACsec authentication, refer to the Secure MACsec encryption chapter in the MACsec Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Releases.

Workflow

The process describes how Type 6 password encryption works.

  1. Create the primary key and enable Type 6 password encryption on both routers. The primary key is stored internally and is not displayed in the running configuration.

  2. Configure a key chain as a Type 6 client and assign the encrypted key string, cryptographic algorithm, and key lifetimes.

  3. Create the BGP session on both routers with the same key-chain name, then verify that the BGP neighbor state is Established.

Result

The process protects protocol-session key strings with Type 6 encryption and enables routers to authenticate the BGP session securely. This improves session confidentiality and applies to other protocol types as well.


Enable Type 6 password encryption

Set up and manage Type 6 password encryption on Cisco IOS XR routers, ensuring secure storage and operation of encrypted keys.

Perform this task to enable Type 6 password encryption server functions before configuring Type 6 clients (such as key chains). Type 6 encryption improves security by storing the primary encryption key internally and encrypting all plain-text key strings.

Before you begin

  • Ensure that you can access XR EXEC and configuration modes on the routers.

  • Schedule a primary-key update during a maintenance window.

Procedure

  1. Create the Type 6 primary key.

    Example:

    Router# key config-key password-encryption
    Fri Jul 19 12:22:45.519 UTC
    New password Requirements: Min-length 6, Max-length 64
    Characters restricted to [A-Z][a-z][0-9]
    Enter new key :
    Enter confirm key :
    Master key operation is started in background

    The primary key is the password or key that encrypts all plain-text key strings in the router configuration. An AES symmetric cipher performs the encryption.

    The primary-key operation runs in the background. Use show type6 server to view the operation status.

    The router stores the primary key internally rather than in the router configuration. The running configuration does not display or provide access to the primary key.

  2. Enable Type 6 password encryption.

    Example:

    Router(config)# password6 encryption aes
    Routerconfig)# commit
    Fri Jul 19 12:22:45.519 UTC
  3. Modify the Type 6 primary key.

    Example:

    Router# key config-key password-encryption
    New password Requirements: Min-length 6, Max-length 64
    Characters restricted to [A-Z][a-z][0-9]
    Enter old key :
    Enter new key :
    Enter confirm key :
    Master key operation is started in background

    Enter the old key, new key, and confirmation key when prompted. The operation updates the key chain and other Type 6 clients.

  4. Delete the Type 6 primary key.

    Example:

    Router# configure
    Router(config)# no password6 encryption aes
    Router(config)# commit
    Router(config)# exit
    Router# key config-key password-encryption delete
    WARNING: All type 6 encrypted keys will become unusable
    Continue with master key deletion ? [yes/no]:yes
    Master key operation is started in background
    Note

    Deleting the primary key makes all Type 6 encrypted keys unusable.

  5. Use the show type6 server command to verify the primary-key and Type 6 feature state.

    Example:

    Router# show type6 server
    Fri Jul 19 12:23:49.154 UTC
    Server detail information:
    =============================================
    AES config State       :       Enabled
    Masterkey config State :       Enabled
    Type6 feature State    :       Enabled
    Master key Inprogress  :       No
    Masterkey Last updated/deleted : Mon Nov 4 15:55:11 2024
    Masterkey Size (bits) : 48
    Masterkey Hash (Algo:sha512,Format:base64) : ujJTh2rta8ItSm/1PYQGxq2GQZXtFEq1yHYhtsIztUi66uaVbfNG7IwX9eoQ817jy8UUeX7X3dMUVGTioLq0Ew

    The primary-key configuration and Type 6 feature state display as Enabled.

    The operation-status field displays No when the primary-key activity is complete.

    The three states display Disabled when you disable the primary key.

  6. Use the show type6 trace server all command to verify Type 6 server trace details.

    Example:

    Router# show type6 trace server all
    Fri Jul 19 12:26:05.111 UTC
    Client file lib/type6/type6_server_wr
    25 wrapping entries (18496 possible, 64 allocated, 0 filtered, 25 total)
    Jul 19 09:59:27.168 lib/type6/type6_server_wr 0/RP0/CPU0 t7145 ***** Type6 server process started Respawn count (1) ****
    ...
    ...
    Jul 19 12:22:59.908 lib/type6/type6_server_wr 0/RP0/CPU0 t7145 User has started Master key operation (CREATE)
    Jul 19 12:22:59.908 lib/type6/type6_server_wr 0/RP0/CPU0 t7145 Created Master key in TAM successfully
    Jul 19 12:23:00.265 lib/type6/type6_server_wr 0/RP0/CPU0 t7145 Master key Available set to (AVAILABLE)
    Jul 19 12:23:00.272 lib/type6/type6_server_wr 0/RP0/CPU0 t7145 Master key inprogress set to (NOT INPROGRESS)
  7. Check the primary-key update status.

    Example:

    Router# show type6 masterkey update status
    Thu Sep 17 06:48:56.595 UTC
    Type6 masterkey operation is NOT inprogress

    Example:

    Router# show type6 masterkey update status
    Thu Sep 17 06:50:07.980 UTC
    Type6 masterkey operation is inprogress
    
    Masterkey upate status information:
    Client Name                Status
    =====================================
    keychain                   INPROGRESS

    Starting with Cisco IOS XR Software Release 7.0.14, use the primary-key update-status command to display the update status.

    Before that release, use show type6 clients for the same purpose.

  8. Clear a Type 6 client state if a primary-key update is stuck.

    If the operation-status field displays YES, use the primary-key update-status command to identify the incomplete client.

    Before Release 7.0.14, use show type6 clients for the same purpose. Clear that client with clear type6 client in XR EXEC mode.

The Type 6 primary key and encryption feature are configured, and you can verify server and client status to ensure secure operation.


Caution: Schedule primary-key updates during a maintenance window

Schedule a Type 6 primary-key update during a maintenance window.

Updating the Type 6 primary key changes the key chain and affects other clients using Type 6. If the router fails during the operation, it can disrupt the product network and routing protocol sessions. The primary key is not saved in the running configuration, but changes persist across reloads. You cannot use the rollback configuration command to restore the previous key.


Configure a Type 6 key chain for BGP sessions

Set up a Type 6 client key chain to authenticate BGP sessions using encrypted keys.

Use this procedure after enabling Type 6 password encryption. To ensure consistent authentication, configure the same key string on all routers participating in the BGP session.

Before you begin

  • Enable the Type 6 primary key and encryption feature.

  • Choose the same key-chain name and key string for all routers in the session.

Procedure

  1. Enter the key-chain configuration mode.

    Example:

    Router# configure
    Router(config)# key chain my-test-keychain
    Router(config-type6_password)# key 1

    The key chain in this example is named my-test-keychain , and the key identifier is 1.

  2. Configure the encrypted key string, cryptographic algorithm, key lifetimes, and commit the configuration.

    Example:

    Router(config-type6_password-1)# key-string password6 6664496443695544484a4448674b695e685d56565d676364554b64555f4c5c645b
    Router(config-type6_password-1)# cryptographic-algorithm HMAC-MD5
    Router(config-type6_password-1)# accept-lifetime 1:00:00 october 24 2005 infinite
    Router(config-type6_password-1)# send-lifetime 1:00:00 october 24 2005 infinite
    Router(config-type6_password-1)# commit

    Type 6 password encryption encrypts plain-text keys.

    Enter a plain-text key string in alphanumeric form.

    When you enable Type 6 password encryption for MACsec, enter the key string in hexadecimal format.

    Using the key-string command, you can enter the password in cleartext format or Type 6 encrypted format, as in this example.

    BGP supports only HMAC-MD5 and HMAC-SHA1-12.

  3. Use the show key chain trace server both command to verify the key-chain trace information.

    Example:

    Router# show key chain trace server both
    Sat Jul 20 16:44:08.768 UTC
    Client file lib/kc/kc_srvr_wr
    4 wrapping entries (18496 possible, 64 allocated, 0 filtered, 4 total)
    Jul 20 16:43:26.342 lib/kc/kc_srvr_wr 0/RP0/CPU0 t312 *********kc_srvr process started*********
    Jul 20 16:43:26.342 lib/kc/kc_srvr_wr 0/RP0/CPU0 t312 (kc_srvr) Cerrno DLL registration successfull
    Jul 20 16:43:26.349 lib/kc/kc_srvr_wr 0/RP0/CPU0 t312 (kc_srvr) Initialised sysdb connection
    Jul 20 16:43:26.612 lib/kc/kc_srvr_wr 0/RP0/CPU0 t317 (kc_srvr_type6_thread) Succesfully registered as a type6 client
  4. Use the show key chain type6_password command to verify the Type 6 key-chain configuration.

    Example:

    Router# show key chain type6_password
    Sat Jul 20 17:05:12.803 UTC
    Key-chain: my-test-keychain -
      Key 1 -- text "6664496443695544484a4448674b695e685d56565d676364554b64555f4c5c645b"
        Cryptographic-Algorithm -- HMAC_MD5
        Send lifetime --  01:00:00, 24 Oct 2005 - Always valid  [Valid now]
        Accept lifetime --  01:00:00, 24 Oct 2005 - Always valid [Valid now]

    Verify Type 6 client information.

    Use these associated commands:

    {ul([syn("key chain"), syn("key-string password6"), syn("show key chain trace server both")])}

The Type 6 client key chain contains the encrypted key string and valid send and accept lifetimes for BGP authentication.


Requirement: You must use the same Type 6 key string on all BGP routers

To comply with BGP security requirements, ensure that you configure the same Type 6 key string on every router that participates in the BGP session. Using a matching key string across all routers guarantees secure and consistent authentication throughout the BGP network.


Create a BGP session with Type 6 password encryption

Set up and secure an iBGP session that uses a Type 6 key chain for password encryption between routers.

This example demonstrates configuring an iBGP session between two routers (Router and Router) with Type 6 password encryption. For details on complete iBGP topologies, refer to Cisco 8000 Series Routers documentation.

Before you begin

  • Configure the Type 6 primary key and client key chain on both routers.

  • Use the same session parameters and key-chain name on both routers.

Procedure

  1. Configure the BGP session on Router.

    Example:

    Router# configure
    Router(config)# router bgp 65537

    Example:

    Router (config-bgp)# neighbor 10.1.1.11 remote-as 65537
    Router(config-bgp)# keychain my-test-keychain
    Router(config-bgp)# address-family ipv4 unicast
    Router(config-bgp)# commit

    Use the same key-chain name for the BGP session and Type 6 encryption. This example uses my-test-keychain .

  2. Configure the BGP session on Router.

    Example:

    Router(config)# router bgp 65537
    Router(config-bgp)# neighbor 10.1.1.1 remote-as 65537
    Router(config-bgp)# keychain my-test-keychain
    Router(config-bgp)# address-family ipv4 unicast
    Router(config-bgp)# commit

    Repeat the session configuration on Router and use the same session and key chain as Router.

  3. Use the show bgp sessions to verify that the BGP neighbor state is Established.

    Example:

    Router# show bgp sessions
    Neighbor      VRF      Spk    AS      InQ  OutQ  NBRState     NSRState
    10.1.1.11     default  0      65537   0    0     Established  None

    Example:

    Router# show bgp sessions
    Neighbor      VRF      Spk    AS      InQ  OutQ  NBRState     NSRState
    10.1.1.1      default  0      65537   0    0     Established  None

    Use these associated commands:

    {ul([syn("session-group"), syn("show bgp sessions")])}

The iBGP session between R1 and R2 successfully establishes using the Type 6 key chain. Both routers display their neighbor state as "Established."