CLI Basics & Navigation
The Cisco command-line interface (CLI) is your window into every switch and router. This lesson covers the privilege levels, key command modes, and the most useful show commands you'll use daily.
Privilege Levels & Modes
Cisco devices have a hierarchy of access levels:
| Mode | Prompt | Access Level | What You Can Do |
|---|---|---|---|
| User EXEC | hostname> |
0 | View basic info, ping, traceroute. Cannot change config. |
| Privileged EXEC | hostname# |
15 | View detailed info, debug, reload. Enter configuration mode. |
| Global Configuration | hostname(config)# |
15 | Change device settings, enable features, configure interfaces. |
| Interface Configuration | hostname(config-if)# |
15 | Configure a single interface (IP, VLAN, duplex, speed, etc.). |
Moving Between Modes
Switch> enable
Password: (enter enable password)
Switch# configure terminal
Switch(config)#
! Enter interface configuration
Switch(config)# interface Gi0/0/1
Switch(config-if)#
! Exit to config mode
Switch(config-if)# exit
Switch(config)#
! Exit to privileged exec
Switch(config)# end
Switch#
! Exit to user exec
Switch# disable
Switch>
Key shortcuts:
en(enable) — enter privileged exec mode.conf t(configure terminal) — enter global config mode.ex(exit) — go up one level.Ctrl+Z— jump directly to privileged exec mode from any config mode.?— show available commands at your current level.Tab— auto-complete a command.
Essential Show Commands
Learn these commands; they are your most reliable troubleshooting tool.
Device & System Info
Switch# show version
Cisco IOS XE Software, C9300 Software, Version 17.9.1
System uptime is 42 days, 3 hours, 22 minutes
Switch# show inventory
NAME: "Chassis", DESCR: "Cisco Catalyst 9300 Switch"
PID: C9300-48P-E, SN: ABC123456
Interface Status
Switch# show interfaces brief
Interface IP-Address Status Protocol
GigabitEthernet0/0/1 unassigned up up
GigabitEthernet0/0/2 unassigned down down
GigabitEthernet0/0/3 unassigned up up
Port-channel1 unassigned up up
Detailed info on one interface:
Switch# show interfaces Gi0/0/1
GigabitEthernet0/0/1 is up, line protocol is up
Hardware is Gigabit Ethernet, address is aabb.cc00.0001
Internet protocol processing disabled
MTU 1500 bytes, BW 1000000 Kbit/sec
Encapsulation ARPA, loopback not set
Last input never, output 12d14h, output hang never
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 8000 bits/sec, 0 packets/sec
VLAN & Switchport Info
Switch# show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- ------
1 default active Gi0/0/5,Gi0/0/6
10 Engineering active Gi0/0/1
20 Sales active Gi0/0/2
Switch# show interfaces Gi0/0/1 switchport
Name : Gi0/0/1
Switchport : Enabled
Administrative Mode : static access
Operational Mode : static access
Access Mode VLAN : 10 (Engineering)
Trunk Port Info
Switch# show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gi0/0/24 on 802.1q trunking 1
Port Vlans allowed on trunk
Gi0/0/24 10,20,30
Port Vlans in spanning tree forwarding state
Gi0/0/24 10,20,30
Routing & IP
Switch# show ip route
Codes: C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
Gateway of last resort is not set
C 192.168.10.0/24 is directly connected, Vlan10
C 192.168.20.0/24 is directly connected, Vlan20
Switch# show ip interface brief
Interface IP-Address Status Protocol
Vlan10 192.168.10.1 up up
Vlan20 192.168.20.1 up up
MAC Address & Port Security
Switch# show mac-address-table
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- ---- -----
10 0011.2233.4455 DYNAMIC Gi0/0/1
10 aabb.cc00.0001 STATIC Cpu
20 0011.2233.6677 DYNAMIC Gi0/0/2
Running Configuration
Switch# show running-config
! or show run for short
building configuration...
Current configuration : 2847 bytes
!
version 17.9
!
hostname Switch
!
interface GigabitEthernet0/0/1
switchport mode access
switchport access vlan 10
!
interface Vlan10
ip address 192.168.10.1 255.255.255.0
no shutdown
Searching Command Output
Use the pipe | to filter output:
Switch# show running-config | include interface
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface Vlan10
interface Vlan20
Switch# show interfaces brief | begin Port-channel
Port-channel1 unassigned up up
Common filters: | include <text> (lines containing text), | begin <text> (start from line containing text), | exclude <text> (omit lines), | count (number of lines).
User vs. Privileged Exec
If you cannot run a show command, you might be in User EXEC mode. Type enable and enter the enable password to access Privileged EXEC. From there, all show commands work.
Basic Configuration Workflow
- Connect: SSH or Telnet to the device IP.
- Enable: Type
enableand authenticate. - View: Use show commands to understand the current state.
- Configure: Type
configure terminaland make changes. - Verify: Exit to privileged exec and re-run show commands to confirm.
- Save: Type
write memoryorcopy running-config startup-config.
Summary
- User EXEC (
>) is read-only; Privileged EXEC (#) unlocks show/debug/reload. - Use
enableto escalate,configure terminalto edit, andexitto move between levels. - Master
show version,show interfaces,show vlan,show run— they solve 80% of problems. - Pipe output with
|to filter results. - Always save with
write memorybefore you leave.