514.configuring Ios
514.configuring Ios
You must understand how to configure a Cisco router to succeed on the exam—or to succeed
in supporting Cisco routers. This section covers the basic configuration processes, including the
concept of a configuration file and the locations in which the configuration files can be stored.
As mentioned in Chapter 1, configuration mode is another mode for the Cisco CLI, similar to
user mode and privileged mode. User mode allows commands that are not disruptive to be
issued, with some information being displayed to the user. Privileged mode supports a superset
of commands compared to user mode, including commands that might harm the router.
However, none of the commands in user or privileged mode changes the configuration of the
router. Configuration mode is another mode in which configuration commands are typed.
Figure 2-5 illustrates the relationships among configuration mode, user exec mode, and
privileged exec mode.
Ctrl-Z config t
or
exit
Each command
RAM Configuration
(Active config) mode
in succession
Commands typed in configuration mode update the active configuration file. These changes to
the configuration occur immediately each time you press the Enter key at the end of a command.
Be careful when you type in a configuration command!
Configuration mode itself contains a multitude of subcommand modes. Context-setting
commands move you from one configuration subcommand mode to another. These context-
setting commands tell the router the topic about which you will type the next few configuration
commands. More importantly, they tell the router what commands to list when you ask for help.
02 CCNA Exam_Ch 02.fm Page 40 Thursday, March 7, 2002 11:44 AM
After all, the whole reason for these contexts is to make online help more convenient and clear
for you. So, if you are confused now, hang on—the next sample will clarify what I mean.
NOTE Context setting is not a Cisco term—it’s just a term used here to help make sense of
configuration mode.
The interface command is the most commonly used context-setting configuration command.
As an example, the CLI user could enter interface configuration mode after typing the interface
ethernet 0 configuration command. Command help in Ethernet interface configuration mode
displays only commands that are useful when configuring Ethernet interfaces. Commands used
in this context are called subcommands—or, in this specific case, interface subcommands. If
you have significant experience using the CLI in configuration mode, much of this will be
second nature. From a CCNA exam perspective, recalling whether popular commands are
global commands or subcommands will be useful, but you should really focus on the particular
commands covered here. As a side effect, you will learn whether the commands are global
configuration commands or subcommands.
No set rules exist for what commands are global commands or subcommands. Generally,
however, when multiple instances of a parameter can be set in a single router, the command
used to set the parameter is likely a configuration subcommand. Items that are set once for the
entire router are likely global commands. For instance, the hostname command is a global
command because there is only one host name per router. The interface ethernet 0 command
is a global configuration command because there is only one such interface in this router.
Finally, the ip address command is an interface subcommand that sets the IP address on the
interface; each interface will have a different IP address.
Use Ctrl-z from any part of configuration mode (or use the exit command from global
configuration mode) to exit configuration mode and return to privileged exec mode. The
configuration mode end command also exits from any point in the configuration mode back to
privileged exec mode. The exit commands from submodes or contexts of configuration mode
back up one level toward global configuration mode.
Password:
Router>enable
Password:
Router #configure terminal
Router(config)#enable password lu
Router(config)#line console 0
Router(config-line)#login
Router(config-line)#password cisco
Router(config-line)#hostname Critter
Critter(config)#prompt Emma
Emma(config)#interface serial 1
Emma(config-if)#description this is the link to Albuquerque
Emma(config-if)#exit
Emma(config)#exit
Emma#
Emma#show running-config
Building configuration...
Current configuration:
!
version 12.2 934 bytes
! Version of IOS on router, automatic command
continues
02 CCNA Exam_Ch 02.fm Page 42 Thursday, March 7, 2002 11:44 AM
Several differences exist between user and privileged mode, compared to configuration mode.
The configure terminal command is used to move into configuration mode. The command
prompt changes based on the configuration subcommand mode that you are in. Plus, typing a ?
in configuration mode gives you help just on configuration commands.
When you change from one configuration mode to another, the prompt changes. Example 2-2
repeats the same example as in Example 2-1, but with annotations for what is happening.
Example 2-2 Configuration Process with Annotations
User Access Verification
Password:
Router>enable
!In user mode, then you type the enable command
Password:
Router #configure terminal
!In privileged mode, using the configure terminal command to enter global
Router(config)#enable password lu
!The enable password command is a global command – so the prompt stays as a global
command prompt
Router(config)#line console 0
!line console changes the context to console line configuration mode
Router(config-line)#login
!login is a console subcommand, so the prompt remains the same
Router(config-line)#password cisco
!password is also a console sub-command
Router(config-line)#hostname Critter
!hostname is a global command, so it is used, and the mode changes back to global
config mode
Critter(config)#prompt Emma
!prompt is a global command, so the prompt stays as a global command mode prompt
Emma(config)#interface serial 1
!interface changes contexts to interface subcommand mode
Emma(config-if)#description link to Albuquerque
!description is a sub-command in interface config mode, so prompt stays the same
Emma(config-if)#exit
!exit backs up one mode towards global
Emma(config)#exit
!exit in global mode exits back to privileged mode
02 CCNA Exam_Ch 02.fm Page 43 Thursday, March 7, 2002 11:44 AM
The processors in the routers vary from model to model. Although knowledge of them is not
specifically listed as a requirement for the CCNA exam, some reference to terminology is
useful. In most routers, only one processor option is available; thus, you would not order a
specific processor type or card. The exception to this is the 7200 and 7500 families of routers.
For instance, on the 7500 series, you choose either a Route Switch Processor 1 (RSP-1), RSP-
2, or RSP-4 processor. In any case, all 7200 and 7500 routers, as well as most of the other Cisco
router families, run IOS. This commonality enables Cisco to formulate exams, such as CCNA,
that cover the IOS features without having to cover many hardware details.
The terminology used to describe the physical interfaces used for routing packets and bridging
frames varies based on the model of router. Also, the types of interfaces available change over
time because of new technology. For example, Packet over SONET and voice interfaces are
relatively recent additions to the product line. However, some confusion exists about what to
call the actual cards that house the physical interfaces. Table 2-5 summarizes the terminology
that might be referred to on the test.
02 CCNA Exam_Ch 02.fm Page 44 Thursday, March 7, 2002 11:44 AM
But there is hope! Cisco IOS Software always uses the term interfaces rather than any of the
other terms, so IOS commands familiar on one platform will be familiar on another. Some
nuances are involved in numbering the interfaces, however. In some smaller routers, the
interface number is a single number. However, with some other families of routers, the interface
is numbered first with the slot in which the card resides, followed by a slash and then the port
number on that card. For example, port 3 on the card in slot 2 would be interface 2/3.
Numbering starts with 0 for card slots and 0 for ports on any card. In some cases, the interface
is defined by three numbers: first the card slot, then the daughter card (typically called a port
adapter), and then a number for the physical interface on the port adapter. The 2600 and 3600
families also use a slot/port numbering scheme.
In this book, the single-digit interface numbers are used simply for consistency and readability.
If you want to dig deeper, you might want to read about processors and interfaces in the Cisco
Product Catalog (http://www.cisco.com/univercd/cc/td/doc/pcat/).
hannah#show startup-config
… (lines omitted)
hostname hannah
… (rest of lines omitted)
hannah#configure terminal
hannah(config)#hostname jessie
jessie(config)#exit
jessie#show running-config
… (lines omitted)
hostname jessie
… (rest of lines omitted – notice that the running configuration reflects the
changed hostname)
jessie# show startup-config
… (lines omitted)
hostname hannah
… (rest of lines omitted – notice that the changed configuration is not shown
in the startup config)
If you reload the router now, the host name would revert back to hannah. However, if you want
to keep the changed host name of jessie, you would use the command copy running-config
startup-config, which overwrites the current startup-config file with what is currently in the
running configuration file.
The copy command can be used to copy files in a router, most typically a configuration file, or
a new version of the IOS Software. The most basic method for moving configuration files in
and out of a router is by using a TFTP server. The copy command is used to move configuration
files among RAM, NVRAM, and a TFTP server. The files can be copied between any pair, as
Figure 2-7 illustrates.
Figure 2-7 Locations for Copying and Results from Copy Operations
RAM NVRAM
TFTP
copy running-config tftp copy startup-config running-config
The first parameter is the “from” location; the next one is the “to” location. (Of course, choosing
the same option for both parameters is not allowed.)
The copy command does not always replace the existing file that it is copying. Any copy
command option moving a file into NVRAM or a TFTP server replaces the existing file—that’s
the easy, straightforward action. Effectively, any copy into RAM works just as if you typed the
commands in the “from” configuration file in the order listed in the config file.
So, who cares? Well, we do. If you change the running config and then decide that you want to
revert to what’s in the startup-config file, the only way to guarantee that is to issue the reload
command, which reloads, or reboots, the router.
Two key commands can be used to erase the contents of NVRAM. The write erase command
is the older command, and the erase startup-config command is the newer command. Both
simply erase the contents of the NVRAM configuration file. Of course, if the router is reloaded
at this point, there will be no initial configuration.
RAM show ru
rm nning-c
write te (active) onfig
show onfig
config tartup-c
show s
old NVRAM new
NOTE If you plan to work with Cisco routers much, you should become accustomed with the CLI
configuration mode discussed earlier. Setup mode allows only basic configuration. Both topics
are covered on the CCNA exam.
Figure 2-9 and Example 2-4 describe the process used by setup mode. Setup mode is most
frequently used when the router boots, and it has no configuration in NVRAM. Setup mode also
can be entered by using the setup command from privileged mode.
Turn on router
Yes
Do you
want to No Complete IOS
enter setup initialization
mode?
Yes
Move new
Answer the questions configuration
in setup mode into NVRAM
Example 2-4 shows a screen capture of using setup mode after booting a router with no
configuration in NVRAM.
Example 2-4 Router Setup Configuration Mode
--- System Configuration Dialog ---
Would you like to enter the initial configuration dialog? [yes/no]: yes
At any point you may enter a question mark '?' for help.
Use ctrl-c to abort configuration dialog at any prompt.
Default settings are in square brackets '[]'.Basic management setup configures
only enough connectivity
continues
02 CCNA Exam_Ch 02.fm Page 48 Thursday, March 7, 2002 11:44 AM
Enter host name [Router]: R1 The enable secret is a password used to protect
access to
privileged EXEC and configuration modes. This password, after
entered, becomes encrypted in the configuration.
Enter enable secret: cisco
The enable password is used when you do not specify an
enable secret password, with some older software versions, and
some boot images.
Enter enable password: fred
The virtual terminal password is used to protect
access to the router over a network interface.
Enter virtual terminal password: barney
Configure SNMP Network Management? [yes]: no
Configure bridging? [no]:
Configure DECnet? [no]:
Configure AppleTalk? [no]:
Configure IPX? [no]:
Configure IP? [yes]:
Configure IGRP routing? [yes]:
Your IGRP autonomous system number [1]:
Configuring interface parameters:
Do you want to configure Ethernet0 interface? [yes]:
Configure IP on this interface? [yes]:
IP address for this interface: 172.16.1.1
Subnet mask for this interface [255.255.0.0] : 255.255.255.0
Class B network is 172.16.0.0, 24 subnet bits; mask is /24
Do you want to configure Serial0 interface? [yes]:
Configure IP on this interface? [yes]:
Configure IP unnumbered on this interface? [no]:
IP address for this interface: 172.16.12.1
Subnet mask for this interface [255.255.0.0] : 255.255.255.0
Class B network is 172.16.0.0, 24 subnet bits; mask is /24
Do you want to configure Serial1 interface? [yes]:
Configure IP on this interface? [yes]:
Configure IP unnumbered on this interface? [no]:
IP address for this interface: 172.16.13.1
Subnet mask for this interface [255.255.0.0] : 255.255.255.0
Class B network is 172.16.0.0, 24 subnet bits; mask is /24
02 CCNA Exam_Ch 02.fm Page 49 Thursday, March 7, 2002 11:44 AM
hostname R1
enable secret 5 $1$VOLh$pkIe0Xjx2sgjgZ/Y6Gt1s.
enable password fred
line vty 0 4
password barney
no snmp-server
!
no bridge 1
no decnet routing
no appletalk routing
no ipx routing
ip routing
!
interface Ethernet0
ip address 172.16.1.1 255.255.255.0
no mop enabled
!
interface Serial0
ip address 172.16.12.1 255.255.255.0
no mop enabled
!
interface Serial1
ip address 172.16.13.1 255.255.255.0
no mop enabled
dialer-list 1 protocol ip permit
dialer-list 1 protocol ipx permit
!
router igrp 1
redistribute connected
network 172.16.0.0
!
end
Setup behaves like Example 2-2 illustrates, whether setup was reached by booting with an
empty NVRAM or whether the setup privileged exec command was used. First, the router asks
whether you want to enter the “initial configuration dialog.” Answering y or yes puts you in
setup mode.
02 CCNA Exam_Ch 02.fm Page 50 Thursday, March 7, 2002 11:44 AM
When you are finished with setup, you select one of three options for what to do next. Option
2 tells the router to save the configuration to NVRAM and exit; this option is used in Example
2-4. The router places the config in both NVRAM and RAM. This is the only operation in the
IOS that changes both configuration files to include the same contents based on a single action
by the user. Options 0 and 1 tell the router to ignore the configuration that you just entered and
to either exit to the command prompt (option 1) or start over gain with setup (option 1).
50 List the commands to load Cisco IOS Software from: Flash memory, a TFTP
server, or ROM.
51 Prepare to back up, upgrade, and load a backup Cisco IOS Software
image.
Engineers need to know how to upgrade the IOS to move to a later release. Typically, a router
has one IOS image in Flash memory, and that is the IOS that is used. (The term IOS image
simply refers to a file containing the IOS.) The upgrade process might include steps such as
copying a newer IOS image into Flash memory, configuring the router to tell it which IOS
image to use, and deleting the old one when you are confident that the new release works well.
A router decides what IOS image to use when the router boots. Also, to upgrade to a new IOS
or back out to an older IOS, you must reload the router. So, it’s a convenient time to cover the
boot sequence and some of the related issues.
Finally, password recovery is covered in this section. Password recovery is less likely to be on
the CCNA exam than some other topics, but, guess what—it requires a reboot of the router, so
now is a good time to cover it.