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.
show version
show running-config
show startup-config
show inventory
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.
show ip interface brief
show interfaces
show controllers
ping [IP address]
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.
show vlan brief
show vlan id [number]
show interfaces trunk
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.
show mac address-table
show mac address-table dynamic
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.
show port-security
show port-security interface [id]
show access-lists
Check Spanning Tree Protocol (STP)
STP prevents loops in the network. Without STP, switches could create endless loops, crashing the network.
show spanning-tree
show spanning-tree root
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
show ip protocols
show cdp neighbors
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.