You are on page 1of 34

Viewing, Saving, and Erasing

Configurations

If you run through setup mode, youll be asked if you want to use the
configuration you just created. If you say Yes, then it will copy the configuration
running in DRAM (known as the running-config) into NVRAM and name the file
startup-config
You can manually save the file from DRAM to NVRAM by using the copy
runningconfig
startup-config command (you can use the shortcut copy run start also):
Atlanta#copy run start
Destination filename [startup-config]?[Enter]
Warning: Attempting to overwrite an NVRAM configuration
previously written by a different version of the system
image.
Overwrite the previous NVRAM configuration?[confirm][Enter]
Building configuration...

Viewing, Saving, and


Erasing Configurations

Notice that the message we received tells us were trying to


write over the older startup-config.
The IOS had just been upgraded to version 12.2, and the last
time the file was saved, 11.3 was running.
Sometimes, when you see a question with an answer in [], it
means that if you just press
Enter, youre choosing the default answer.
Also, when the command asked for the destination filename,
the default answer was startupconfig.
The feature aspect of this command output is that you cant
even type anything else
in or youll get an error, as seen here:

Viewing, Saving, and


Erasing Configurations

Atlanta#copy run start


Destination filename [startup-config]?todd
%Error opening nvram:todd (No such file or directory)
Atlanta#

You can view the files by typing show running-config or


show startup-config from privileged mode. The sh run
command, which is a shortcut for show running-config,
tells us that we are viewing the current configuration:

Atlanta#sh run
Building configuration...

The sh start commandone of the shortcuts for the show


startup-config command, shows us the configuration that
will be used the next time the router is reloaded. It also

Viewing, Saving, and


Erasing Configurations

tells us how much NVRAM is being used to store


the startup-config file. Heres an example:
Atlanta#sh start
Using 4850 out of 32762 bytes
!
version 12.0

You can delete the startup-config file by using the erase


startup-config command, after which youll receive an
error if you ever try to view the startup-config file:

Viewing, Saving, and


Erasing Configurations

Atlanta#erase startup-config
Erasing the nvram filesystem will remove all files!
Continue? [confirm][Enter]
[OK]
Erase of nvram: complete
Atlanta#sh start
%% Non-volatile configuration memory is not present
Atlanta#reload

If you reload or power down and up the router after using the
erase startup-config command, youll be offered setup mode
because theres no configuration saved in NVRAM. You can
press Ctrl+C to exit setup mode at any time (the reload command
can only be used from
privileged mode).

ROUTER MEMORY

Router is a dedicated computer that performs the routing


functions, like a computer it has a CPU. The CPU
capability varies as in PC the most powerful ones are used
in the internet backbones and the lesser ones are used in
homes and small offices applications. Just like a PC routers
IOS software requires a processors (CPU) to run so it can
make decisions where to route packets, storing
configuration files or any other important functions. There
are generally four types of memories on a router.

ROUTER MEMORY
ROM:
Its a read only memory that contains a code which is used
to boot up a router. In Cisco routers the software is called
bootstrap software. Its used initially to boot up the router
until it knows where to find the full IOS image or its
backup in case of problems.
RAM:
Its a fast memory sometimes called Dynamic RAM. Just
as in a PC RAM here is used for running application
storages. Specifically it is used to hold IOS system tables
and buffers.

ROUTER MEMORY

The running or active configuration of the


router is stored here. It loses its information
when the router restarts.
Flash Memory:
Flash memory stores IOS system image file. In most routes
it stores images and/or configuration files. It is the default
location where the routers get the IOS at boot time.
Depending on the hardware platform flash memory might
be available as EPROM (Erasable Programmable Read
Only Memory), SIMMs (Single Inline Memory Modules)
or flash memory cards.

ROUTER MEMORY

Note: Flash memory card can be expanded


using PCMCIA (Personal Computer
Memory Card International Associations)
slots. Configuration files of system files can
be copied to the flash memory.
NVRAM:
It is a memory used to store the start up configuration. This
is the configuration file that the IOS reads up when the
router starts.
Note: All types of memory except RAM are permanent
memories

CONFIGURATION FILES

Two configuration files can be distinguished;


Start up configuration file stored up in NVRAM. It is the
configuration that runs when the router boots up
Running configuration: It is the current used active
configuration. Its stored in RAM.
When changes are made on the running configuration in
order for the changes to be persistent on reboots, the
running configuration needs to be copied to the start up
configuration with the following command
Router# copy running-config startup-config

BACKING UP A ROUTER

Routers need to be backed up so that in the event of


malfunction/disaster a new one can be put into its place
quickly/smoothly. The important files to be backed up are
the IOS image file and the configuration files. Depending
on the router platforms there are broadly two ways to
backup a router
a) By copying the information from device to device
within the same router. If you have a router with more than
one slot where memory disks information can be copied
from one disk to another to add redundancy. However if
the flash memory is large it can be

BACKING UP A ROUTER

partitioned into two separate memory location (logically).


To do this the router system must support partitioning.
b) Copying from one router to another. Provided that there
is a connection between the two routers let say router A
and router B information can be copied from each other.
In a production environment its convenient to convert one
router into a TFTP server. This means that the software
IOS image will be stored there. With show command
router information can be displayed. Example
Router# show flash

This command will show file name, and size of the flash
disk among other many things.

BACKING UP A ROUTER

For the copy operation from Router A to Router B, the


latter must have enough space to hosts the system file
otherwise the original one will be overwritten while
downloading the new one. It is hence advisable to backup
the existing image file before downloading the other. For
router A to act as a TFTP server it has to be configured as
one. The configuration must specify the configuration file
to be used eg
RouterA# config terminal
Router A(config)#tftp-server flash:/c2500-ss-1.122-10b

Once configured router B can copy by

RouterB# copy tftp flash

The user menu will guide through the process of copying.

LOADING IOS IMAGE

An image file can be loaded into a router from router acting


as a TFTP server or from itself if it has several memories or
its flash has been partitioned. For a router to load IOS
image as an administrator the followings options are
available
1) Using dual Flash Bank: This is achieved through
partitioning discussed already above.
2) Using flash load helper: It is an automated procedure that
reloads the ROM based image, downloads the IOS software
to the Flash memory and reboots the system
image in the flash memory. Its a cheaper alternative
compared to dual flash bank as it only uses a single flash
bank

LOADING IOS IMAGE


Reasons forcing you to use flash load helper:
If you are downloading a new file to the same memory
bank from which the current system image is residing and
executing.
If you have two memory banks but the file size you are
downloading is larger than the size of the memory bank.
This is in effect switching to the single bank mode.
If You have only one single bank flash SIMM installed. Its
hence the best option for installing the software.

LOADING IOS IMAGE

The downside of the flash helper:


It requires some brief network downtime.
Note:
1) System images running from flash can use flash load
helper only if the boot ROM supports flash load helper.
2) In run from flash system the software is stored and
executed from the flash EPROM rather than RAM. This
reduces the memory cost since the flash EPROM holds the
image and main system RAM holds routing table and data
structures. The system does not need as much RAM as a
run-from RAM because the full image does not reside in
RAM.

LOADING IOS IMAGE


The router needs to know (discover) the following during the
process of copying the IOS image into flash memory

The IP address of the TFTP server (Connectivity assumed)


Name of the file to copy
If enough space is available in the flash memory
Should the router erase the old file?

Recall: IOS BOOTING


SEQUENCE

Like a PC a router performs the following typically task


upon a reboot;
a) POST (Power On Self Test) to discover and verify the
hardware
b) Loads and run bootstrap code from ROM
c) Find IOS or other software and loads it
d) Find the configuration file and loads it into running
configuration
Part (a) can not be changed or customized by the
administrator, (b), (c) and (d) i.e. the location of the
bootstrap code, the location of the IOS and the
configuration file can be changed by the administrator

IOS BOOTING
SEQUENCE

(b) and (d) are normally kept at the default


value and it is (c) that is changed.

There are three categories of the IOS software that can be


loaded into the router.
1) Full-function IOS image: This is the normal IOS that
runs in a router in the typical
case. Its the software version running in the production.
2) A limited function IOS that resides in ROM. This offers
basic IP connectivity. It is used when the flash memory is

IOS BOOTING
SEQUENCE

broken and you need IP connectivity to copy the new


IOS into the flash memory. It is called RXBOOT mode.
3) A different non IOS operation system that is stored in
ROM. It is called ROM monitor and its used for two
purposes
a. Low level debugging
b. Password recovery
Most of the administrator will use this mode for password
recovery. This mode is called ROMMON mode

IOS BOOTING
SEQUENCE

So we have the three IOS that can be loaded into the router
at boot time, what controls which one to be loaded?

In Cisco the IOS to be loaded is controlled by the configuration of the


configuration registers and boot system command at initialization time.
The configuration register tells the router whether to use a full featured
IOS, ROMMON or the limited feature called RXBOOT mode.
The configuration register is like the setup mode occurring in a PC at
boot time if a normal boot sequence is interrupted at boot time with a
pre programmable key. In Cisco if you press a break key during the first
60 seconds after powering on the router you can access the register and
change the configuration to choose what mode you want to start the
router with on the next reboot.

PASSWORD RECOVERY

Configuration register setting described above can be set in


such a way as to ignore the NVRAM configuration when
the router is booted (loaded).In this mode the router will be
up with the initial default configuration. The administrator
can log in using a console enter the privileged mode and
change any encrypted password.
To be able to change the setting of the configuration register
you have to enter the ROMMON mode. The configuration
register is 16 bit in length, to enter the ROMMON mode the
6th digit must be set to high i.e. 1. This are the steps

PASSWORD RECOVERY

a) Turn on the router and press break key within the first
60 seconds
b) Write the command confreg and answer the prompts
this will
c) Use reload to restart the router or just switch it off and
then on.
d) Enter the privileged mode no password is required here.
e) Set the enable secret password
f) Copy the start up configuration from the NVRAM to the
running configuration
g) Change the configuration register to its original value
by

PASSWORD RECOVERY

router# config-reg 0x2102 (recall we had earlier


changed it to 0x2142 bit
six was set to 1)
h) Copy the running configuration to the start up
configuration and reloads the router by;
router# copy running-config startup-config
router# reload

NAMING COMMANDS AND


TELNET
NAMMING COMMANDS
Recall visiting the websites over the internet, you would
like to remember the names rather than the IP addresses of
all the websites you are normally surfing. Likewise when
you have several routers and you want to connect to them
it could be preferably to just connect to them using names
as compared to use IP addresses. IOS allows the use of
statically configured names and these routes can also be
configured to point to one or more DNS for name
resolution. Example in setting host names on the router;

NAMING COMMANDS AND


TELNET

Router# hostname Mwenge


Mwenge# ip host Ubungo 10.1.1.1
Mwenge# ip host Tabata 10.2.2.2
Mwenge# ip host Sinza 10.3.3.3
Mwenge# ip name-server 10.1.1.200 10.2.2.200
Mwenge# ip domain-lookup

By typing show host above information will be displayed


Notes:
1) Router Mwenge will use Ubungo, Tabata and Sinza to
refer interchangeably with respectively mapped IP
addresses.

NAMING COMMANDS AND


TELNET

2) Router Mwenge will ask DNSs for name resolution if it


do not know the name and IP address already
3) In the ip name-server command up to six DNS server
can be defined and these are searched sequentially.
4) IP domain-lookup enables the IOS to ask the name
server. No ip domain-lookup disables this functionality
5) IP domain name defines the domain name to be assumed
by the router for names that
do not include the full domain name

TELNET

To connect to a router from another router you can use a


telnet command provided that the telnet login was enabled,
password set and there is connectivity between the two
points.
UDSM# telnet Ubungo

Suppose after some configuration at Ubungo you want to


connect to Mwenge but you still want to maintain the
session at Ubungo. To do this without having to log off at
Ubungo you can utilise the suspend feature of telnet.
UDSM#telnet Ubungo
User access verification
Password:
Ubungo>

TELNET

By pressing ctrl+shift+6 and then X you are back at the


DSM router and the Ubungo connection has been
suspended
UDSM# telnet Mwenge
Password:
Mwenge>
Press ctrl+shift+6 then X
UDSM#

To view all your suspended session type show session at the


command prompt
UDSM# show session
conn host address
1 Ubungo 10.1.1.1
* 2 Mwenge 10.4.4.4

TELNET

To resume any of them you can type resume followed by


the connection number at the command prompt example to
resume ubungo session
UDSM#resume 1
To exit the session permanently type disconnect followed
by the connection number
UDSM# disconnect 2
Note:
When you have suspended telnet connection pressing enter
keystroke The IOS resumes the connection to the most

TELNET

recently connection. This is dangerous if you are executing


commands in one router and for one reason or another you
press enter key. You have to be extremely careful on the
router you are connected to on suspended telnet feature.

CDP (Cisco Discovery


rotocol)
Cisco discovery protocol is a Cisco protocol that helps the
routers administrator to obtain basic information about
neighboring routes and switches either locally or remotely
attached without the need to know the password for those
devices. This information can be used to troubleshoot and
to document the network.
CDP discovers the followings
Device identifier: Hostname of the device directly
connected.
Local interface: The point or interface you are receiving
the CDP packet

CDP (Cisco Discovery


rotocol)

Holdtime: The amount of time the router will hold the


information before discarding it if no more CDP packets
are received.
Address list: Network and data link addresses Capabilities
list: Information on type of device e.g. routers, switch or a
repeater.
Platform: The model and OS level running in the device

CDP (Cisco Discovery


rotocol)

The following command is used once you have log in to the


router.

2500A#sh cdp nei

A detailed statistic can be obtained by writing show cdp


neighbour detail on the router command prompt

You might also like