Nexus 9000

Tasks

Save current config

switch# copy running-config startup-config

Reboot

switch# reload
This command will reboot the system. (y/n)?  [n]

Get information/Show

switch# show ip interface mgmt 0
switch# show ip interface loopback 0
switch# show interface ethernet 1/14 switchport
switch# show mac address-table address 00:1b:e0:13:72:fa
Legend: 
        * - primary entry, G - Gateway MAC, (R) - Routed MAC, O - Overlay MAC
        age - seconds since last seen,+ - primary entry using vPC Peer-Link,
        (T) - True, (F) - False, C - ControlPlane MAC, ~ - vsan
   VLAN     MAC Address      Type      age     Secure NTFY Ports
---------+-----------------+--------+---------+------+----+------------------
*    1     001b.e013.72fa   dynamic  0         F      F    Eth1/2

Interface

switch# show interface ethernet 1/13 switchport

Access port (only vlan tagged packets,untagged):

switch# configure 
switch(config)# interface ethernet 1/13                  
switch(config-if)# switchport mode access               
switch(config-if)# switchport access vlan 16

Trunk port (accepts all packets, native vlan is untagged):

switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk allowed vlan all
switch(config-if)# switchport trunk native vlan 1
no switchport trunk native vlan
switchport trunk allowed vlan [all | none | add vlan-list | remove vlan-list | except vlan-list]

VLANs

switch# configure 
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# vlan 16
switch(config-vlan)# name LAN
switch(config-vlan)# exit
switch(config)# exit
switch#

https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/7-x/layer2/configuration/guide/b_Cisco_Nexus_9000_Series_NX-OS_Layer_2_Switching_Configuration_Guide_7x/b_Cisco_Nexus_9000_Series_NX-OS_Layer_2_Switching_Configuration_Guide_7x_chapter_0100.html

LACP

A “port channel” is a group port.

The port channel members must be part of the port channel VLAN. When not specified, the port channel is created in default VLAN 0001.

switch# show port-channel summary
switch# configure terminal
switch(config)# feature lacp
switch(config)# interface port-channel 1
switch(config-if)# exit
switch(config)# interface ethernet 1/4
switch(config-if)# channel-group 1 mode active
switch(config-if)# exit
switch(config)# interface ethernet 1/5
switch(config-if)# channel-group 1 mode active
switch(config-if)# exit
switch(config)#

https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/6-x/interfaces/configuration/guide/b_Cisco_Nexus_9000_Series_NX-OS_Interfaces_Configuration_Guide/b_Cisco_Nexus_9000_Series_NX-OS_Interfaces_Configuration_Guide_chapter_0110.html#task_FCE2F708FDE8447D81BEED08BE97056D

Log server

switch# configure terminal
switch(config)# logging server 192.168.2.70 use-vrf management facility local5
switch(config)# logging source-interface mgmt 0
switch(config)# show logging server
switch(config)# copy running-config startup-config

https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/6-x/system_management/configuration/guide/b_Cisco_Nexus_9000_Series_NX-OS_System_Management_Configuration_Guide/sm_5syslog.html

Add a user

nexus02# configure terminal
nexus02(config)# username leo password mypassword role network-admin
nexus02(config)# username leo sshkey mysshkey
nexus02(config)# show user-account
nexus02(config)# copy running-config startup-config

Important notes

You must specify “vrf management” at the end of every IP command, since it is not the default context.

switch# ping gnu.org vrf management

The “no” keyword can delete unwanted configuration:

switch(config-vrf)# no ip route 0.0.0.0/0 192.168.0.254

The “show” keyword prints the current values

show snmp user

The configuration must be saved to keep changes upon reboot:

switch(config)# copy running-config startup-config

Set up the IP Address of the management interface

The “ip route” command sets the default gateway for the management interface.

The IP modification takes effect immediately (so, if connected over the mgmt interface, you’ll have to reconnect to the new IP).

switch# config t
switch(config)# interface mgmt 0
switch(config-if)# ip address 192.168.0.1/24
switch(config-if)# no shutdown
switch(config-if)# exit
switch(config)# vrf context management
switch(config-vrf)# ip route 0.0.0.0/0 192.168.0.254
switch(config-vrf)# ip domain-name mycompany.com
switch(config-vrf)# ip name-server 192.0.2.22
switch(config-vrf)# end
switch# 

NTP

To set ntp

switch(config)# show running-config ntp
switch(config)# ntp server de.pool.ntp.org use-vrf management
switch(config)# show ntp peer-status

Source: Cisco Website

SNMP

To set SNMP v2c:

switch(config)# snmp-server community mycompany ro

To set SNMP v3:

switch(config)# snmp-server user Admin auth sha abcd1234 priv abcdefgh

Source: Cisco Website

Email (Smart Call Home)

switch(config)# snmp-server contact system@company.com
switch(config)# callhome
switch(config-callhome)# email-contact system@company.com
switch(config-callhome)# phone-contact +49-30-1234-567-8
switch(config-callhome)# streetaddress 01 strasse Stadt,Germany

switch(config-callhome)# destination-profile system email-addr system@company.com

switch(config-callhome)# destination-profile system alert-group All

switch(config-callhome)# transport email mail-server smtpserver.provider.com use-vrf management
switch(config-callhome)# transport email from switch@company.com

switch(config-callhome)# enable

switch(config-callhome)# callhome send diagnostic

switch(config-callhome)# exit
switch(config)# copy running-config startup-config
[########################################] 100%
Copy complete, now saving to disk (please wait)...
Copy complete.

Setting MDIX on an interface

switch# show interface Eth1/53
switch# config t
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# interface Eth1/53
switch(config-if)# mdix auto
ERROR: Ethernet1/53: requested config change not allowed

Scp

To be able to scp with the switch, the scp-server feature must be enabled:

switch(config)# feature scp-server
scp nxos.7.0.3.I7.8.bin company_nexus01:bootflash:

If a port is blinking orange

Sometimes it is in a failed state because it was flapping before. You need to shake the interface down and up:

switch# show interface Eth1/1
Ethernet1/1 is down (linkFlapErrDisabled)
switch# configure 
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# interface ethernet 1/1
switch(config-if)# shutdown 
switch(config-if)# no shutdown 

Upgrade

To find the (hidden) checksum, you need to hover over the download title.

switch# show file bootflash://sup-1/nxos.7.0.3.I7.8.bin sha512sum 
77c6f20116f51e09035078d57209de21a66faed95807309b1bee36ae2dea22190a8813c12b983267979a1676ebd07d2f66ad504167c1e7af7a798e18bd98e38b
switch# show install all impact nxos bootflash:nxos.7.0.3.I7.8.bin
Installer will perform impact only check. Please wait. 

Verifying image bootflash:/nxos.7.0.3.I7.8.bin for boot variable "nxos".
[####################] 100% -- SUCCESS

Verifying image type.
[####################] 100% -- SUCCESS

Preparing "nxos" version info using image bootflash:/nxos.7.0.3.I7.8.bin.
[####################] 100% -- SUCCESS

Preparing "bios" version info using image bootflash:/nxos.7.0.3.I7.8.bin.
[####################] 100% -- SUCCESS

Performing module support checks.
[####################] 100% -- SUCCESS

Notifying services about system upgrade.
[####################] 100% -- SUCCESS



Compatibility check is done:
Module  bootable          Impact  Install-type  Reason
------  --------  --------------  ------------  ------
     1       yes      disruptive         reset  default upgrade is not hitless



Images will be upgraded according to following table:
Module       Image                  Running-Version(pri:alt)           New-Version  Upg-Required
------  ----------  ----------------------------------------  --------------------  ------------
     1        nxos                               7.0(3)I7(3)           7.0(3)I7(8)           yes
     1        bios     v07.61(04/06/2017):v07.61(04/06/2017)    v07.66(06/11/2019)           yes
switch# install all nxos bootflash:nxos.7.0.3.I7.8.bin
switch# show install all status