ops@toolbox:~$ man switch-cli

Switch CLI Reference

Searchable Cisco IOS, Cisco NX-OS and Dell OS10 command reference for everyday network admin tasks. Copy-ready one-liners with notes.

πŸ“‹ Show / Verify

show versionIOS version, uptime, memory, serial number
show ip interface briefInterface IP summary: UP/DOWN at a glance
show interfacesFull interface stats, errors and counters
show interfaces GigabitEthernet0/1Single interface details
show running-configCurrent active config
show startup-configSaved (NVRAM) config
show loggingSystem log buffer
show clockCurrent device time
show process cpu sorted 5minCPU utilization by process
show process memory sortedMemory usage by process
show usersCurrently logged-in users/sessions
show cdp neighbors detailDiscover adjacent Cisco devices (CDP)
show lldp neighbors detailDiscover adjacent devices (LLDP, also non-Cisco)
show mac address-tableMAC β†’ port mapping table
show mac address-table address 0011.2233.4455Find which port a MAC is on

πŸ”Œ Interface Configuration

interface GigabitEthernet0/1Enter interface config mode
interface range GigabitEthernet0/1-24Configure a range of interfaces at once
description WAN-Link-to-ISPSet interface description
ip address 192.168.1.1 255.255.255.0Set IP address (L3 interface)
no shutdownEnable the interface (bring it up)
shutdownAdministratively disable the interface
switchport mode access switchport access vlan 10Set as access port on VLAN 10
switchport mode trunk switchport trunk native vlan 99 switchport trunk allowed vlan 10,20,30Set as trunk port with allowed VLANs
spanning-tree portfastEnable PortFast (for end devices, not uplinks!)
spanning-tree bpduguard enableShut port if BPDU received, security for PortFast ports

🏷 VLAN

show vlan briefVLAN list with assigned ports
show vlan id 10Detail for a specific VLAN
vlan 10 name SERVERSCreate VLAN 10 and name it
no vlan 10Delete VLAN 10
show interfaces trunkAll trunk ports and allowed/active VLANs

🌳 Spanning Tree

show spanning-treeSTP topology for all VLANs
show spanning-tree vlan 10STP for a specific VLAN
show spanning-tree detailVerbose STP, timers, port states, counters
spanning-tree mode rapid-pvstEnable Rapid PVST+ (recommended)
spanning-tree vlan 10 priority 4096Set STP root priority for VLAN 10 (lower = more likely to win)
spanning-tree vlan 10 root primaryAutomatically set root priority to beat current root
spanning-tree guard rootRoot guard on an interface, prevents rogue root election

πŸ—Ί Routing

show ip routeFull routing table
show ip route summaryRoute count by protocol
show ip ospf neighborOSPF adjacency table
show ip ospf interface briefOSPF-enabled interfaces and cost
show ip bgp summaryBGP peer table with prefix counts
show ip eigrp neighborsEIGRP adjacency table
ip route 0.0.0.0 0.0.0.0 192.168.1.254Add default static route

πŸ”’ ACL

show ip access-listsAll ACLs with hit counters
ip access-list extended BLOCK-SSH deny tcp any any eq 22 log permit ip any anyNamed extended ACL blocking SSH with logging
interface GigabitEthernet0/0 ip access-group BLOCK-SSH inApply ACL inbound on interface
clear ip access-list counters BLOCK-SSHReset ACL hit counters

πŸ’Ύ Config Management

copy running-config startup-configSave config to NVRAM (persist across reboots)
write memoryAlias for copy run start
copy running-config tftp://10.0.0.5/backup.cfgBack up config to TFTP server
reload in 30Schedule reload in 30 min, safety net for remote changes
reload cancelCancel a scheduled reload
service password-encryptionEncrypt all plaintext passwords in config
no ip domain-lookupPrevent DNS lookup on exec-mode typos

πŸ“‹ Show / Verify (NX-OS)

show versionNX-OS version, uptime, hardware
show interface briefAll interface status (NX-OS uses 'interface' not 'ip interface')
show ip interface briefL3 interface IPs only
show running-configCurrent active config
show featureWhich features are enabled (ospf, vpc, lacp, bgp…)
show moduleInstalled modules and linecards status
show vpcvPC domain status and peer-link health
show vpc consistency-parameters globalvPC config consistency check across peers
show port-channel summaryLACP port-channel status and member ports
show system resourcesCPU and memory utilisation
show logging last 100Last 100 log lines
show cdp neighbors detailDiscover adjacent Cisco devices

πŸ”Œ Interface (NX-OS)

interface Ethernet1/1NX-OS uses slot/port notation
interface Ethernet1/1-10Range of interfaces
switchport switchport mode access switchport access vlan 10Access port (NX-OS requires 'switchport' first)
channel-group 1 mode activeAdd port to LACP port-channel 1 (active = initiate LACP)
no shutdownEnable interface

🏷 VLAN & vPC (NX-OS)

feature vpc feature lacpEnable vPC and LACP features (required before configuring)
vpc domain 1 peer-keepalive destination 10.0.0.2 source 10.0.0.1Configure vPC domain and keepalive link
vlan 10-20,30Create multiple VLANs at once
show vlan briefVLAN list

πŸ’Ύ Config Management (NX-OS)

copy running-config startup-configSave config
checkpoint PRE-CHANGECreate a config checkpoint (snapshot) before making changes
rollback running-config checkpoint PRE-CHANGERoll back to a checkpoint
show diff rollback-patch checkpoint PRE-CHANGE running-configPreview rollback diff before applying

πŸ“‹ Show / Verify (Dell OS10)

show versionOS10 version, model, uptime
show interface briefAll interface status summary
show ip interface briefL3 interface IP addresses
show running-configurationCurrent config (Dell uses 'running-configuration' not 'running-config')
show vlanVLAN table with port membership
show mac address-tableMAC address table
show spanning-tree briefSTP summary for all VLANs
show ip routeRouting table
show lldp neighbors detailLLDP neighbour discovery
show systemSystem info, temperature, fans, PSU
show system stack-unit 1 pem 0Power supply status for slot 0

πŸ”Œ Interface (Dell OS10)

interface ethernet 1/1/1Dell OS10 uses slot/port/subport notation
description SERVER-01Set port description
switchport mode access switchport access vlan 10Access port on VLAN 10
switchport mode trunk switchport trunk allowed vlan 10,20,30Trunk port with specific VLANs
spanning-tree portfastPortFast for access ports (OS10)
no shutdownEnable port

🏷 VLAN (Dell OS10)

interface vlan 10 description SERVERSCreate VLAN 10 with description
show vlan id 10Detail for VLAN 10
no interface vlan 10Delete VLAN 10

πŸ’Ύ Config Management (Dell OS10)

copy running-configuration startup-configurationSave config to boot partition
copy running-configuration ftp://10.0.0.5/switch-backup.cfgBack up config via FTP
show startup-configurationView saved boot config

IOS vs NX-OS, key differences

Cisco IOS is found on campus switches (Catalyst series) and routers. NX-OS runs on data-centre Nexus switches and adds features like vPC (virtual port-channel), FabricPath and native checkpoints/rollbacks. The biggest operational difference: NX-OS requires features to be explicitly enabled with feature <name> before their commands become available. NX-OS also supports config checkpoints and rollbacks natively, use checkpoint before any risky change.

Dell OS10 vs OS9

Newer Dell PowerSwitch S-series and Z-series run OS10 (Linux-based NOS) which uses running-configuration and ethernet 1/1/1 slot notation. Older Dell Force10 gear runs OS9. If you SSH in and the prompt shows DellEMC# you're on OS10; Force10# indicates OS9. OS10 also exposes a full Linux bash shell via system bash for advanced scripting.

The reload safety net

When making changes remotely on Cisco IOS, use reload in 30 immediately before starting. If you break connectivity, the switch auto-reloads in 30 minutes and loads the last saved config. Run reload cancel once you've verified the change worked. This simple habit has saved countless 3am datacenter trips.

Related tools

Subnet Calculator
IPv4 CIDR with subnet split, find-prefix and RFC annotations.
Network Troubleshooting Ref
ping, traceroute, nmap, ss, dig and tcpdump one-liners.
Firewall Rule Builder
Build iptables, nftables and ufw rules with a GUI.