Networking  

Useful Cisco Switch Verification Commands

Introduction

Cisco switches are important devices in a network. They connect computers, servers, and other devices. Setting up a switch is only the first step. It is also important to check that the switch is working correctly. If you don't check it, problems like wrong VLANs, port errors, or network loops can cause network issues.

Cisco IOS has many commands that help network engineers check the switch, see its settings, and fix problems quickly. These commands show information about ports, VLANs, spanning tree, MAC addresses, and more.

In this article, we will look at the most useful Cisco switch commands. Using these commands helps keep the network working well, safe, and free of problems.

Check Basic Switch Information

These commands give you general details about your switch, like the software it is running, how long it has been powered on, and what hardware is installed.

  • Operating system (IOS) version, uptime, switch model, and memory information.

show version
  • Shows the current active configuration that is running in the switch’s memory.

show running-config
  • Displays the configuration that will load when the switch restarts.

show startup-config 
  • List hardware components like modules, power supplies, and serial numbers.

show inventory 
  • Checks the health of the switch, such as fthe an, temperature, and power supply.

show environment 

Check Interfaces and Connections

Switch ports (interfaces) are where devices like computers, servers, or other switches connect. It’s important to make sure these interfaces are working.

  • To see all ports quickly, their IP addresses, and if they are up or down, use this:

show ip interface brief
  • To see detailed information about a port (speed, errors, duplex), use this:

show interfaces
  • To check low-level hardware information of a port, use this:

show controllers
  • To test if the switch can talk to another device, use this:

ping [IP address]
  • To see the path the packets take to reach another device, use this:

traceroute [IP address]

Check VLAN and Trunk Settings

VLANs (Virtual LANs) are used to separate traffic inside a switch. Trunks carry traffic for multiple VLANs between switches.

  • To see all VLANs and which ports belong to them, use this:

show vlan brief
  • To see details about one VLAN, use this:

show vlan id [number]
  • To see which ports are trunk ports and what VLANs they carry, use this:

show interfaces trunk
  • To check Spanning Tree for a VLAN and see which switch is the main (root) switch, use this:

show spanning-tree vlan [number]

Check MAC Address and ARP Tables

Switches forward traffic based on MAC addresses. You may need to confirm that the switch is learning addresses correctly.

  • To see all MAC addresses learned and which ports they are on, use this:

show mac address-table
  • To see only learned (not manually added) MAC addresses, use this:

show mac address-table dynamic
  • To see IP address to MAC address mapping, use this:

show arp

Check Port Security and ACLs

Port security is used to control which devices can connect to a port. ACLs (Access Control Lists) filter traffic.

  • To see port security for all ports, use this:

show port-security
  • To see details about one port’s security, use this:

show port-security interface [id]
  • To see access lists (ACLs) and how many packets match them, use this:

show access-lists

Check Spanning Tree Protocol (STP)

STP prevents loops in the network. Without STP, switches could create endless loops, crashing the network.

  • To see overall Spanning Tree information, use this:

show spanning-tree
  • To see which switch is the root bridge (main switch), use this:

show spanning-tree root
  • To see Spanning Tree information for one port, use this:

show spanning-tree interface [id]

Check Routing and Layer 3 Features (For L3 Switches)

Some switches can also route traffic, like a router.

To see the routing table, use this:

show ip route
  • To see which routing protocols are running, use this:

show ip protocols
  • To see Cisco devices directly connected to the switch, use this

show cdp neighbors
  • To see non-Cisco devices directly connected, use this

show lldp neighbors

Conclusion

Cisco switch verification commands are simple tools that help you check if your switch is working. They let you see if the ports are up, if the VLANs are correct, and if the switch is healthy. If something is wrong, these commands help you find the problem.

If you practice these commands often, you will get better at fixing issues and understanding how the switch works. Always remember: after you set up a switch, use verification commands to make sure everything is okay.