Freebie

IOS commands

Cisco IOS organizes configuration into a hierarchy of modes, described below. Use exit to move up one level and end (or Ctrl+Z) to return directly to Privileged EXEC from any configuration mode.

Modes

Cisco IOS has the following modes:

ModePromptDescription
User EXEC mode>The first mode you reach after connecting to the device. It gives limited, read-only access to device status.
Privileged EXEC mode, also called enable mode#Reached by running enable from User EXEC mode. It gives full read access to device state and is required before you can enter configuration mode.
Global configuration mode(config)#Reached by running configure terminal from Privileged EXEC mode. Device-wide settings, like the hostname and routing protocols, live here.
Interface configuration mode(config-if)#A sub-mode of global config that controls a specific physical or logical port, for example its speed, IP address, or shutdown state.
Line configuration mode(config-line)#A sub-mode of global config that controls an access line used to connect to the device: the console port, VTY lines (SSH/Telnet), or the AUX port.
Router configuration mode(config-router)#A sub-mode of global config that controls a specific routing protocol process, such as OSPF.

Enter mode

Each mode has its own command to enter it, run from the mode one level above.

ModeCommand
User EXEC(connect)
Privileged EXECenable
Global configurationconfigure terminal
Interface configurationinterface type port-number
Line configurationline console 0
line vty first last
line aux 0
Router configurationrouter ospf process-id

User EXEC

Use this mode for quick, non-privileged checks, like confirming the device is reachable, without risking any configuration changes.

CommandDescription
enableEnters Privileged EXEC mode
quitCloses the current session

Privileged EXEC

Use this mode when you need full visibility into device state, such as the running configuration or hardware details, or when you need to run operational commands like reload and copy before entering configuration mode.

CommandDescription
disableReturns to User EXEC mode
configure terminalEnters global configuration mode
no debug allDisables all active debug sessions
undebug allAlias for no debug all
reloadReboots the device
copy running-config startup-configSaves running config to NVRAM
copy startup-config running-configLoads startup config into running config
show running-configDisplays the current running configuration
show startup-configDisplays the saved startup configuration
write eraseErases the startup configuration from NVRAM
erase startup-configAlias for write erase
erase nvram:Erases all NVRAM contents
show mac address-tableDisplays the MAC address table (switches only)
quitCloses the current session

Global configuration

Use this mode to change settings that apply to the whole device, such as the hostname, or as your entry point into a more specific sub-mode like an interface, line, or routing process.

CommandDescription
line console 0Enters line config mode for the console; subsequent commands apply only to the console line
line vty first lastEnters line config mode for remote access lines
interface type port-numberEnters interface config mode for the specified port
router ospf process-idEnters router config mode for an OSPF process
hostname nameSets the device hostname
exitMoves up one level in the config hierarchy
endReturns directly to Privileged EXEC
Ctrl+ZReturns directly to Privileged EXEC

Interface configuration

Use this mode to change settings scoped to one physical or logical port, such as its IP address, speed, or shutdown state.

CommandDescription
speed valueHard-sets interface speed; disables autonegotiation
exitMoves up one level in the config hierarchy
endReturns directly to Privileged EXEC
Ctrl+ZReturns directly to Privileged EXEC

Line configuration

Use this mode to control how administrators connect to the device itself, such as setting console or VTY passwords, not how the device forwards traffic.

CommandDescription
loginTells IOS to perform simple password checking on the line
password passwordSets the plain-text password for the line
exitMoves up one level in the config hierarchy
endReturns directly to Privileged EXEC
Ctrl+ZReturns directly to Privileged EXEC

Router configuration

Use this mode to enable or tune a specific routing protocol instance, such as advertising networks into OSPF.

CommandDescription
exitMoves up one level in the config hierarchy
endReturns directly to Privileged EXEC
Ctrl+ZReturns directly to Privileged EXEC

Help commands

IOS provides context-sensitive help so you don’t have to memorize every command and keyword.

SyntaxDescription
?Lists every command available in the current mode
command ?Lists the keywords or arguments that command accepts
com?Lists every command that starts with com (no space before ?)
command parm?Lists the keywords for command that start with parm (no space before ?)
command parmTabCompletes parm if it uniquely matches one keyword
command parm1 ?Lists the keywords available after parm1