NX-OS
Nexus platform VDCs, virtual port-channels, and data center switching features.
Feature Enablement
NX-OS is modular — nothing runs until you explicitly enable it. This is the opposite of IOS where features are available by default.
Switch(config)# feature vpc
Switch(config)# feature hsrp
Switch(config)# feature lacp
Switch(config)# feature interface-vlan
Switch(config)# feature lldp
Switch(config)# feature nxapi
Switch(config)# feature scp-server
Switch# show feature
Output shows every feature and its state (enabled/disabled). If a command is not recognized, the feature is probably not enabled.
vPC Configuration
Switch(config)# vpc domain 100
Switch(config-vpc-domain)# peer-keepalive destination 10.50.1.11 source 10.50.1.10 vrf management
Switch(config-vpc-domain)# peer-switch
Switch(config-vpc-domain)# auto-recovery
Switch(config-vpc-domain)# ip arp synchronize
Switch(config)# interface port-channel 1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 1-4094
Switch(config-if)# vpc peer-link
Switch(config)# interface port-channel 10
Switch(config-if)# switchport mode trunk
Switch(config-if)# vpc 10
The vpc 10 number must match on both peers. The port-channel number does not need to match, but keeping them consistent avoids confusion.
Switch# show vpc
Switch# show vpc brief
Switch# show vpc peer-keepalive
Switch# show vpc consistency-parameters global
Switch# show vpc consistency-parameters interface port-channel 10
consistency-parameters is critical — if vPC detects a config mismatch between peers (STP mode, VLAN allowed list, speed), it suspends the vPC member port. Check this first when a vPC port goes down.
Interface Operations
show ip interface briefSwitch# show interface brief
Switch# show interface status
Switch# show interface Ethernet1/1
Switch(config)# interface Vlan 10
Switch(config-if)# ip address 10.50.10.1/24
Switch(config-if)# no shutdown
NX-OS uses CIDR notation (/24) for interface addresses, not subnet masks. ip address 10.50.10.1 255.255.255.0 also works but is not idiomatic.
|
Configuration Management
write memorySwitch# copy running-config startup-config
Switch# checkpoint my-checkpoint description "Before VLAN changes"
Switch# show checkpoint summary
Switch# rollback running-config checkpoint my-checkpoint
Checkpoints are stored locally. This is safer than IOS archive because rollback is atomic — it computes the diff and applies only the delta, not a full config replace.
Switch# show diff rollback-patch checkpoint my-checkpoint running-config
NX-OS vs IOS Differences
| Operation | IOS / IOS-XE | NX-OS |
|---|---|---|
Enable features |
Implicitly available |
|
Interface addressing |
|
|
Save config |
|
|
Config rollback |
|
|
VRF syntax |
|
|
Default route |
|
|
Show interfaces |
|
|
Port-channel |
|
|
Useful Show Commands
Switch# show module (1)
Switch# show environment (2)
Switch# show system resources (3)
Switch# show logging last 50 (4)
Switch# show interface counters errors (5)
Switch# show spanning-tree summary (6)
| 1 | Line cards and supervisor status |
| 2 | Fan, power supply, temperature |
| 3 | CPU and memory utilization |
| 4 | Recent syslog messages |
| 5 | Interface error counters across all ports |
| 6 | STP topology summary — root bridge, port states |
NX-API
Switch(config)# feature nxapi
Switch(config)# nxapi http port 80
Switch(config)# nxapi https port 443
curl -s -k -X POST https://10.50.1.40/ins \
-H "Content-Type: application/json" \
-u admin:<PASSWORD> \
-d '{
"ins_api": {
"version": "1",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show vlan brief",
"output_format": "json"
}
}' | jq '.ins_api.outputs.output.body'