Cisco Commands
Cisco Commands
There are several Cisco access levels and modes that allow you to run different commands. You can learn
more about each mode in the Cisco IOS command hierarchy, but the table below is a reference for our
examples.
Almost all Cisco devices use Cisco IOS to operate and Cisco CLI to be managed. The basic CLI commands
for all of them are the same, which simplifies Cisco device management. Here is a Cisco commands cheat
sheet that describes the basic commands for configuring, securing and troubleshooting Cisco network
devices.
Basic Configuration Commands
Command Purpose
enable Logs you into enable mode, which is also known as user
exec mode or privileged mode
hostname name Sets a host name to the current Cisco network device
copy from-location to-location An enable mode command that copies files from one
file location to another
copy running-config startup-config An enable mode command that saves the active config,
replacing the startup config when a Cisco network
device initializes
copy startup-config running-config An enable mode command that merges the startup
config with the currently active config in RAM
show running-config interface interface An enable mode command to display the running
slot/number configuration for a specific interface
show ip interface [type number] Displays the usability status of interfaces that are
configured for IP
ip name-server serverip-1 serverip-2 A configure mode command that sets the IP addresses
of DNS servers
Troubleshooting Commands
duplex {auto | full | half} An interface mode command that manually sets
duplex to half, full or auto
show vtp status Lists the current VTP status, including the current
mode
show ip rip database Displays the contents of the RIP routing database
switchport access vlan Sets the VLAN that the interface belongs to.
switchport trunk encapsulation dot1q Specifies 802.1Q encapsulation on the trunk link.
switchport mode { access | trunk } Configures the VLAN membership mode of a port. The
access port is set to access unconditionally and
operates as a non-trunking, single VLAN interface that
sends and receives non-encapsulated (non-tagged)
frames. An access port can be assigned to only one
VLAN.
The trunk port sends and receives encapsulated
(tagged) frames that identify the VLAN of origination.
A trunk is a point-to-point link between two switches
or between a switch and a router.
switchport trunk {encapsulation { dot1q Sets the trunk characteristics when the interface is in
} trunking mode. In this mode, the switch supports
simultaneous tagged and untagged traffic on a port.
Security Commands
username name password pass-value A global command that defines one of possibly
multiple user names and associated passwords used
for user authentication. It is used when the login
local line configuration command has been used.
crypto key generate rsa A configuration mode command that creates and
stores (in a hidden location in flash memory) the keys
that are required by SSH
transport input {telnet | ssh} Used in vty line configuration mode, defines whether
Telnet or SSH access is allowed into this switch. Both
values can be specified in a single command to allow
both Telnet and SSH access (default settings).