- Cisco Nexus Data Broker Overview
- Deploying Cisco Nexus Data Broker
- Managing TLS Certificate, KeyStore, and TrustStore Files
- Logging in and Managing Cisco Nexus Data Broker
- Configuring Cisco Nexus 9000 Series Switches
- Managing Devices
- Configuring Ports and Devices
- Filtering Flows
- Managing Roles and Resources
- Managing Flows
- Troubleshooting
- Managing Slices
- Administrative Tasks
- About the TLS Certificate, KeyStore, and TrustStore Files
- Preparing to Generate the TLS Credentials
- Creating the TLS Private Key, Certificate, and Certification Authority
- Configuring the Cryptographic Keys on the Switch
- Enabling TLS for onePK and OpenFlow Switches
- Configuring the NX-API Certificate
- Creating the TLS KeyStore File
- Creating the TLS TrustStore File
- Starting the Application with TLS Enabled
- Providing the TLS KeyStore and TrustStore Passwords
Managing TLS Certificate, KeyStore, and TrustStore Files
This chapter contains the following sections:
- About the TLS Certificate, KeyStore, and TrustStore Files
- Preparing to Generate the TLS Credentials
- Creating the TLS Private Key, Certificate, and Certification Authority
- Configuring the Cryptographic Keys on the Switch
- Enabling TLS for onePK and OpenFlow Switches
- Configuring the NX-API Certificate
- Creating the TLS KeyStore File
- Creating the TLS TrustStore File
- Starting the Application with TLS Enabled
- Providing the TLS KeyStore and TrustStore Passwords
About the TLS Certificate, KeyStore, and TrustStore Files
![]() Note | To support onePK devices, all connections to Cisco Nexus Data Broker that use onePK or OpenFlow agents require Transport Layer Security (TLS). For NX-API devices, TLS is optional. |
Enabling the TLS connections between Cisco Nexus Data Broker and the OpenFlow or onePK switches requires TLS KeyStore and TrustStore files. The TLS KeyStore and TLS TrustStore files are password protected.
Cisco Nexus 3000, 3100, and 3500 Series switches require additional credentials, including Private Key, Certificate, and Certificate Authority (CA).
-
The TLS KeyStore file contains the private key and certificate information used by Cisco Nexus Data Broker.
-
The TLS TrustStore file contains the Certification Authority (CA) certificates used to sign the certificates on the connecting switches.
If TLS connections are required in your Cisco Nexus Data Broker implementation, all of the connections in the network must be TLS encrypted, and you must run Cisco Nexus Data Broker with TLS enabled (see Starting the Application with TLS Enabled). After Cisco Nexus Data Broker is started with TLS, you must run the TLS KeyStore password configuration command (see Providing the TLS KeyStore and TrustStore Passwords) to provide the passwords for Cisco Nexus Data Broker to unlock the KeyStore files.
Preparing to Generate the TLS Credentials
OpenFlow and Cisco onePK switches require cryptographic configuration to enable TLS.
The NX-API protocol plugin now supports TLS for secure communication to the devices. You can connect to the NX-API protocol plugin on the secure port 443. All configuration, discovery, and statisitcs collection is done using secure communication. Cisco Nexus Data Broker should be configured with the required certificates and it should be started in the secure mode. When Cisco Nexus Data Broker is started in TLS mode, all devices support the TLS connection. The normal unencrypted connection to the switches is not accepted.
![]() Caution | Self-signed certificates are appropriate only for testing in small deployments. For additional security and more granular controls over individual certificate use and revocation, you should use certificates generated by your organization's Certificate Authority. In addition, you should never use the keys and certificates generated by this procedure in a production environment. |
Ensure that OpenSSL is installed on the Linux host where these steps will be performed.
What to Do Next
Create the TLS certificate file.
Creating the TLS Private Key, Certificate, and Certification Authority
Complete the steps in Preparing to Generate the TLS Credentials.
| Step 1 | Generate the
TLS private key and Certification Authority (CA) files by entering the
openssl req -x509 -nodes
-days 3650 -newkey rsa:2048 -out mypersonalca/certs/ca.pem -outform PEM -keyout
mypersonalca/private/ca.key
command.
This step generates the TLS private key in PEM format with a key length of 2048 bits, and the CA file. |
| Step 2 | Generate the
certificate key and certificate request files by entering the
openssl req -newkey rsa:2048
-keyout cert.key -keyform PEM -out cert.req -outform PEM
command.
This step
generates the controller key (cert.key) and certificate request (cert.req)
files in PEM format.
You must specify a PEM pass phrase that is 4 to 1024 alphanumeric characters in length, for example, cisco123. You must also specify a common name in this step to complete Step 3. An example of a common name is the hostname of the server where Cisco Nexus Data Broker is running. |
| Step 3 | Generate the
certificate file by entering the
openssl ca -batch -notext -in
cert.req -out cert.pem -config ca.cnf
command.
This step
generates the certificate (cert.pem) file in PEM format using the certificate
request (cert.req) and the certificate configuration (ca.cnf) files as inputs,
and creates the certificates file (cert.pem) as output.
The following is an example of the console response: Using configuration from ca.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows countryName :PRINTABLE:'AU' stateOrProvinceName :ASN.1 12:'Some-State' organizationName :ASN.1 12:'Internet Widgits Pty Ltd' commonName :ASN.1 12:'localhost' |
What to Do Next
Generate and import the certificate files on your Cisco Nexus 3000, 3100, or 3500 Series switches.
Configuring the Cryptographic Keys on the Switch
Create the TLS certificate.
| Command or Action | Purpose | |||
|---|---|---|---|---|
| Step 1 | switch(config)# ip domain-name domain-name |
Configures the domain name for the switch. | ||
| Step 2 | switch(config)# crypto key generate rsa label myKey2 exportable modulus 2048 |
Generates the cryptographic key. | ||
| Step 3 | switch(config)# crypto ca trustpoint myCA |
Enters the trustpoint configuration mode and installs the trustpoint file on the switch. | ||
| Step 4 | switch(config-trustpoint)# rsakeypair myKey2 |
Installs the key files on the switch. | ||
| Step 5 | switch(config-trustpoint)# exit |
Exits trustpoint configuration mode. | ||
| Step 6 | switch# show crypto ca trustpoints | (Optional)
Verifies creation of the trustpoint files. | ||
| Step 7 | switch# show crypto key mypubkey rsa | (Optional)
Verifies creation of the key files. | ||
| Step 8 | From the console, enter the cat mypersonalca/certs/ca.pem command. |
Displays the certificate file on the machine hosting the generated TLS certificates. | ||
| Step 9 | switch(config)# crypto ca authenticate myCA |
Copies the CA certificate (ca.pem) to the switch to use as input.
| ||
| Step 10 | switch(config)# crypto ca enroll myCA |
Generates the certificate request on the switch. | ||
| Step 11 | From the console, enter the openssl ca -in n3k-cert.req -out newcert.pem -config ./ca.cnf command. |
Copies the certificate request from the switch to the file n3k-cert.req on your Linux machine, and then uses it to generate the switch certificate. | ||
| Step 12 | switch(config)# crypto ca import myCA certificate |
Copies the certificate (newcert.pem) to the switch. | ||
| Step 13 | From the console, enter the cat newcert.pem command. |
Displays the certificate on the Linux console. | ||
| Step 14 | switch# show crypto ca certificates |
Displays the certificates on the switch. |
Enable TLS for Cisco onePK and OpenFlow switches.
Enabling TLS for onePK and OpenFlow Switches
![]() Note | This step is not applicable for NX-API. |
| Command or Action | Purpose | |||
|---|---|---|---|---|
| Step 1 | switch(config)# onep |
Enters onePK configuration mode on the switch. | ||
| Step 2 | switch(config-onep)# transport type tls |
Enables TLS for onePK switches. | ||
| Step 3 | switch# exit |
Exits onePK configuration mode. | ||
| Step 4 | switch# show onep status | (Optional)
Displays the onePK configuration. | ||
| Step 5 | switch(config)# openflow |
Enters OpenFlow agent configuration mode on the switch. | ||
| Step 6 | switch(config-ofa)# switch 1 |
Enters OpenFlow agent configuration mode for switch 1. | ||
| Step 7 | switch(config-ofa)# tls trust-point local myCA remote myCA |
Enables TLS certificate authority on the switch. | ||
| Step 8 | switch(config-ofa-switch)# pipeline {201/203} |
Configures the pipeline.
| ||
| Step 9 | switch(config-ofa-switch)# controller ipv4 {A.B.C.D} port 6653 vrf management security tls |
Enables TLS for OpenFlow switches. A.B.C.D is the IP address of the controller.
|
Create the TLS KeyStore file.
Configuring the NX-API Certificate
Generate the certificate key and the certificate request files.
![]() Note | This step is applicable for NX-API only. |
| Command or Action | Purpose |
|---|
Create the TLS KeyStore File.
Creating the TLS KeyStore File
![]() Note | The TLS KeyStore file should be placed in the configuration directory of Cisco Nexus Data Broker. |
Complete the steps in Configuring the Cryptographic Keys on the Switch.
| Step 1 | Copy cert.key to
xnc-privatekey.pem.
This command copies the cert.key file that was generated in the "Creating the TLS Private Key, Certificate, and Certificate Authority" section. This file contains the Cisco Nexus Data Broker private key. | ||
| Step 2 | Copy
cert.pem to xnc-cert.pem.
This command makes a copy of the cert.pem file that was generated in the "Creating the TLS Private Key, Certificate, and Certificate Authority" section. This file contains the Cisco Nexus Data Broker certificate. | ||
| Step 3 | Create the xnc.pem file, which contains the private key and certificate, by entering the cat xnc-privatekey.pem xnc-cert.pem > xnc.pem command. | ||
| Step 4 | Convert the PEM file xnc.pem file to the file xnc.p12 file by entering the openssl pkcs12 -export -out xnc.p12 -in xnc.pem command. | ||
| Step 5 | Enter a password
at the prompt.
The xnc.pem file is converted to a password-protected .p12 file. | ||
| Step 6 | Convert the
xnc.p12 to a Java KeyStore (tlsKeyStore) file by entering the
keytool -importkeystore
-srckeystore xnc.p12 -srcstoretype pkcs12 -destkeystore tlsKeyStore
-deststoretype jks command.
This command converts the xnc.p12 file to a password-protected tlsKeyStore file | ||
| Step 7 | Enter a password
at the prompt.
|
Creating the TLS TrustStore File
![]() Note | The TLS TrustStore file should be placed in the application configuration directory. |
| Step 1 | Copy the mypersonalca/certs/ca.pem file to sw-cacert.pem. | ||
| Step 2 | Convert the sw-cacert.pem file to a Java TrustStore (tlsTrustStore) file by entering the keytool -import -alias swca1 -file sw-cacert.pem -keystore tlsTrustStore command. | ||
| Step 3 | Enter a password
at the prompt.
The sw-cacert.pem file is converted into a password-protected Java TrustStore (tlsTrustStore) file.
| ||
| Step 4 | If the switches in your network use more than one CA certificate, repeat Step 1 through Step 3 for each CA certificate required. |
Starting the Application with TLS Enabled
-
Generate and import certificate files on the switches.
-
Enable TLS on the OpenFlow or onePK switches.
-
Create and deploy TLS KeyStore and TLS TrustStore files for the Cisco Nexus Data Broker application.
-
Make sure that the TLS KeyStore (tlsKeyStore) and TLS TrustStore (tlsTrustStore) files are located in the ./configuration directory.
| Step 1 | From the
console, start
Cisco Nexus Data Broker by entering the
./runxnc.sh -tls -tlskeystore
./configuration/tlsKeyStore -tlstruststore
./configuration/tlsTrustStore command.
| ||
| Step 2 | Cisco Nexus Data Broker is started with TLS enabled. |
Providing the TLS KeyStore and TrustStore Passwords
The TLS KeyStore and TrustStore passwords are sent to the Cisco Nexus Data Broker so that it can read the password-protected TLS KeyStore and TrustStore files.
| Step 1 | Open a command window where you installed Cisco Nexus Data Broker. | ||
| Step 2 | Navigate to the xnc/bin directory. | ||
| Step 3 | Provide the TLS
KeyStore and TLS TrustStore passwords by entering the
./xnc
config-keystore-passwords [--user {user}
--password {password} --url
{url} --verbose --prompt --keystore-password
{keystore_password}
--truststore-password {truststore_password}]
command.
Enter the following information:
|


Feedback