BASIC Commands of Routers
BASIC Commands of Routers
Configuration Management
Overview
Routers follow a particular order when they boot. At several points during the process, the
router makes a decision about the next step to take. This lesson describes each step in the boot
sequence.
Objectives
Upon completing this lesson, you will be able to use Cisco IOS commands to manage device
configuration files to reduce device downtime, according to best practices. This includes being
able to meet these objectives:
Describe the router boot sequence and explain how to verify that the router booted correctly
Identify the internal components of Cisco switches and routers
Learner Skills and Knowledge
To benefit fully from this lesson, you must have these prerequisite skills and knowledge:
Basic PC usage skills, including use of general office software such as Microsoft Word and
Microsoft Excel
Basic Internet usage skills
Basic e-mail usage skills
Knowledge of computer components and terminology
Knowledge of fundamental networking components
Knowledge of fundamental networking terminology
Knowledge of OSI reference model
Knowledge of LAN and WAN functions and operations
Knowledge of network media types, including twisted-pair, coaxial, and fiber-optic cables,
as well as wireless communication
Knowledge of IP address structures and classes
Outline
The lesson includes these topics:
Overview
Stages of the Router Power-On/Bootup Sequence
Internal Router Components
How a Cisco Device Locates and Loads Cisco IOS and Configuration Files
Configuration Register
Summary
Stages of the Router Power-On/Bootup
Sequence
When a router boots, it performs a series of steps: performing tests, finding and loading the
Cisco IOS software, finding and loading configurations, and finally running the IOS software.
This topic describes the sequence of events that occurs during a router bootup.
The sequence of events that occurs during the power-up, or booting, of a router is important.
Knowledge of this sequence can assist you in accomplishing operational tasks and
troubleshooting router problems.
When power is initially applied to a router, the following events occur in the order shown:
1. Power-on self test This is a series of hardware tests that verifies if all components of the
(POST). router are functional. During this test the router also determines what
hardware is present. POST executes from microcode resident in the
system ROM.
2. Load and run Bootstrap code is used to perform subsequent events such as locating
bootstrap code. the Cisco IOS software, loading it, and then running it. When the Cisco
IOS software is loaded and running, the bootstrap code is not used until
the next time the router is reloaded or power cycled.
3. Find the Cisco The bootstrap code determines where the Cisco IOS software to be run
IOS software. is located. The flash memory is the normal place to house the Cisco IOS
software image. The configuration register and configuration file
determine where the Cisco IOS software images are located and which
image file to use.
4. Load the Cisco Once the bootstrap code has found the proper image, it then loads that
IOS software. image into RAM and starts the Cisco IOS software. Some routers do not
load the Cisco IOS software image into RAM, but execute it directly from
flash memory.
5. Find the The default is to look in nonvolatile RAM (NVRAM) for a valid saved
configuration. configuration file, called startup-config.
Step Event Description
6. Load the The desired configuration for the router is loaded and executed. If no
configuration. configuration exists, the router will enter the setup utility or attempt an
AutoInstall to look for a configuration file from a Trivial File Transfer
Protocol (TFTP) server.
7. Run the The router is now running the configured Cisco IOS software.
configured Cisco
IOS software.
Internal Router Components
The major internal components of a router include the interfaces, RAM, ROM, flash memory,
NVRAM, and the configuration register. This topic describes these major internal components.
NVRAM
RAM
Configuration
Register
ROM Interfaces
Flash CPU
The major components of the router are shown in the figure. Most of these components are
hardware. Following are descriptions of each component:
RAM: Random-access (read-write) memory contains the software and data structures that
allow the router to function. The principal software running in RAM is the Cisco IOS
software image and the running configuration. The RAM also contains the routing tables
and packet buffers.
ROM: Read-only memory contains microcode for basic functions to start and maintain the
router, including bootstrap and POST. The ROM contains the ROM Monitor (ROMMON)
used for router disaster recovery functions, such as password recovery. The ROM also
contains a subset of IOS used for IOS image file recovery, such as when the IOS image file
in flash memory is erased. ROM memory is nonvolatile.
Flash memory: Flash (read/write) memory is primarily used to store the Cisco IOS
software image. Some routers run the Cisco IOS software image directly from flash
memory and do not need to transfer it to RAM. Some routers maintain a subset of the IOS
in flash memory rather than ROM. Flash memory is nonvolatile.
NVRAM: Nonvolatile random-access (read/write) memory is mainly used to store the
saved configuration file, called startup-config. NVRAM uses a built-in battery to maintain
the data when power is removed from the router.
Configuration register: The configuration register is used to control how the router boots
up. The configuration register is part of the NVRAM.
Interfaces: These are the physical connections to the external world for the router. These
interfaces include the following types, among others:
— Ethernet, Fast Ethernet, and Gigabit Ethernet
— Asynchronous and synchronous serial
— Token Ring
— Fiber Distributed Data Interface (FDDI)
— ATM
— Console and auxiliary ports
ROM Functions
ROM
Bootstrap POST
show version
The four major areas of microcode that are generally contained in ROM are the following:
Bootstrap code: The bootstrap code is used to bring the router up during initialization. It
reads the configuration register to determine how to boot, and then, if instructed to do so,
loads the Cisco IOS software from the appropriate location.
POST: The microcode used to test the basic functionality of the router hardware and
determine which components are present.
ROMMON: A low-level operating system normally used for manufacturing testing,
troubleshooting, and password recovery. In ROMMON mode, the router has no routing or
IP capabilities. This is a troubleshooting mode.
A “mini” Cisco IOS software file: A subset of the Cisco IOS software. The mini Cisco
IOS software file can load a new IOS image into flash memory and perform other
maintenance operations. Sometimes this subset of the Cisco IOS software is referred to as
the boot helper image or RXBOOT code. With the IOS subset, the router has no routing
capabilities. The router can only act as an IP host on the network so that it can request a full
IOS image from a TFTP server. Some routers, such as the Cisco 7000 series routers, can
store a full IOS image in ROM. (This feature is not available on Cisco 2500 and 2600
series routers.) Depending on the specific Cisco router platform, the components listed
above may be stored in flash memory or in bootstrap memory to allow field upgrade to
later versions.
How a Cisco Device Locates and Loads Cisco
IOS and Configuration Files
When a router boots, it searches for the IOS software image in a specific sequence: the location
specified in the configuration register, flash memory, a TFTP server, and ROM. This topic
describes the process of locating the IOS software image.
Finding the
Cisco IOS Software
show
NVRAM
startup-config
Configuration
show version Register
Console
Flash
Order of search:
Cisco 1. Checks configuration register
IOS 2. Parses config in NVRAM
Software
3. Defaults to first file in flash memory
4. Attempts to boot from network server
5. Boot helper image
6. ROMMON
The bootstrap code has the responsibility of locating the Cisco IOS software. It searches for the
image according to the following sequence:
1. Checks the boot field of the configuration register. The boot field is the lower four bits of
the configuration register, and is used to specify how the router is to boot. These bits can
point to flash memory for the Cisco IOS software image, to the saved configuration (if one
exists) for commands that tell the router how to boot, to a remote server, or they can
specify that no Cisco IOS software image is to be loaded and to just start the IOS subset
image in ROM. The configuration register bits perform other functions as well, such as
selection of console baud rate and decision whether to use the saved configuration (startup-
config) in NVRAM or not.
For example, a configuration register value of 0x2102 (the “0x” indicates that the digits
that follow are in hexadecimal notation) has a boot field value of 0x2 (the right-most digit
in the register value is 2 and represents the lower four bits of the register).
2. If the configuration register boot field value is from 0x2 to 0xF, the bootstrap code
parses any configuration in NVRAM for boot system commands that specify the name and
location of the Cisco IOS software image to load. Several boot system commands can be
entered in sequence to provide a fault-tolerant bootup plan.
The boot system command is a global configuration command that allows you to specify
the source for the Cisco IOS software image to load. Some of the syntax options available
include the following:
4. If no valid IOS image is found in flash memory, the router attempts to boot from a network
TFTP server using the boot field value as part of the IOS image filename. Booting from a
network TFTP server is a seldom-used method of loading a Cisco IOS software image. Not
every router has boot helper image, so steps 5 and 6 are not always subsequent.
5. By default, if booting from a network TFTP server fails after five tries, the router will boot
the boot helper image (the IOS subset) from ROM. You can also set bit 13 of the
configuration register to zero to tell the router to try to boot from a TFTP server
continuously without booting the IOS subset from ROM after five unsuccessful tries.
6. If there is no boot helper image or if it is corrupted, the router will boot the ROM Monitor
(ROMMON) from ROM.
Router Startup Flowchart
Check
Check Boot
Boot No System Yes Do What
Startup
Startup
START Field = 1
0x1 Config
Config Commands They
? Say
Yes No
No Valid Yes
Use
Use IOS
IOS from
from
Boot No IOS in
Flash Flash
Flash
Field = 1
0x0 ?
No
Attempt
Attempt
Yes Yes to
to Get
Get
5 Failures
IOS
IOS from
from
?
Network
Network
Run
ROM No
Monitor
Yes Yes
Config reg Success Use
Use File
File from
from
Use
Use IOS
IOS in
in ROM
ROM bit 13 = 1 ? Network
Network
(rxboot ? No
(rxboot Mode)
Mode)
NORMAL
Config Reg No Valid Yes STARTUP
Load
Load IOS
IOS Bit 6 = 1 Config COMPLETE
? ?
Yes No
SETUP
DIALOG
The flowchart in the figure displays the sequence of events that occur during router boot.
Loading the Cisco IOS Software
from Flash Memory
RAM
Cisco
IOS
Flash
Console
Cisco
IOS show flash
When the router locates a valid IOS image file in flash memory, the IOS image is normally
loaded into RAM to run.
If the image is to be loaded from flash memory into RAM, it must first be decompressed. After
the file is decompressed into RAM, it is started. IOS images that are run from flash memory are
not compressed.
Loading the Configuration
RAM NVRAM
Config Config
Cisco
IOS
show show
running-config startup-config
Console
Setup Utility
After the Cisco IOS software image is loaded and started, the router must be configured to be
useful. If there is an existing saved configuration in NVRAM, it is executed. If there is no
saved configuration in NVRAM, the router either commences AutoInstall or enters the setup
utility.
The setup utility prompts a user at the console for specific configuration information to create a
basic initial configuration on the router.
As an experienced user you will seldom use the setup utility to configure a new router as this
gives very minimal configuration abilities.
Configuration Register
The configuration register includes information specifying where to locate the Cisco IOS
software image. You can examine the register with a show command and change the register
value with the config-register global configuration command. This topic describes how to
display and change the boot information in the configuration register.
wg_ro_a#show version
Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-JS-L), Version 12.0(3), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-1999 by cisco Systems, Inc.
Compiled Mon 08-Feb-99 18:18 by phanguye
Image text-base: 0x03050C84, data-base: 0x00001000
--More--
Use the show version command to obtain the current configuration register value. The last line
of the display contains the configuration register value.
If you are in ROM monitor mode and the prompt is “>”, use the o command to list the
configuration register settings. If the prompt is “rommon 1>”, use the conf-register command to
list the configuration register settings.
Configuration Register Values
Router#configure terminal
Router(config)#config-register 0x2102
[Ctrl-Z]
Router#
Configuration Register
Meaning
Boot Field Value
You can change the default configuration register setting with the config-register global
configuration command. The configuration register is a 16-bit register. The lowest four bits of
the configuration register (bits 3, 2, 1, and 0) form the boot field. A hexadecimal number is
used as the argument to set the value of the configuration register. The default value of the
configuration register is 0x2102.
ROM:
ROM: System
System Bootstrap,
Bootstrap, Version
Version 11.3(2)XA4,
11.3(2)XA4, RELEASE
RELEASE SOFTWARE
SOFTWARE (fc1)
(fc1)
Router
Router uptime
uptime is
is 11 minute
minute
System
System restarted
restarted byby reload
reload
System
System image
image file
file is
is "flash:c2600-js-mz.120-7a.bin"
"flash:c2600-js-mz.120-7a.bin"
cisco
cisco 2610
2610 (MPC860)
(MPC860) processor
processor (revision
(revision 0x300)
0x300) with
with 53248K/12288K
53248K/12288K bytes
bytes of
of memory.
memory.
Processor
Processor board
board ID
ID JAD06090BMD
JAD06090BMD (2719249260)
(2719249260)
M860
M860 processor:
processor: part
part number
number 0,
0, mask
mask 49
49
Bridging
Bridging software.
software.
X.25
X.25 software,
software, Version
Version 3.0.0.
3.0.0.
SuperLAT
SuperLAT software
software (copyright
(copyright 1990
1990 by
by Meridian
Meridian Technology
Technology Corp).
Corp).
TN3270
TN3270 Emulation
Emulation software.
software.
Basic
Basic Rate
Rate ISDN
ISDN software,
software, Version
Version 1.1.
1.1.
11 Ethernet/IEEE
Ethernet/IEEE 802.3
802.3 interface(s)
interface(s)
22 Serial(sync/async) network interface(s)
Serial(sync/async) network interface(s)
11 ISDN
ISDN Basic
Basic Rate
Rate interface(s)
interface(s)
32K
32K bytes
bytes of
of non-volatile
non-volatile configuration
configuration memory.
memory.
16384K
16384K bytes
bytes of
of processor
processor board
board System
System flash
flash (Read/Write)
(Read/Write)
Configuration
Configuration register
register is
is 0x2102
0x2102
© 2003, Cisco Systems, Inc. All rights reserved. INTRO v1.0a—9-13
Use the show version command to verify your changes in the boot field setting. The new
configuration register value takes effect when the router reloads.
In the example, the show version command indicates that the current configuration register is
set so that the router does not automatically load an operating system image. Instead, it enters
ROM monitor mode and waits for user-entered ROM monitor commands. The new setting
instructs the router to load a system image from commands in the startup configuration file or
from a default system image stored on a network server. When you use the config-register
command, you set all 16 bits of the configuration register. Be careful to modify only the bits
that you are trying to change, for example, the boot field, and leave the other bits as they are.
Remember that the other configuration register bits perform functions that include the selection
of console baud rate and the decision whether to use the saved configuration in NVRAM.
wg_ro_a#show
wg_ro_a#show flash
flash
System
System flash
flash directory:
directory:
File
File Length
Length Name/status
Name/status
11 10084696
10084696 c2500-js-l_120-3.bin
c2500-js-l_120-3.bin
[10084760
[10084760 bytes
bytes used,
used, 6692456
6692456 available,
available, 16777216
16777216 total]
total]
16384K
16384K bytes
bytes of
of processor
processor board
board System
System flash
flash (Read
(Read ONLY)
ONLY)
In the example, the bottom line tells you how much flash memory is available. Some of it might
already be in use. Flash memory is always read-only.
In RAM In NVRAM
wg_ro_c#show running-config wg_ro_c#show startup-config
Building configuration... Using 1359 out of 32762 bytes
Current configuration: !
! version 12.0
version 12.0 !
! -- More --
-- More --
The show running-config and show startup-config commands are among the most often used
Cisco IOS software EXEC commands because they allow an administrator to see the current
running configuration in RAM on the router or the startup configuration commands in NVRAM
that the router will use on the next restart.
If you see the words Current configuration at the top of the display, you are viewing the active
running configuration file from RAM.
If you see a message at the top of the display indicating how much nonvolatile memory has
been used, you are viewing the startup configuration file from NVRAM.
Summary
This topic summarizes the key points discussed in this lesson.
Summary
• When a router boots, it performs tests, finds and loads
software, finds and loads configurations, and finally runs
the software.
• The major internal components of a router include RAM,
ROM, flash memory, NVRAM, and the configuration
register.
• When a router boots, it searches for the IOS software
image in a specific sequence: location specified in the
configuration register, flash memory, a TFTP server, and
ROM.
• The configuration register includes information
specifying where to locate the Cisco IOS software image.
You can examine the register with a show command and
change the register value with the config-register
global configuration command.
© 2003, Cisco Systems, Inc. All rights reserved. INTRO v1.0a—9-16