SW1# show version
View the switch’s system information and software version
The “show version” command displays device model, IOS version, bootloader information, uptime, and basic hardware details. This is the first command to run when you need an overview of the switch state or to verify firmware and platform before changes.
SW1# show running-config
or simply
SW1# sh run
Display the active configuration
Use “show running-config” (or “sh run”) to view the switch’s current, active configuration in RAM. This includes interface settings, VLAN assignments, management IPs, ACLs, and more. Reviewing the running configuration is essential when troubleshooting or preparing configuration changes.
View the status of all ports
SW1# show interfaces status
This command lists every interface with its administrative and operational state, VLAN membership, duplex/speed (where supported), and connected port type. It’s useful for quickly identifying which ports are up, down, or assigned to a particular VLAN.
View the configuration for a specific port
SW1# show running-config interface gigabitEthernet 1/0/4
Displays the running configuration lines that apply to GigabitEthernet1/0/4. For example, you can confirm access/trunk mode, ACLs, spanning-tree settings, and any interface descriptions.
Display VLAN information
SW1# show vlan
“show vlan” lists configured VLANs and their assigned ports, along with VLAN names and status. Use this to verify VLAN presence and which ports belong to each VLAN.
Show the MAC address table
SW1# show mac address-table
Lists learned MAC addresses on the switch and the associated ports and VLANs. This table helps you trace which device is on which port and is essential for layer 2 troubleshooting.
Find which port a specific MAC address is on
On Cisco switches, MAC addresses are commonly shown in the format xxxx.xxxx.xxxx.
SW1# show mac address-table address xxxx.xxxx.xxxx
Search for a single MAC entry to quickly identify the port and VLAN for a given device.
Show MAC addresses learned on a specific port
Example: viewing MACs learned on port 3.
SW1# show mac address-table interface gigabitEthernet 1/0/3
This command narrows the MAC table to entries associated with a specific interface—useful when diagnosing collisions, duplicate addresses, or unexpected devices on a port.
View all interfaces with statistics and operational details
SW1# show interfaces
“show interfaces” provides detailed per-interface statistics, including packet counts, errors, CRCs, output drops, and protocol state. It’s the most detailed view for interface diagnostics.
View status for a single interface
Example: checking port 2 status.
SW1# show interfaces gigabitEthernet 1/0/2
Use this when you need error counters, uptime, or bandwidth details for one specific port rather than the full list.
Identify ports disabled by errors
SW1# show interfaces status err-disabled
Ports can be placed into err-disabled state after security violations, link flaps, or other errors. This command lists those ports so you can investigate the cause and restore service if appropriate.
Administratively shut down a port
Example: shutting down port 5.
SW1# configure terminal SW1(config)# interface gigabitEthernet 1/0/5 SW1(config-if)# shutdown
Putting a port into an administratively down state is useful for maintenance, preventing unauthorized access, or isolating issues.
Enable (no shutdown) a port
Example: enabling port 6.
SW1# configure terminal SW1(config)# interface gigabitEthernet 1/0/6 SW1(config-if)# no shutdown
Use “no shutdown” to bring an interface back to an administratively up state after maintenance or configuration changes.
Assign or change the VLAN for an access port
Example: assigning port 2 to VLAN 105.
SW1# configure terminal SW1(config)# interface gigabitEthernet 1/0/2 SW1(config-if)# switchport access vlan 105 SW1(config-if)# end
Set the access VLAN for edge ports where end devices connect. Confirm the VLAN exists before assigning it.
Add a description to a port
Example: labeling port 4 as a camera port.
SW1# configure terminal SW1(config)# interface gigabitEthernet 1/0/4 SW1(config-if)# description camera port SW1(config-if)# end
Interface descriptions provide quick context for administrators and are recommended for documentation and troubleshooting.
Change the switch hostname
Example: renaming the device to “sw1”.
SW1# configure terminal SW1(config)# hostname sw1
Updating the hostname helps identify the device in logs and management systems.
Save the running configuration to startup configuration
SW1# write memory
or briefly;
SW1# wr
Saving ensures configuration changes persist across reloads and power cycles.
Reload (reboot) the switch
SW1# reload
Use this to restart the device after upgrades or when a reboot is required. Always save your configuration first.
Exit the switch CLI session
SW1# Exit
Author: Samed Gül