0% found this document useful (0 votes)
99 views

Cisco Learning Web LABS Training

The document discusses navigating between user EXEC and privileged EXEC modes on a Cisco IOS device. It provides steps to access each mode, view available commands, and use help features. User EXEC allows limited monitoring while privileged EXEC provides full access and configuration commands. Context-sensitive help with "?" displays commands available in the current mode.

Uploaded by

nea317
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views

Cisco Learning Web LABS Training

The document discusses navigating between user EXEC and privileged EXEC modes on a Cisco IOS device. It provides steps to access each mode, view available commands, and use help features. User EXEC allows limited monitoring while privileged EXEC provides full access and configuration commands. Context-sensitive help with "?" displays commands available in the current mode.

Uploaded by

nea317
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 17

Click here to print this page

Discovery 1: Get Started with Cisco CLI


Task 1: Navigate Between EXEC Modes
This session will guide you through the navigation between user EXEC and privileged
EXEC on the Cisco IOS command line. The lab is prepared with the devices that are
represented in the topology, but for this session you will only be using SW2.
Activity
Step 1: Access the console of SW2.
The greater than symbol (>) at the end of the prompt is an indication that you are
accessing the user EXEC.
SW2>
Step 2: Use the question mark (?) to view the list of commands that are available
in user EXEC.
When the display output pauses with the --More-- prompt, you can use the space bar
to display the next page of the output.
SW2> ?
Exec commands:
access-enable Create a temporary Access-List entry
access-profile Apply user-profile to interface
clear Reset functions
connect Open a terminal connection
crypto Encryption related commands.
disable Turn off privileged commands
<... output omitted ...>
mtrace Trace reverse multicast path from destination to source
name-connection Name an existing network connection
--More--
pad Open a X.29 PAD connection
ping Send echo messages
<... output omitted ...>
where List active connections
x3 Set X.3 parameters on PAD
You have to press the space bar twice to scroll through the complete command list
under the user EXEC. Have this information in mind, because you will soon contrast
it to what you will be able to see in the privileged EXEC mode.
The commands are listed in alphabetical order. Note that the configure command is
not available under user EXEC.
In the outputs, like in the previous one, many lines are omitted, due to space
preservation. Omitted lines are indicated with <... output omitted ...> string.
Step 3: As you just saw, when you are presented with the --More-- prompt, you can
use the space bar to scroll through the output page by page.
You can also use the Enter key to scroll forward just one line. You can also cancel
the remaining output. The method to cancel the remaining output is device and
operating system-version dependent. Sometimes you need to press Ctrl-C and
sometimes you need to press "Q." On SW2, you can press any key other than the space
bar or the Enter key. Give it a try!
SW2> ?
Exec commands:
access-enable Create a temporary Access-List entry
access-profile Apply user-profile to interface
clear Reset functions
connect Open a terminal connection
crypto Encryption related commands.
disable Turn off privileged commands
<... output omitted ...>
mtrace Trace reverse multicast path from destination to source
name-connection Name an existing network connection
--More--
pad Open a X.29 PAD connection
--More--
ping Send echo messages
--More--
SW2>
Entering EXEC Mode
As a security feature, Cisco IOS Software separates EXEC sessions into the
following two access levels:

User EXEC: Allows you to access only a limited number of basic monitoring
commands. When in EXEC mode, the prompt ends with the greater than or right angle
bracket (>) symbol. For example, when you are in EXEC mode on a device with the
hostname DTW_Switch, the prompt would be DTW_Switch>.
Privileged EXEC: Allows you to access all device commands, such as those that
you would use for configuration and management. It can be password-protected to
allow only authorized users to access the device. When in this mode, the prompt
ends with the octothorpe or pound (#) symbol. For example, when you are in
privileged EXEC mode on a device with the hostname DTW_Switch, the prompt would
look like DTW_Switch#. To change from user EXEC mode to privileged EXEC mode, enter
the enable command at the hostname> prompt. To return to the user EXEC level, enter
the disable command at the hostname# prompt.

By default, no authentication is required to access user EXEC mode from the


console. You can enter the EXEC mode by simply pressing the Enter key. However, if
login is configured, you must enter a username and password to enter the EXEC mode.
It is a good practice to ensure that authentication is configured during the
initial configuration.
Entering the question mark (?) in privileged EXEC mode reveals many more command
options than entering the command at the user EXEC level. This feature is referred
to as context-sensitive help.
User EXEC Mode Summary

User EXEC mode provides a limited examination of a switch or router.


Offering only a limited number of basic monitoring commands, user EXEC mode is
sometimes referred to as view-only mode.
This mode does not allow reloading of the device or switch.
Given its limited capabilities, this mode is useful for some basic operations.

Privileged EXEC Mode Summary

Privileged EXEC mode provides a detailed examination of a switch or a router


and enables configuration and debugging.
Privileged EXEC mode provides critical commands, such as those related to
configuration and management.
To change from user EXEC mode to privileged EXEC mode, enter the enable command
at the hostname> prompt.
If an enable password or an enable secret password is configured, the switch or
device prompts for this password.
When the correct enable password is entered, the switch or device prompt
changes to hostname#.
To return to the user EXEC level, enter the disable command at the hostname#
prompt.

Step 4: Use the enable command to access the privileged EXEC.


The last character in the prompt has changed to the octothorpe (#) symbol. This
symbol indicates to you that you are in privileged EXEC.
SW2> enable
SW2#
Step 5: Use the ? command again to display the commands that you can use under
privileged EXEC. Use the space bar to scroll through the entire list of the output.
SW2# ?
Exec commands:
access-enable Create a temporary Access-List entry
access-profile Apply user-profile to interface
access-template Create a temporary Access-List entry
archive manage archive files
beep Blocks Extensible Exchange Protocol commands
calendar Manage the hardware calendar
cd Change current directory
clear Reset functions
clock Manage the system clock
cns CNS agents
configure Enter configuration mode
connect Open a terminal connection
<... output omitted ...>
enable Turn on privileged commands
eou EAPoUDP
--More--
erase Erase a filesystem
<... output omitted ...>
Under privileged EXEC, you needed to press the space bar four times to get through
the entire list of commands. Under user EXEC, you only needed to hit the space bar
twice.
Under privileged EXEC, you can use the configuration command. You cannot proceed to
the configuration mode from the user EXECyou must traverse through the privileged
EXEC first.
Step 6: Use the disable command to return to user EXEC.
SW2# disable
SW2>
The last character in the system prompt has returned to the greater than sign (>).
Task 2: Explore CLI Help
This session will guide you through using the question mark (?) command for help on
the IOS CLI. It will also demonstrate how you can take advantage of the tab
completion feature of the IOS CLI. The lab is prepared with the devices that are
represented in the topology, but for this session you will only be using SW2. You
will also take a look at CLI error messages.
Activity
Step 1: On SW2, use the enable command to access privileged EXEC.
SW2> enable
SW2#
Step 2: Use the question mark (?) to display all the commands that you can use
under privileged EXEC.
Use the space bar to scroll through the entire list of the output.
SW2# ?
Exec commands:
access-enable Create a temporary Access-List entry
access-profile Apply user-profile to interface
access-template Create a temporary Access-List entry
archive manage archive files
beep Blocks Extensible Exchange Protocol commands
calendar Manage the hardware calendar
cd Change current directory
clear Reset functions
clock Manage the system clock
cns CNS agents
configure Enter configuration mode
connect Open a terminal connection
<... output omitted ...>
enable Turn on privileged commands
eou EAPoUDP
--More--
<... output omitted ...>
The list is quite long. You have to use the space bar four times to get through the
entire list.
CLI Help
When you are learning a new program or interface, you usually depend on the Help
features the program offers. Cisco IOS Software includes extensive command-line
help functions, including context-sensitive help. There are two basic types of CLI
keyboard help that the Cisco IOS devices enable. The first is context-sensitive
help, which offers assistance when you are trying to determine the proper command
and syntax. To use it, press the question mark (?) key. For example, you know that
the command that you want to use starts with sh, but you are not sure what the rest
of the command is. Enter sh? and you are presented with every command that starts
with sh and that you can use in the current privilege mode. You can also use
context-sensitive help to figure out the syntax for a command.
Another use of the context-sensitive help is to get a list of available commands
for the current CLI mode. This list can be used when you are unsure of the name of
a command or you want to see if Cisco IOS Software supports a particular command in
a particular mode. To use context-sensitive help in this way, enter the question
mark (?) at any prompt.
The other type of the CLI keyboard help is the error messages. When you enter a
command in the CLI, the syntax is checked. If it is not correct, you receive an
error that states "Invalid input detected at '^' marker." In addition to the
message, the caret symbol (^) is added below the place in the command at which the
error was detected. Basically, Cisco IOS Software is saying "I understood what you
typed up to this point."
You may also receive an error message for an ambiguous command. This type of error
occurs when you use an abbreviation for a command and the abbreviation results in
multiple matches. In Cisco IOS Software, when you type enough letters that match
only one command, you may press the Enter key. Because there is no other command
that starts with those letters, Cisco IOS Software executes the command. For
example, assume that there are several commands that start with the letter "c" but
only one command that begins with "clo." If you press Enter after entering only c,
you receive an "ambiguous command" error message. However, if you enter clo and
press Enter, you do not receive a message that the command is ambiguous because the
clock command is the only command that starts with those three letters. However,
you would receive an "incomplete command" error message because clock is not a
complete command. This message means that you did not enter enough information for
Cisco IOS Software to understand what you were requesting.
This functionality may vary across Cisco IOS platforms.
The question mark is your friend when you are using the CLI. It is impossible to
remember the syntax for every Cisco IOS command, so be sure to use this tool.
Type of CLI Help Description
Context-sensitive help Provides a list of commands and the arguments that are
associated with a specific command.
Console error message Identifies problems with commands that you have incorrectly
entered so that you can alter or correct them.
How to utilize context-sensitive help?

Word Help
To get word help, enter a character sequence followed immediately by a
question mark. Do not include a space before the question mark. The device then
displays a list of commands that start with the characters that you entered.
Command Syntax Help
To get command syntax help, enter a question mark after a command name in
place of a keyword or argument. Include a space before the question mark. For
example, enter show ? to get a list of the command options that the show command
supports. The network device then displays a list of available command options,
with standing for carriage return. You can access command syntax help after any
command or command option to help you determine what you can or should enter next.

Step 3: List only the commands that start with the letter "s" by entering s? on the
command line.
SW2# s?
*s=show
sdlc send set setup
show slip spec-file ssh
start-chat systat
The output shows that there is an exception to normal command parsing rules. The
CLI will interpret the letter "s" all by itself as "show". This feature is specific
to the device and operating system version. While it will work on SW2, it may not
work on all devices. Abbreviating "show" with the characters "sh" is going to be
effective more consistently across IOS devices.
Step 4: Try out the tab completion feature.
Like command abbreviation, tab completion works as long as you have entered enough
characters to remove ambiguity. Type sh and then press the tab key.
The CLI parser expands the unambiguous abbreviation into the full command.
SW2# sh
SW2# show
Step 5: You might find tab completion helpful because it prevents you from
attempting to use command abbreviation and accidentally abbreviate too much.
If there are multiple matches for the abbreviation, tab completion will not work.
If you are not sure why, you can always use the question mark (?) at that point.
Demonstrate this example by attempting to abbreviate the configure command with
"con".
When you tried to use the tab to complete the abbreviation "con," it did not work.
The command parser simply redisplayed "con". Using the question mark (?) at that
point shows that there are two commands that begin with "con". To be unambiguous,
you must use at least "conf" as your abbreviation for configure.
SW2# con
SW2# con?
configure connect
SW2# con
Step 6: You will not go into the configuration mode during this session. Use the
Backspace key to delete the "con" that is currently on the CLI input line.
Step 7: You have just demonstrated that the question mark (?) and tab completion
work for commands.
They are also helpful for arguments to commands. For example, if you want to
display all the arguments that you can use with the show command, use the question
mark (?) and separate it from the show command by a space.
SW2# show ?
aaa Show AAA values
access-expression List access expression
<... output omitted ...>
--More
<... output omitted ...>
There are a lot of show commands. To scroll through the entire list you have to
press the space bar nine times.
Step 8: Just like with commands, you can combine some explicit characters followed
by the question mark to display a subset of the argument options.
For example, use show r? to display all the show command options that start with
the letter "r".
SW2# show r?
radius region registry reload
resource rhosts rib rif
route-map route-tag running-config
Step 9: Experiment with command abbreviation and tab completion in creative ways,
until you feel you are comfortable using them.
You can see one example for show running-config, but still, feel free to experiment
independently.
SW2# sh
SW2# show run
SW2# show running-config
Building configuration...

Current configuration : 865 bytes


!
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
<... output omitted ...>
You may also find tab completion useful if you are working with someone else. If
you are typing at the CLI, you may understand some command abbreviations that your
partner does not. Using command completion allows your partner to see the entire
command verbiage.
CLI Error Messages
You did not enter enough characters.
SW1# c
% Ambiguous command:'c'
Required arguments or keywords were omitted at the end of the command.
SW1# clock set
% Incomplete command
SW1# clock set 19:50:00
% Incomplete command
The caret (^) indicates the place where the command interpreter cannot decipher the
command.
SW1# clock set 19:50:00 25 6
^
% Invalid input detected at "^" marker
Use the ? command to correctly set system clock.
SW1# clock set 19:50:00 25 6 ?
% Unrecognized command
SW1# clock set 19:50:00 25 Jun
% Incomplete command.

SW1# clock set 19:50:00 25 Jun ?


<1993-2035> Year

SW1# clock set 19:50:00 25 Jun 2015 ?

SW1# clock set 19:50:00 25 Jun 2015


SW1#
*Jun 26 03:50:00.000: %SYS-6-CLOCKUPDATE: System clock has been updated from
04:33:42 PST Wed Oct 7 2015 to 19:50:00 PST Thu Jun 25 2015, configured from
console by console.
There are three types of console error messages:

Ambiguous command
Incomplete command
Incorrect command

Error Message Meaning How to Get Help


% Ambiguous command: "show con" You did not enter enough characters for your
device to recognize the command. Re-enter the command, followed by ? without a
space before it.The CLI displays possible keywords that you can enter with the
command.
% Incomplete command You did not enter all the keywords or values that are
required by this command. Re-enter the command, followed by ? with a space
before it.
% Invalid input detected at ^ marker You entered the command incorrectly. The
^ marks the point of the error. Enter ? to display all the commands or
parameters that you can use.
The command history buffer stores the commands that have been most recently
entered. To see these commands, enter the Cisco IOS show history command.
You can use context-sensitive help to determine the syntax of a particular command.
For example, if the device clock needs to be set but you are not sure of the clock
command syntax, the context-sensitive help provides a means to check the syntax.
Context-sensitive help supplies the whole command even if you enter just the first
part of the command, such as cl?.
If you enter the command clock but an error message is displayed, indicating that
the command is incomplete, enter the ? command (preceded by a space) to determine
which arguments are required for the command. In the clock ? example, the help
output shows that the keyword set is required after clock.
If you now enter the command clock set but another error message appears,
indicating that the command is still incomplete, press the Up Arrow key to repeat
the command entry. Then, add a space and enter the question mark (?) to display a
list of arguments that you can use for the command.
The example shows that after the last command recall, the administrator used the ?
to reveal additional arguments, which involve entering the current time using
correct form of month and year..
The figure continues to illustrate how to set the device clock.
If after entering the current time you still see the Cisco IOS Software error
message indicating that the command that you have entered is incomplete, recall the
command, add a space, and enter the ? command to display a list of arguments that
are available for the command. In this example, enter the day, month, and year
using the correct syntax. Then press Enter to execute the command.
Syntax checking uses the caret symbol (^) as an error-location indicator. It
appears at the point in the command string where the user has entered an incorrect
command, keyword, or argument. The error-location indicator and interactive help
system provide a way to easily find and correct syntax errors. In the clock
example, the caret symbol indicates that the month was entered incorrectly as a
number. The parser is expecting the month to be spelled out.
Task 3: Manage Cisco IOS Configuration
Now you will go through the startup and running configurations on a Cisco IOS
device. The lab is prepared with the devices that are represented in the topology,
but for this session you will only be using SW2. In the end, you will erase the
configuration on SW2. Do not worry, though. The lab system will return the
configurations the next time the lab is initialized.
The prompt displays the hostname that is configured on the device. You will modify
this component of the switch configuration as you experiment with the startup and
running configurations.
Activity
Step 1: On SW2, enter the global configuration mode and change the hostname of the
switch to "Temp" and return to privileged EXEC.
Immediately after you change the hostname setting on the switch, the system prompt
reflects the new name.
SW2# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)# hostname Temp
Temp(config)# end
Temp#
You just modified the running configuration on the switch. The startup
configuration has not changed.
Step 2: Display the running configuration that is parsed through the include
filter, showing only the lines that include the string "hostname".
The use of tab completion and the question mark is intended to remind you that
these options are always available to you. They will not be demonstrated any
further in this session, but feel free to take advantage of them at any time.
Temp# sh
Temp# show r?
radius region registry reload
resource rhosts rib rif
route-map route-tag running-config

Temp# show run


Temp# show running-config | inc
Temp# show running-config | include hostname
hostname Temp
Tab completion was available for show and running-config and include, but not for
hostname, because hostname is a freeform variable. It can be any string. There is
no way for the Cisco IOS parser to guess what you want that string to be.
The one line in the configuration that includes the string hostname is the hostname
command setting the hostname to "Temp."
Managing Cisco IOS Configuration
When a switch or a router starts, it looks for a configuration file in the NVRAM of
the device. NVRAM is the memory in the device that retains information even when
the device is powered down. The configuration file that is stored in NVRAM is
called the startup-config file. If there is no startup-config file in NVRAM, the
router or switch enters the setup utility and loads a blank configuration. The
setup utility prompts you at the console for specific configuration information to
create a basic initial configuration on the router or switch. You can also
interrupt the setup utility and start configuring the device manually.
Once the device has started, the system copies the startup configuration to RAM.
The configuration file in RAM is called the running-config file. As you make
additional configurations, the system stores them in the running configuration. It
is important to understand that RAM does not retain its information when the device
is powered off or rebooted. If a change is made to the running configuration, it
must be copied to the startup configuration, which is stored in the NVRAM, for it
to be retained after a reboot.
In addition to NVRAM and RAM, Cisco devices have a third type of memory, called
flash memory. Flash memory is similar to a hard drive in that the information that
the system stores there is retained even when the device is powered off. Cisco IOS
Software is stored in flash memory. Flash memory may also store backup
configuration files and additional device-supported files.
To view the configuration files, use the show command followed by the name of the
file. For example, if you want to view the configuration that is stored in RAM,
type show running-config. To save the running configuration, copy it to NVRAM. To
do so, use the copy command followed by the names of the source and destination
files. The complete command is copy running-config startup-config. Review the table
for additional commonly used Cisco IOS commands.
Common IOS Management Command Function
show running-config Displays the current running configuration. You can also
use filters. For example, you can use the show running-config interface
GigabitEthernet0/1 command to display only the interface GigabitEthernet0/1 running
configuration.
show startup-config Displays the saved configuration in NVRAM.
configure terminal Enters the configuration mode, where you can interactively
create configurations in RAM from the console or remote terminal.
copy running-config startup-config Saves the running configuration to NVRAM.
copy startup-config running-config Startup configuration in NVRAM is merged into
running configuration.
erase startup-config Deletes the saved startup-config file in NVRAM.
You can also use the copy command to copy configuration files and Cisco IOS
Software files from a switch or a router to a server (or vice versa) using FTP,
SCP, HTTP, TFTP, and other protocols. For example, in the copy running-config tftp:
command, the system copies the running configuration in RAM to a TFTP server. You
must supply the IP address or name of the TFTP server and a destination filename.
During the copying process, a series of exclamation marks show the progress of the
upload.
Copying configuration files from a switch or a router to a server is useful for
backing up the configuration files and for centralized management purposes.
Regardless of the size of the network, there should always be a copy of the current
running configuration online as a backup.
Copying configuration files from an external server to the running configuration in
RAM or to the startup configuration file in NVRAM of the router or switch is useful
for restoring backups. You should copy the files to a device other than the one
that they were created on.
When you copy a configuration into RAM from any source, the configuration merges
with the existing configuration in RAM. New configuration parameters are added, and
changes to existing parameters overwrite the old parameters. Configuration commands
in RAM for which there is no corresponding command in NVRAM remain unaffected.
Step 3: Now display the startup configuration that is parsed through the include
filter, showing only the lines that include the string "hostname".
When you make changes to the running configuration, it does not affect the startup
configuration. The startup configuration still has SW2 configured as the hostname.
Temp# show startup-config | include hostname
hostname SW2
Step 4: Use the reload command which will reboot the switch. This action will cause
the switch to throw away the running configuration and read the startup
configuration from scratch.
Answer no to the query about saving the modified configuration. The goal is to
demonstrate how to return to the old configuration. If you save the modified
configuration, the system will overwrite the old configuration.
After the reload, as indicated by the system prompt, the hostname has returned to
SW2.
Temp# reload

System configuration has been modified. Save? [yes/no]: no


Proceed with reload? [confirm]
<... output omitted ...>
Press RETURN to get started!
<... output omitted ...>
SW2>
To make changes to the running configuration permanent, you have to save the
running configuration over the startup configuration.
Step 5: Change the hostname one more time.
This time, set the hostname to "ThisWillStick."
SW2> enable
SW2# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)# hostname ThisWillStick
ThisWillStick(config)# end
ThisWillStick#
Step 6: Copy the running configuration over the startup configuration.
ThisWillStick# copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
Compressed configuration from 936 bytes to 641 bytes[OK]
ThisWillStick#
After this copy operation, the change to the hostname is reflected in the startup
configuration and will now be able to survive a reload event.
Optionally, you can use the show startup-configuration command to verify that the
change is reflected there.
Step 7: Use the reload command again, and verify that the new hostname setting is
still in place after the reboot event.
ThisWillStick# reload
Proceed with reload? [confirm]
<... output omitted ...>
Press RETURN to get started!
<... output omitted ...>
ThisWillStick>
The hostname does, indeed, remain as ThisWillStick.
Step 8: Now erase the startup configuration with the erase startup-config command.
ThisWillStick> enable
ThisWillStick# erase startup-config
Erasing the nvram filesystem will remove all configuration files! Continue?
[confirm]
[OK]
Erase of nvram: complete
*Jul 6 08:40:12.990: %SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
ThisWillStick#
Even though the system erased the startup configuration, this action does not have
an effect on the running configuration. In fact, (do not do this now) you could use
the copy running-config startup-config command now to put the startup configuration
back to the way it was.
Step 9: Verify that the system actually erased the startup configuration using show
startup-config.
ThisWillStick# show startup-config
startup-config is not present
Step 10: Reload the switch.
Understand that the switch will attempt to read the startup configuration and find
it missing. This situation will essentially set the switch back to the factory
default state. Do not worry, when the lab is reinitialized, the lab system will set
all device configurations appropriately.
ThisWillStick# reload
Proceed with reload? [confirm]
<... output omitted ...>
Press RETURN to get started!
Switch>
Step 11: Verify that the hostname setting in the running configuration is the
default value (Switch).
Switch> enable
Switch# show running-config | include hostname
hostname Switch
Switch#
Task 4: Improve User Experience in CLI
In this session, you will be able to practice using terminal history. Recalling
previous commands is useful simply to reduce typing. When you recall a command, you
can simply press Enter to use the exact same command, or you can edit it to suit
your new purpose. The lab is prepared with the devices that are represented in the
topology, but for this session you will only be using R1.
The prompt displays the hostname that is configured on the device. You will modify
this component of the router configuration as you experiment with the startup and
running configurations.
Activity
Step 1: On R1, use the enable command to access the privileged EXEC.
R1> enable
R1#
Step 2: Enter the sequence of commands that are shown below.
The sequence is rather arbitrary. The selection criteria were to include three EXEC
commands and two configuration mode commands. Do not be concerned if the commands
are new to you. This part will simply give you a little bit of data in the terminal
history.

show ip route (in privileged EXEC mode)


show clock (in privileged EXEC mode)
show ip interface brief (in privileged EXEC mode)
configure terminal (to go in global configuration mode)
clock timezone EST 0 (in global configuration mode)
no ip domain-lookup (in global configuration mode)

R1# show ip route


Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
+ - replicated route, % - next hop override

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks


C 10.10.1.0/24 is directly connected, Ethernet0/0
L 10.10.1.1/32 is directly connected, Ethernet0/0
C 10.10.3.0/24 is directly connected, Loopback0
L 10.10.3.1/32 is directly connected, Loopback0
R1# show clock
*00:47:02.857 PST Mon Jul 6 2015
R1# show ip interface brief
Interface IP-Address OK? Method Status
Protocol
Ethernet0/0 10.10.1.1 YES NVRAM up up

Ethernet0/1 unassigned YES NVRAM administratively down down

Ethernet0/2 unassigned YES NVRAM administratively down down

Ethernet0/3 unassigned YES NVRAM administratively down down

Serial1/0 unassigned YES NVRAM administratively down down

Serial1/1 unassigned YES NVRAM administratively down down

Serial1/2 unassigned YES NVRAM administratively down down

Serial1/3 unassigned YES NVRAM administratively down down

Loopback0 10.10.3.1 YES NVRAM up up


R1# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)# clock timezone EST 0
*Jul 6 08:48:41.931: %SYS-6-CLOCKUPDATE: System clock has been updated from
00:48:41 PST Mon Jul 6 2015 to 08:48:41 EST Mon Jul 6 2015, configured from console
by console.
R1(config)# no ip domain-lookup
Improving User Experience in CLI
The Cisco IOS CLI includes many features that make the configuration process easier
and faster. These features include command-line editing keys, command history, and
filtering parameters.
Command-Line Editing Keys
Command-line editing keys are shortcuts and hot keys that the CLI provides. Use
these shortcuts and hot keys to move the cursor around on the command line for
corrections or changes. Use them also to make configuring, monitoring, and
troubleshooting easier. The table describes each of the shortcuts for command-line
editing and controlling command entry.
Command-Line Editing Key Sequence Description
Ctrl-A Moves the cursor to the beginning of the command line
Ctrl-C Aborts the current command and exits the configuration mode
Ctrl-E Moves the cursor to the end of the command line
Esc-B Moves the cursor back one word
Esc-F Moves the cursor forward one word
Ctrl-B Moves the cursor back one character
Ctrl-F Moves the cursor forward one character
Ctrl-D Deletes a single character at the cursor
Backspace Removes one character to the left of the cursor
Ctrl-P Redisplays the current command line
Ctrl-U Erases a line
Ctrl-W Erases a word to the left of the cursor
Ctrl-Z Ends configuration mode and returns to the EXEC prompt
Tab Completes a partially entered command if enough characters have been entered
to make it unambiguous
Ctrl-Shift-6 Allows the user to interrupt a Cisco IOS process such as ping or
traceroute
Ctrl-P or Up Arrow Recalls last (previous) commands
Ctrl-N or Down Arrow Recalls more recent commands
The Esc key is not functional on all terminals.
Command History
The Cisco CLI provides a history or record of commands that users have entered. You
will find this feature, which is called the command history, particularly useful in
helping you to recall long or complex commands or entries.
With the command history feature, you can complete the following tasks:

Display the contents of the command buffer: By default, command history is


enabled, and the system records the last 10 command lines in its history buffer.
Set the command history buffer size: To change the number of command lines that
the system will record during the current terminal session only, use the terminal
history command in user EXEC mode.
Recall previously entered commands that are stored in the history buffer: There
is a buffer for EXEC mode and another buffer for the configuration mode. To recall
commands in the history buffer, press Ctrl-P or the Up Arrow key. The command
output begins with the most recent command. Repeat the key sequence to recall
successively older commands.
To return to more recent commands in the history buffer (after recalling older
commands with Ctrl-P or the Up Arrow key), press Ctrl-N, or the Down Arrow key.
Repeat the key sequence to recall successively more recent commands.
On most computers, there are additional select and copy functions available.
Copy a previous command string, then paste or insert it as the current command
entry, and press Enter.
When you use show commands such as show running-config, Cisco IOS Software
automatically pauses when displaying the output after a specified number of lines.
The process of displaying the output pauses, and Cisco IOS Software displays "--
More--." It then waits for user input to continue with the display process. You can
press the Spacebar key to display another set of subsequent lines or press Enter to
display a single line.
Set the number of lines on the current terminal screen: You can use the
terminal length command, followed by a number, to control the number of lines that
the CLI displays without pausing during the output. A value of zero prevents the
router from pausing between screens of output. By default, the value is set to 24.

Step 3: Now, while remaining in the configuration mode, use the Up Arrow and Down
Arrow keys to scroll through the terminal history buffer.
Note that you do not see the EXEC commands. There is a separate terminal history
buffer for configuration and EXEC modes.
Step 4: Leave the configuration mode (use end, exit, or press Ctrl-Z) to return to
privileged EXEC.
Step 5: Again use the Up Arrow and Down Arrow keys to show that you can recall
previous commands.
Step 6: Recall the show ip route command and then press the Enter key to resubmit
it without any edits.
It is a common exercise to revisit show commands that display operational status as
you make changes to the configurations on IOS devices and their neighbors.
Step 7: Now, type the following command, purposely mistyping "show" as "snow."
R1# snow ip interface brief
^
% Invalid input detected at '^' marker.
Everyone makes typographical errors. Dealing with them is one of the best uses of
the terminal history and the command line editing tools.
Step 8: Follow this sequence to quickly and easily correct the typographical error
and resubmit the corrected command:

Press the Up Arrow key once to retrieve the previous command.


Press Ctrl-A to move the cursor to the beginning of the line.
Press the Right Arrow twice to move the cursor to the right of the incorrect
letter "n."
Press Backspace to erase the letter "n."
Press h to insert the correct letter "h."
Press Enter to resubmit the corrected command.

Step 9: Return to the global configuration mode.


R1# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#
As before, you will be using commands that you are not familiar with to facilitate
the demonstration of the power of the terminal history buffer. Do not concern
yourself with commands themselves. Instead, focus on how beneficial the terminal
history buffer can be.
Step 10: Configure the description of interface Serial 1/0 and enable the interface
by overriding the default shutdown command.
R1(config)# interface Serial 1/0
R1(config-if)# description Link to SP1
R1(config-if)# no shutdown
*Jul 6 08:51:13.776: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Jul 6 08:51:14.780: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
changed state to up
R1(config-if)#
Step 11: Repeat a very similar configuration for interface Serial 1/1.
The following process can make this task relatively easy:

Press the Up Arrow key three times to recall the interface command. Edit the
1/0 to be 1/1 and press the Enter key to resubmit the edited command.
Press the Up Arrow key three times, to recall the description command, edit the
SP1 to be SP2 and press the Enter key to resubmit the edited command.
Press the Up Arrow key three times, to recall the no shutdown command, and
press the Enter key to resubmit the command without any editing.
The resulting sequence should look like the following example:
R1(config)# interface Serial 1/1
R1(config-if)# description Link to SP2
R1(config-if)# no shutdown
*Jul 6 09:02:22.638: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
*Jul 6 09:02:23.642: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1,
changed state to up
R1(config-if)#
Step 12: Leave the configuration mode by using end, exit (2 times), or pressing
Ctrl-Z to return to privileged EXEC.
Optionally, you can save the running configuration to the startup configuration,
but it is not necessary in the automated lab environment.
Filtering Parameters
Another useful feature that improves the user experience in the CLI is the
filtering of show outputs. Using filtering, you can display only the parts of show
outputs that you are interested in. You can filter outputs by typing the pipe (|)
character after a show command, followed by a filtering parameter and a filtering
expression. The table describes filtering parameters that are available for output
filtering.
Parameter Description
begin Shows all output lines, starting with the line that matches the filtering
expression
exclude Excludes all output lines that match the filtering expression
include Includes all output lines that match the filtering expression
section Shows the entire section that starts with the filtering expression
Step 13: On the R1 router use begin and include options with show running-config
command and filtering expression interface.
You should see following output when using begin option:
R1# show running-config | begin interface
interface Loopback0
ip address 10.10.3.1 255.255.255.0
!
interface Ethernet0/0
description Link to SW2
ip address 10.10.1.1 255.255.255.0
!
interface Ethernet0/1
no ip address
shutdown
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
no ip address
shutdown
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
!
!
!
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input all
!
!
end
You should see following output when using include option:
R1# show running-config | include interface
interface Loopback0
interface Ethernet0/0
interface Ethernet0/1
interface Ethernet0/2
interface Ethernet0/3
interface Serial1/0
interface Serial1/1
interface Serial1/2
interface Serial1/3
Step 14: On the R1 router use section option with show running-config command and
filtering expression interface.
You should see following output when using section option:
R1# show running-config | section interface
interface Loopback0
ip address 10.10.3.1 255.255.255.0
interface Ethernet0/0
description Link to SW2
ip address 10.10.1.1 255.255.255.0
interface Ethernet0/1
no ip address
shutdown
interface Ethernet0/2
no ip address
shutdown
interface Ethernet0/3
no ip address
shutdown
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
Step 15: On the R1 router use exclude option with show running-config command and
filtering expression !.
You should see following output when using exclude option:
R1# show running-config | exclude !
Building configuration...

Current configuration : 1223 bytes


version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
hostname R1
boot-start-marker
boot-end-marker
no aaa new-model
clock timezone PST -8 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180

no ip domain lookup
ip cef
no ipv6 cef
multilink bundle-name authenticated
redundancy
interface Loopback0
ip address 10.10.3.1 255.255.255.0
interface Ethernet0/0
description Link to SW2
ip address 10.10.1.1 255.255.255.0
interface Ethernet0/1
no ip address
shutdown
interface Ethernet0/2
no ip address
shutdown
interface Ethernet0/3
no ip address
shutdown
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
ip forward-protocol nd
no ip http server
no ip http secure-server
control-plane
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input all
end
2016 Cisco Systems, Inc.

You might also like