3.2 Command Line Interface (CLI) Flashcards
User Exec Mode (>)
Read only access
Can do basic troubleshooting using PING and TRACEROUTE
User exec mode provides the most basic level of access to a Cisco device. Users logged into this mode have read-only access to the device and access to information gathering permissions such as ping, telnet, traceroute, and connect. Users are unable to make long-term changes while in user mode.
Privileged exec mode (#)
Editing access (not an admin)
Privileged exec mode provides a user with editing capabilities. Because the user has access to commands such as delete, copy, erase, disable, clear, and disconnect, long term damage can be done while in this mode. Access to privileged mode should be protected.
Global configuration mode (config)
configuration level access
Global configuration mode provides advanced access to device configurations. Extensive damage can be done while logged into this mode. Access should be password protected.
ROMMON mode
ROMMON mode is a command line mode that is used to recover a lost or forgotten password, to reinstall the IOS, or to format the flash file system. ROMMON mode lets you configure your router if the router can’t find a valid system image or if the boot sequence is interrupted when you start the router. It is an emergency, command-line access to the router. To go to exec mode from this mode, type continue at the prompt.
show running-configuration
Configuration that is currently running on the device’s memory.
show startup-configuration
Configuration that will be loaded on restart.
show version
The following version information:
- Hardware configuration
- Running IOS version
- ROM bootstrap version
- RAM and processor information
show flash
The following flash information:
- Size of the configuration files
- Available flash memory
- Information for all IOS image files stored
on the device
show history
Commands in the command history list.
show clock
The current time and date of the device.
show interface
Information about a router’s interface including:
- Interface status (whether it’s up or down)
- Utilization
- Protocol status on the interface
- Errors
- Maximum transmission unit (MTU)
show ip interface
Information about the configuration of the IP protocols on each interface, including:
- IP address
- Layer 2 status
- Layer 3 status
show ip route
The following routing table information:
- Networks the router can reach
- Metric
- Route to each network
running configuration file
The running configuration file stores the current configuration of the device. The running configuration file must be copied to the startup configuration file to maintain these changes on restart. You may also want to copy a configuration file that you downloaded, copied from another device, or backed up for safe keeping.
Where can a configuration file be loaded from?
A Cisco device can load a configuration file from:
- NVRAM (startup-configuration file, by
default value 0x2102) - TFTP server
Router# copy run start
Saves the contents of the running-config file to NVRAM.
Router# copy start run
Copies the startup-config file into RAM.
Router# copy run tftp
Saves the contents of the running-config file to a TFTP server.
Router# copy start tftp
Saves the contents of the startup-config file to a TFTP server.
Router# copy tftp start
Copies a configuration file from the TFTP server into NVRAM.
Router# copy tftp run
Copies a configuration file from the TFTP server into RAM.
Router# copy flash tftp
Copies the IOS image to the TFTP server. When using this command, you will be prompted for the destination file name and address.
Router# erase flash
Deletes the contents of Flash memory (deletes the IOS image).
Router# erase start
Erases the contents of the startup-config file.
Router# erase nvram
Deletes the contents of NVRAM (which also erases startup-config).
Interface Numbering Scheme
A numbering scheme is applied to switches and routers. The numbering scheme is based on characteristics of the device.
The switch interface numbering scheme includes the bank number and port number as described in the following table.
Port bank number
Port bank numbers are determined as follows:
- Switches that have one fixed bank are
assigned 0. - Switches that have multiple banks start
with 0 and are assigned from bottom to
top. For example, if a switch had 5 banks, it
would have bank numbers 0–4.
Port number
Port numbers are determined as follows:
- Port numbers are assigned starting with 1.
- Switches that have 1 row of ports on a
bank are assigned from left to right. - Switches that have 2 rows of ports on a
bank are assigned from top to bottom and
left to right.
Routing Interface Numbering Scheme
Routing interface numbering schemes include the following:
- fixed ports
- Slot/Port numbering
- Slot/Sub-slot/Port numbering
Fixed ports
Older Cisco routers, such as the Cisco 2500, use a fixed port numbering scheme. In the fixed port numbering scheme:
- Each built-in port is hard-wired with a port
number. - Numbering starts with 0 and is assigned
from right to left.
Serial0 (1st serial port)
Serial1 (2nd serial port)
Ethernet0 (1st Ethernet port)
Slot/Port numbering
Newer Cisco routers, such as the Cisco 2600, support WAN interface cards (WIC) and Network Modules (NM) with various ports. Some Network Modules include slots for WAN interface cards. In the Slot/Port numbering scheme:
- The slot number scheme includes:
- Built-in ports and built-in WIC slots are
given NM slot number 0. The remaining
NM slots are assigned from right to left
and bottom to top. - If the device does not have built-in ports
or built-in WIC slots, the NM slot
numbering is assigned from right to left
and bottom to top, starting with 0.
- Built-in ports and built-in WIC slots are
- The port numbers start with 0 and are assigned from right to left and bottom to top for each NM slot.
FastEthernet3/4 (3rd NM slot/5th FastEthernet port)
FastEthernet0/3 (built-in/4th FastEthernet port)
Serial2/3 (2nd NM slot/4th serial port)
Serial1/5 (1st NM slot/6th serial port)
Serial0/2 (built-in or 1st WIC slot/3rd serial port)
Slot/Sub-slot/Port numbering
The newest Cisco routers, such as the Cisco 1800/2800/3800, use an enhanced slot/port numbering scheme to identify the WIC sub-slot . In the Slot/Sub-slot/Port numbering scheme:
- Built-in WIC ports are numbered using a
slot of 0 and a sub-slot that is the WIC slot
number. - WIC ports on a NM slot are numbered
using the NM slot number and the WIC’s
sub-slot number on the NM. - Ports (other than those of a WIC) use the
slot/port numbering scheme.
FastEthernet2/1/0 (2nd NM slot/2nd WIC sub-slot/1st FastEthernet port)
FastEthernet0/0/0 (built-in/1st WIC sub-slot/1st FastEthernet port)
FastEthernet0/1/3 (built-in/2nd WIC sub-slot/4th FastEthernet port)
Serial4/1/1 (4th NM slot/2nd WIC sub-slot/2nd Serial port)
Serial0/1/0 (built-in/2nd WIC sub-slot/1st Serial port)
Ethernet1/0 (1st NM slot/1st Ethernet port)
FastEthernet0/1 (built-in/2nd FastEthernet port)
Context sensitive help
Context sensitive help provides you with:
- Commands that are available for each
command mode - Commands that begin with specific
characters - Keywords and arguments that are
available for a command
command syntax check
The second form of help is the command syntax check. The command line interpreter evaluates the command from left to right. If the command is understood, the action is executed. If the command is not understood, it will provide helpful feedback describing the error.
?
Displays a list of commands available in the current mode
Command ?
Displays keywords and arguments for the specified command
Partial_Command + Tab
Inserts the full command from a partial command
Help Prompts
WORD - Type a one-word response
LINE - Type a multiple-word response
[0-4567] - Type a number within the provided range
[0-FFFFFF] - Type a number within the range in brackets
[cr]> - The command is complete as typed
A.B.C.D - Type an IP address
Command History
The command history feature saves you time by eliminating the need to retype a command you recently entered. Command history temporarily stores a list of commands you have used. Commands stored in command history can be recalled by the user. By default, the system stores up to 10 command lines, but this number can be increased or decreased as needed. The following table describes how to use command history.
Ctrl + P or Up arrow
Shows the previous command
Ctrl + N or Down arrow
Shows the next command
terminal history
Turns command history on
terminal no history
Turns command history off
terminal history size <0-256>
Sets the number of lines in the history buffer
show history
Shows all the commands in the history buffer
Command Editing Facts
The IOS command line interface (CLI) provides shortcuts that make keyboard input easier.
Tab
Completes a command name entry that has been partially entered.
Ctrl + A
Moves to the beginning of the line.
Ctrl + E
Moves to the end of a line.
Ctrl + B or Left Arrow
Goes forward one character.
Esc, B
Goes back one word. Note that you must release the Esc key before pressing B.
Esc, F
Moves forward one word. Note that you must release the Esc key before pressing F.
Ctrl + Z
Quits a configuration mode.
terminal editing
Turns advanced editing on.
terminal no editing
Turns advanced editing off.
Backspace
Removes the character to the left of the cursor.
Ctrl + D
Removes the character at the cursor.
Ctrl + K
Removes all characters from the cursor to the end of the command line.
Esc, D
Removes all characters from the cursor to the end of the word. Note that you must release the Esc key before pressing D.
Ctrl + U or Ctrl + K
Removes all characters from the cursor to the end of the command line.
Ctrl + W
Removes the word to the left of the cursor.
You want to save the configuration file in NVRAM to a TFTP server with address 192.168.1.10 to be used as a backup. Which command would you use?
Use the copy start tftp command to copy the startup-config file to the TFTP server. You cannot specify the server address from the command line. After you issue the command, you will be prompted to supply the server address.