Ccna 2 Router and Routing Basics: 5-Managing Cisco IOS Software
Ccna 2 Router and Routing Basics: 5-Managing Cisco IOS Software
1
5.1 Router Boot Sequence and Verification
5.1.1 Stages of the router power-on boot sequence
• The goal of the startup routines for Cisco IOS software is to start the router operations.
A router must reliably connect any configured networks. To do this, the startup routines
must :
• Test the router hardware
• Find and load the Cisco IOS software
• Find and apply configuration statements such as protocol functions and interface
addresses
2
5.1 Router Boot Sequence and Verification
5.1.2 How a Cisco device locates and loads IOS
• If flash memory is empty, a router will try to use TFTP to load an IOS image from the network. The
router will use the configuration register value to form a filename from which to boot a default
system image that is stored on a network server.
• If a TFTP server is unavailable, the router will load the limited version Cisco IOS software image
stored in ROM. 3
5.1 Router Boot Sequence and Verification
5.1.3 Using the boot system command
Cisco IOS software image will load sequentially
from
• E-lab , lab
4
5.1 Router Boot Sequence and Verification
5.1.4 Configuration register
• The configuration register is a 16-bit register in NVRAM that is represented as 4 hexadecimal digits.
• The lowest four bits of the configuration register form the boot field. To ensure that the upper 12
bits are not changed.
• first use the show version command to retrieve the current values of the configuration register.
• Then use the config-register command and change only the value of the last hexadecimal digit.
• To boot from the first image in Flash or to boot to the IOS in ROM (platform dependant),
set the configuration register to 0xnnn1
– This value sets the boot field bits to 0001 binary.
– Older platforms, such as Cisco 1600 and 2500 routers, will boot to a limited IOS in ROM. Newer
platforms, such as Cisco 1700, 2600 and high end routers, will boot from the first image in Flash.
–
• To configure the system to use the boot system commands in NVRAM, set the
configuration register to any value from 0xnnn2 to 0xnnnF,
– These values set the boot field bits to a value between 0010 and 1111 binary.
– The router sequentially processes each boot system command in NVRAM until the process is
successful or the end of the list is reached.
– If there are no boot system commands in the startup configuration file, the router attempts to
boot the first file in flash memory. 5
E-lab
5.1 Router Boot Sequence and Verification
• When a router boots, it looks in the startup configuration file for a boot system
statement. This boot system statement can force the router to boot from another image
instead of the IOS in flash. Use the show version command to look for the line that
identifies the boot image source .FIG1
• Use the show running-config command and look for a boot system statement near the
top of the configuration. If the boot system statement points to an incorrect IOS image,
use the no version of the command to delete the statement.
• If the configuration register setting is incorrect, the IOS cannot load from flash. The value
in the configuration register tells the router where to get the IOS.
• To confirm this, use the show version command and look at the last line for the
configuration register. The correct value varies for different hardware platforms. A part of
the documentation of the internetwork should be a printed copy of the show version
output.
• If that documentation is not available, there are resources on the Cisco documentation CD or Cisco website to identify
the correct configuration register value. To correct this, change the configuration register and save this as the start-up
configuration.
6
5.1 Router Boot Sequence and Verification
5.1.5 Troubleshooting IOS boot failure
If there is still a problem, the router may have a corrupted flash image file.
an error message should be displayed during boot. That message may take one of
several forms :
– open: read error...requested 0x4 bytes, got 0x0
– trouble reading device magic number
– boot: cannot open "flash:"
– boot: cannot determine first file name on device "flash:"
• If the flash image is corrupt, a new IOS should be uploaded into the router.
• If none of the above appears to be the problem, the router could have a hardware
failure. ( contact the Cisco Technical Assistance Center (TAC).
• The value of the configuration register is not displayed by the show running-config or
show startup-config commands.
• Lab
• E-lab
7
5.2 Managing the Cisco File System
5.2.1 IOS file system overview
The IFS uses the URL convention to specify files on network devices and the network.
• The URL convention identifies the location of the configuration files following the colon
as [[[//location]/directory]/filename].
• The IFS also supports FTP file transfers. FIG3
8
5.2 Managing the Cisco File System
• In a Cisco router or switch, the active configuration is in RAM and the default
location for the startup configuration is NVRAM.
• The startup configuration should be backed up in case the configuration is lost. copy
running-config tftp
– Then, Enter the IP address of the TFTP server to store the configuration file.
– Enter the name to assign to the configuration file or accept the default name. Type yes .
• The backup configuration file can be loaded from a TFTP server to restore the router
configuration. copy tftp running-config.
– Select a host or network configuration file at the prompt.
– Enter the IP address of the TFTP server where the configuration file is located.
– Enter the name of the configuration file or accept the default name.
– Confirm the configuration filename and the server address that the system supplies.
• Lab
10
5.2 Managing the Cisco File System
5.2.4 Managing configuration files using copy and paste
• from the terminal session, copy output of the show running-config command, paste it
into a text file, and then save the text file. FIG1-2
– Select Transfer > Capture Text.
– Specify a name for the text file to capture the configuration. Select Start to start capturing text.
– Use the show running-config command to display the configuration on the screen.
– Press the Spacebar when each "-More -" prompt appears.
To stop
– Select Transfer > Capture Text. > Stop.
• After the capture is complete, the configuration file needs to be edited to remove extra
text.
– Comments may also be added to explain the various parts of the configuration. To add a comment,
begin a line with an exclamation mark (!).
– The configuration file can be edited from a text editor such as Notepad.
• Add the no shutdown command to the end of each interface section. Click File > Save to save a 11
clean version of the configuration.
5.2 Managing the Cisco File System
5.2.4 Managing configuration files using copy and paste
12
5.2 Managing the Cisco File System
5.2.5 Managing IOS images using TFTP
• As each datagram of the IOS image file is downloaded, an exclamation mark (!) will be
displayed. This IOS image is several megabytes and may take a long time to download.
• The new flash image will be verified after it is downloaded.
• The router is now ready to be reloaded to use the new IOS image.
• LAB
13
5.2 Managing the Cisco File System
5.2.6 Managing IOS images using ROMmon and Xmodem
• the IOS image in flash has been erased or corrupted, the IOS may need to be restored
from the ROM monitor mode (ROMmon). (RAMmon prompt rommon 1>)
• identify why the IOS image did not load from flash. (due to a corrupt or missing image).
• The flash should be examined with the dir flash: command.
• If an image is located that appears to be valid, usethat image. boot flash: command.
– e.i. if the image name is c2600-is-mz.121-5, the command is as follows: rommon 1>boot
flash:c2600-is-mz.121-5
• If the router boots properly, the user should check two items to determine why the
router did not use the IOS image from flash and booted to the ROMmon instead.
– First, use the show version command to check the configuration register to ensure that it is
configured for the default boot sequence.
– If the configuration register value is correct, use the show startup-config command to see if there is
a boot system command that instructs the router to use the IOS for ROMmon.
• If the router will not properly boot from the image or there is no IOS image, a new IOS
will need to be downloaded.
• To recover the IOS file, a user can use Xmodem to restore the image through the
console or use TFTP to download the image from the ROMmon mode.
14
5.2 Managing the Cisco File System
5.2.6 Managing IOS images using Xmodem
Download with Xmodem from ROMmon (To restore the IOS through the console)
• The IOS can be restored with the default console speed of 9600 bps. The baud rate can
be changed to 115200 bps to speed up the download.
– Use the confreg command to change the console speed from ROMmon mode. >
– the router will prompt for the parameters that can be changed. FIG1
• “change console baud rate? y/n [n]:” y the router will prompt the user to select the new
speed. After the console speed is changed, restart the router into ROMmon mode. The terminal
session at 9600 bps is terminated and a new session is started at 115200 bps to match the console
speed.
• The xmodem command can be used from the ROMmon mode to restore an IOS
software image from the PC. xmodem -c image_file_name.
– to restore an IOS image file named c2600-is-mz.122-10a.bin use xmodem -c c2600-is-
mz.122-10a.bin
– The -c instructs the Xmodem process to use cyclic redundancy check (CRC) for error checking
during the download. FIG2
– The warning message will inform the user that the bootflash will be erased and will ask for
confirmation to continue.
The fastest way to restore an IOS image to the router is to use TFTP from ROMmon to
download the image. ( set the environmental variables and then use the tftpdnld command)
show version command: used to check the current image and the total amount of flash.
– also verifies two other items that relate to how the IOS is loaded. It identifies the source of the
IOS image that the router used to boot and displays the configuration register.
– Check the boot field setting of the configuration register to determine the location from which
the router will load the IOS. If these do not agree, there may be a corrupt or missing IOS image
in flash or there may be boot system commands in the startup configuration.
• As previously mentioned, the configuration file may contain boot system commands.
These commands can be used to identify the source of the desired IOS boot image.
Multiple boot system commands may be used to create a fallback sequence to discover
and load an IOS. These boot system commands will be processed in the order of their
appearance in the configuration file.
17
CCNA 2
Router and Routing Basics
18
6.1 Introduction to Static Routing
6.1.1 Introduction to routing
• Routing : the process that a router uses to forward packets toward the destination network.
19
6.1 Introduction to Static Routing
6.1.2 Static route operation
• The administrative distance is an optional parameter that indicates the reliability of a
route.
– A lower value for the administrative distance indicates a more reliable route.
– A route with a lower administrative distance will be installed before a similar route with a higher
administrative distance.
– The default administrative distance when using a static route is 1. In the routing table, it will
show the static route with the outgoing interface option as being directly connected. This is
sometimes confusing, since a true directly connected route has an administrative distance of 0.
– To verify the administrative distance of a particular route, use the show ip routeaddress
command, where the ip address of the particular route is inserted for the address option. If an
administrative distance other than the default is desired, a value between 0 and 255 is entered
after the next-hop or outgoing interface as follows:
• waycross(config)#ip route 172.16.3.0 255.255.255.0 172.16.4.1 130
– If the router cannot reach the outgoing interface that is being used in a route, the route will not
be installed in the routing table. This means if that interface is down, the route will not be placed
in the routing table.
• Sometimes static routes are used for backup purposes. A static route can be
configured on a router that will only be used when the dynamically learned route has
failed. To use a static route as a backup, set a higher administrative distance than
the dynamic routing protocol.
• E-lab1, e-lab2
20
6.1 Introduction to Static Routing
6.1.3 Configuring static routes
steps to configure static routes:
1. Determine all desired prefixes, masks, and addresses. The address can be either a local
interface or a next hop address that leads to the desired destination.
2. Enter global configuration mode.
3. ip route command with a prefix and mask followed by the corresponding address from
Step 1. The administrative distance is optional.
4. Repeat Step 3 for all the destination networks that were defined in Step 1.
5. Exit global configuration mode.
6. copy running-config startup-config command to save the active configuration to
NVRAM.
E-lab
21
6.1 Introduction to Static Routing
6.1.4 Configuring default route forwarding
• Default routes are used to route packets with destinations that do not match any of the
other routes in the routing table.
• Routers are typically configured with a default route for Internet-bound traffic, A default
route is actually a special static route that uses this format:
– ip route 0.0.0.0 0.0.0.0 [next-hop-address | outgoing interface ]
– If the packet does not match a more specific route in the routing table, it will be routed to the 0.0.0.0
network.
• FIG1 -2 …………….
• E-lab
22
6.1 Introduction to Static Routing
6.1.5 Verifying static route configuration
• After static routes are configured it is important to verify that they are present in the
routing table and that routing is working as expected.
• Enter the show running-config command in privileged mode to view the active
configuration in RAM to verify that the static route was entered correctly.
– If the route is not correct, it will be necessary to go back into global configuration mode to
remove the incorrect static route and enter the correct one. FIG1
• Enter the command show ip route to make sure that the static route is present in the
routing table. FIG2
• E-lab
23
6.1 Introduction to Static Routing
6.1.6 Troubleshooting static route configuration
• FIG1: nodes on the Sterling 172.16.1.0 network cannot reach nodes on the Waycross
172.16.5.0 network. FIG2
• LAb
• E-lab
24
6.2 Dynamic Routing Overview
6.2.1 Introduction to routing protocols
25
6.2 Dynamic Routing Overview
6.2.2 Autonomous systems (AS)
• AS is a collection of networks under a common administration that share a common routing strategy.
• The American Registry of Internet Numbers (ARIN), a service provider, or an administrator assigns a
16-bit identification number to each AS.
• This autonomous system number is a 16 bit number.
• Routing protocols, such as Cisco IGRP, require the assignment of a unique, AS number.
• Autonomous systems divide the global internetwork into smaller and more manageable networks.
Each AS has its own set of rules and policies and an AS number that will distinguish it from all other
autonomous systems.
26
6.2 Dynamic Routing Overview
6.2.4 Identifying the classes of routing protocols
two classes of routing protocols :
1. Distance vector : this approach determines the direction, or vector, and distance to any link in an
internetwork.
2. Link-state : recreates the exact topology of an entire internetwork.
• Each router receives a routing table from its directly connected neighbor routers. FIG1
– Router B receives information from Router A. Router and adds a distance vector number, such as a number
of hops. Then it passes this new routing table to its other neighbor, Router C. This same step-by-step process
occurs in all directions between neighbor routers.
• the distance vector algorithm does not allow a router to know the exact topology of an
internetwork since each router only sees its neighbor routers.
27
6.2.5 Distance vector routing protocol features
• Each router that uses distance vector routing
first identifies its neighbors.
28
6.2.6 Link-state routing protocol features
(Dijkstra's algorithm or shortest path first (SPF) algorithm.)
• Each router constructs a topological database that consists of all the exchanged LSAs.
• SPF algorithm: router uses SPF to sort all possible paths to each network in the link-state protocol
internetwork. The router lists the best paths and the interfaces to these destination networks in the
routing table.
• The first router that learns of a link-state topology change forwards the information so that all other
routers can use it for updates.
• Common routing information is sent to all routers in the internetwork. FIG3.
– To achieve convergence, each router learns about its neighbor routers. This includes the name of each
neighbor router, the interface status, and the cost of the link to the neighbor in a LSA packet.
– When a router receives an LSA, it updates the routing table with the most recent information.
3 concerns related to link-state protocols: Processor overhead, Memory requirements , Bandwidth consumption
• Routers that use link-state protocols: require more memory and process more data than routers
that use distance vector routing protocols.
• Initial link-state packet flooding consumes bandwidth.
– In the initial discovery process, all routers that use link-state routing protocols send LSA packets to all other
routers. After this initial flooding, link-state routing protocols generally require minimal bandwidth to send
infrequent or event-triggered LSA packets that reflect topology changes.
29
6.3 Routing Protocols Overview
6.3.1 Path determination
• switching function :
– the internal process used by a router to accept a packet on one interface and forward it to a
second interface on the same router.
– A key responsibility of the switching function of the router is to encapsulate packets in the
appropriate frame type for the next data link.
• FIG5 : how routers use addressing for these routing and switching functions.
– The router uses the network portion of the address to make path selections to pass the packet
to the next router along the path.
30
6.3 Routing Protocols Overview
6.3.2 Routing configuration
• To enable an IP routing protocol on a router, global and routing parameters need to be set.
• Global tasks : selection of a routing protocol (RIP, IGRP, EIGRP, or OSPF).
• The major task in the routing configuration mode is to indicate IP network numbers. Dynamic routing
uses broadcasts and multicasts to communicate with other routers. FIG1
• For RIP and IGRP, the network numbers are based on the network class addresses, not subnet
addresses or individual host addresses.
• E-lab
31
6.3 Routing Protocols Overview
6.3.3 Routing protocols
32
33