Professional Documents
Culture Documents
Cisco IOS
2
The Purpose of Cisco IOS
3
Introduction to Routers
A router is a special type of computer. It has the same basic components as a standard desktop
PC. However, routers are designed to perform some very specific functions. Just as computers
need operating systems to run software applications, routers need the Internetwork Operating
System software (IOS) to run configuration files. These configuration files contain the instructions
and parameters that control the flow of traffic in and out of the routers. The many parts of a
router are shown below:
4
Router Memory Components
5
ROM
Read-Only Memory
6
RAM
7
NVRAM
Non-Volatile RAM
8
Flash
Flash memory has the following characteristics and
functions:
Types of interfaces:
Ethernet
Fast Ethernet
Serial
ISDN BRI
Loopback
Console
Aux
10
Router Internal Components
11
Router Power-On/Bootup
Sequence
1. Perform power-on self test (POST).
2. Load and run bootstrap code.
3. Find the Cisco IOS software.
4. Load the Cisco IOS software.
5. Find the configuration.
6. Load the configuration.
7. Run the configured Cisco IOS software.
12
Boot Sequence
C-File NVRAM
ROMMonitor
RXBoot
Y Running
FLASH N
Setup Mode
Step 1
The generic bootstrap loader in ROM executes. A bootstrap is a simple set of instructions that
tests hardware and initializes the IOS for operation.
Step 2
The IOS can be found in several places. The boot field of the configuration register determines
the location to be used in loading the IOS.
Step 3
The operating system image is loaded.
Step 4
The configuration file saved in NVRAM is loaded into main memory and executed one line at a
time. The configuration commands start routing processes, supply addresses for interfaces,
and define other operating characteristics of the router.
Step 5
If no valid configuration file exists in NVRAM, the operating system searches for an available
TFTP server. If no TFTP server is found, the setup dialog is initiated.
14
Loading the Cisco IOS Software
From Flash Memory
15
Loading the Configuration
16
External Components of a 2600 Router
17
Internal Components of a 2600 Router
18
Computer/Terminal Console Connection
19
HyperTerminal Session Properties
21
Establishing a
HyperTerminal Session
Take the following steps to connect a terminal to the console port on the router:
First, connect the terminal using the RJ-45 to RJ-45 rollover cable and an RJ-45 to
DB-9 or RJ-45 to DB-25 adapter.
Then, configure the terminal or PC terminal emulation software for 9600 baud, 8
data bits, no parity, 1 stop bit, and no flow control.
22
Router Command Line Interface
23
IOS File System Overview
24
Router LED Indicators
25
26
Router User Interface Modes
The Cisco command-line interface (CLI) uses a hierarchical structure. This structure
requires entry into different modes to accomplish particular tasks.
Each configuration mode is indicated with a distinctive prompt and allows only
commands that are appropriate for that mode.
As a security feature the Cisco IOS software separates sessions into two access
levels, user EXEC mode and privileged EXEC mode. The privileged EXEC mode is
also known as enable mode.
27
Overview of Router Modes
28
Router Modes
29
CLI Command Modes
All command-line interface (CLI) configuration changes to a Cisco router are made
from the global configuration mode. Other more specific modes are entered
depending upon the configuration change that is required.
The following command moves the router into global configuration mode
When specific configuration modes are entered, the router prompt changes to
indicate the current configuration mode.
Typing exit from one of these specific configuration modes will return the router to
global configuration mode. Pressing Ctrl-Z returns the router to all the way back
privileged EXEC mode.
30
Show Version Command
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
31
Viewing the Configuration
32
show running-config and
show startup-config Commands
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 --
33
Saving Configurations
35
Configuring a Router’s Name
A router should be given a unique name as one of the first
configuration tasks.
Router(config)#hostname Gates
Gates(config)#
36
Setting
the Clock
with Help
37
Message Of The Day (MOTD)
38
Privileged Mode Command
# show startup-config
# show running-config
# show version
# show flash
# show interfaces
# show interfaces s 0
# show history
# show terminal
# terminal history size 25
39
Password
40
Passwords
There are five passwords for Router
Privileged Mode Password – 2
Line Console Password
Auxiliary Port Password
Telnet Password
41
Privileged Mode Password
Gates(config)# enable password gates
Encrypted privilege mode password
Gates(config)# enable secret gates1
42
Line Password
Gates(config)# line console 0
Gates(config)# password cisco
Gates(config)# login
43
Aux Port Password
Gates(config)# line aux 0
Gates(config)# password cisco
Gates(config)# login
44
Connecting to Aux Port
45
Configuring a Telnet Password
46
Telnet Password
Gates(config)# line vty 0 4
Gates(config)# password cisco
Gates(config)# login
47
Encrypting Passwords
Only the enable secret password is encrypted by default
Need to manually configure the user-mode and enable
passwords for encryption
To manually encrypt your passwords, use the service
password-encryption command
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#service password-encryption
48
Disable Passwords
Gates(config)# no enable password
Gates(config)# no enable secret
For the Console
Gates(config)# line con 0
Gates(config)# no password
Gates(config)# line vty 0 4
Gates(config)# no password
49
LAB – Interface Configuration
20.0.0.1 30.0.0.2
20.0.0.2 30.0.0.1
S0
10.0.0.1 E0
S0 S0 S1
E0 40.0.0.1
A B 40.0.0.2
10.0.0.2
50
Descriptions
Setting descriptions on an interface is helpful to
the administrator
Only locally significant
R1(config)#int e0
R1(config-if)#description Sales Lan
R1(config-if)#int s0
R1(config-if)#desc Wan to Mumbai
51
Configuring Interfaces
An interface needs an IP Address and a Subnet Mask to be configured.
All interfaces are “shutdown” by default.
The DCE end of a serial interface needs a clock rate.
R1#config t
R1(config)#int e0
R1(config)#Description Connoted to Host
R1(config-if)#ip address 10.0.0.1 255.0.0.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial 0
R1(config-if)#ip address 20.0.0.1 255.255.255.0
R1(config-if)# bandwidth 64
R1(config-if)#clock rate 64000 (required for serial DCE only)
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#exit
R1#
On new routers, Serial 1 would be just Serial 0/1 and e0 would be f0/0.
s = serial e = Ethernet f = fast Ethernet
52
DCE DTE
To find out DCE or DTE
#Show controllers s 0
53
Viewing Configuration
To Check the status of interface
#Show IP interface brief
or
#Sh IP int brief
54
Saving and Erasing Configurations
To copy RAM to NVRAM
# copy run startup-config
55
56
Objectives
Upon completion of this chapter, you will be
able to complete the following tasks:
Distinguish the use and operation of static and dynamic
routes
Configure and verify a static route
Identify how distance vector IP routing protocols such as
RIP and IGRP operate on Cisco routers
Enable Routing Information Protocol (RIP)
Enable Interior Gateway Routing Protocol (IGRP)
Verify IP routing with show and debug commands
57
Routing
58
Routing
From To
Raj Ram
House #213, 4th Street House #452, 2nd Street
Jayanagar, Bangalore Dadar, Mumbai
59
What is Routing?
10.120.2.0 172.16.1.0
10.120.2.0 172.16.1.0
E0
S0
Connected 10.120.2.0 E0
Routed Protocol: IP
Learned 172.16.1.0 S0
62
IP Routing Process
10.0.0.1 20.0.0.1
E0 E1
A B 20.0.0.2
10.0.0.2
63
LAB – Interface Configuration
20.0.0.1 30.0.0.2
20.0.0.2 30.0.0.1
S0
10.0.0.1 E0
S0 S0 S1
E0 40.0.0.1
A B 40.0.0.2
10.0.0.2
65
Test The Connection
• Host A can ping router R1 and R2
• To enable Host A to Ping Host B we need to configure
Routes
66
IP Routing
The different types of routing are:
Static routing
Default routing
Dynamic routing
67
Static Routes
Benefits
No overhead on the router CPU
No bandwidth usage between routers
Adds security
Disadvantage
Administrator must really understand the internetwork
If a network is added to the internetwork, the
administrator has to add a route to it on all routers
Not feasible in large networks
68
Static Route Configuration
69
Static Route Configuration
ip route [destination_network] [mask] [next-hop_address or exitinterface ]
[administrative_distance] [permanent
70
LAB – Static Route Configuration
20.0.0.1 30.0.0.2
20.0.0.2 30.0.0.1
S0
10.0.0.1 E0
S0 S0 S1
E0 40.0.0.1
R2# config t
R2(config)#ip route 10.0.0.0 255.0.0.0 20.0.0.1
R2(config)#ip route 40.0.0.0 255.0.0.0 30.0.0.2
A B 40.0.0.2
10.0.0.2
R1# config t
R3# config t
R1(config)#ip route 30.0.0.0 255.0.0.0 20.0.0.2
R3(config)#ip route 10.0.0.0 255.0.0.0 30.0.0.1
R1(config)#ip route 40.0.0.0 255.0.0.0 20.0.0.2
R3(config)#ip route 20.0.0.0 255.0.0.0 30.0.0.1
71
Verifying Static
Route Configuration
72
Removing IP Route
20.0.0.1 30.0.0.2
20.0.0.2 30.0.0.1
S0
10.0.0.1 E0
S0 S0 S1
E0 40.0.0.1
R2# config t
R2(config)#no ip route 10.0.0.0 255.0.0.0 20.0.0.1
R2(config)#no ip route 40.0.0.0 255.0.0.0 30.0.0.2
A B 40.0.0.2
10.0.0.2
R1# config t
R3# config t
R1(config)#no ip route 30.0.0.0 255.0.0.0 20.0.0.2
R3(config)#no ip route 10.0.0.0 255.0.0.0 30.0.0.1
R1(config)#no ip route 40.0.0.0 255.0.0.0 20.0.0.2
R3(config)#no ip route 20.0.0.0 255.0.0.0 30.0.0.1
73
Default Routes
• Can only use default routing on stub networks
• Stub networks are those with only one exit path out of
the network
• The only routers that are considered to be in a stub
network are R1 and R3
20.0.0.1 30.0.0.1 30.0.0.2
S0 S1
10.0.0.1 E0 S0 S0 E0 40.0.0.1
20.0.0.2
10.0.0.2 A B 40.0.0.2
74
Default Routes
Stub Network
172.16.1.0
SO
Network
10.0.0.0 A BB
172.16.2.2 172.16.2.1
A default route is actually a special static route that uses this format:
20.0.0.1 30.0.0.1
30.0.0.2
S0 S1
10.0.0.1 E0 S0 S0
40.0.0.1
E0
20.0.0.2
A B 40.0.0.2
10.0.0.2
77
Default Route LAB
Configuration
20.0.0.1 30.0.0.1
30.0.0.2
S0 S1
10.0.0.1 E0 S0 S0
40.0.0.1
E0
20.0.0.2
A B 40.0.0.2
10.0.0.2
R2# config t
R2(config)#ip route 10.0.0.0 255.0.0.0 20.0.0.1
R2(config)#ip route 40.0.0.0 255.0.0.0 30.0.0.2
78
What is a Routing Protocol?
10.120.2.0 172.16.1.0
E0
Routing protocols are S0
used between
routers to determine
paths and maintain
routing tables.
Once the path is
Network Destination Exit 172.17.3.0
determined a router can Protocol Network Interface
route a routed protocol.
Connected 10.120.2.0 E0
RIP 172.16.2.0 S0
IGRP 172.17.3.0 S1
Routed Protocol: IP
Routing protocol: RIP, IGRP
79
Routing Categories
An Autonomous System (AS) is a group of IP networks, which has a
Autonomous System single and clearly defined routing policy.
Group of routers which can exchange updates
AS are identified by numbers
EGP
Exterior Gateway
Protocols are used
for routing between
Autonomous Systems
AS 1000 AS 3000
IGP
Interior Gateway Protocols are
used for routing decisions
AS 2000 within an Autonomous System.
AS 1000 AS 3000
EGP
EGP IGP
EGP
AS 2000
Fig. 49 The use of IGP and EGP protocols (TI1332EU02TI_0004 The Network Layer, 67) 81
Autonomous Systems: Interior or
Exterior Routing Protocols
82
Types or Classes of Routing
Protocols
83
Types or Classes of Routing
Protocols
Distance Vector
RIP V1
IGRP
RIP V2
Link state
OSPF
Hybrid
EIGRP
84
Classful Routing Overview
Classful routing protocols do not include the subnet mask with the
route advertisement.
85
Classless Routing Overview
Classless routing protocols include the subnet mask with
the route advertisement.
Classless routing protocols support variable-length
subnet masking (VLSM) and subnetting
Examples of classless routing protocols:
RIP Version 2 (RIPv2)
EIGRP
OSPF
IS-IS
86
Distance Vector Routing
Protocols
192.168.20.1
192.168.10.1
88
Distance Vector
192.168.20.1
192.168.10.1
There are two Distance Vector Protocol, Both uses different metric
RIP – Hops
IGRP - Composite
89
Distance Vector
2
1
R1 3
0
192.168.10.1
2
192.168.20.1
1
90
Distance Vector
10 1 Mbps
1 Mbps
R1 1 Mbps
10
10
192.168.10.1
56 kbps
192.168.10.1 30 192.168.20.1
30
56 kbps
91
Routing Loops
92
Sources of Information and
Discovering Routes
93
Inconsistent Routing Entries
• Each node maintains the distance from itself to each possible destination network.
94
Inconsistent Routing Entries
(Cont.)
95
Inconsistent Routing Entries
(Cont.)
96
Inconsistent Routing Entries
(Cont.)
97
Count to Infinity
98
Routing Loops
99
Defining a Maximum
100
Maximum Hop Count
• One way of solving routing loop problem is to define a
maximum hop count.
101
Split Horizon
• It is never useful to send information about a route back in the direction from which the original
information came.
102
Split Horizon
Solution to the Routing Loop problem
Split Horizon is a rule that routing
information cannot be sent back in the
direction from which it was received
Had split horizon been used in our
example, Router B would not have
included information about network
10.4.0.0 in its update to Router C.
103
Route Poisoning
• Route Poisoning. Usually used in conjunction with split
horizon
• Route poisoning involves explicitly poisoning a routing
table entry for an unreachable network
• Once Router C learned that network 10.4.0.0 was
unavailable it would have immediately poisoned the
route to that network by setting its hop count to the
routing protocol’s infinity value
• In the case of RIP, that would mean a hop count of 16.
104
Triggered Updates
New routing tables are sent to neighboring routers on a regular basis.
105
Triggered Updates Graphic
106
Holddowns
• Holddowns are a technique used to ensure that a route recently
removed or changed is not reinstated by a routing table update
from another route
• Holddown prevents regular update messages from reinstating a
route that is going up and down (called flapping)
• Holddowns prevent routes from changing too rapidly by allowing
time for either the downed route to come back up
• Holddowns make a router wait a period of time before accepting an
update for a network whose status or metric has recently changed
107
Solution: Holddown Timers
108
Pinhole Congestion
1Mbps 1Mbps
192.168.20.1
192.168.10.1
56kbps
56kbps
109
RIP Timers
• Route update timer Sets the interval (typically 30 seconds)
between periodic routing updates
• Route flush timer Sets the time between a route becoming invalid
and its removal from the routing table (240 seconds).
110
Routing Information Protocol
(RIP)
Routing Information Protocol (RIP) is a true distance-vector routing
protocol.
It sends the complete routing table out to all active interfaces every
30 seconds
RIP only uses hop count to determine the best way to a remote
network
It has a maximum allowable hop count of 15
AD is 120
Bellman-ford algorithm
Works well in small networks, but it’s inefficient on large networks
RIP version 1 uses only classful routing, which means that all
devices in the network must use the same subnet mask
RIP version 2 does send subnet mask information with the route
updates. This is called classless routing.
111
Router Configuration
The router command starts a routing process.
Gates(config)#router rip
Gates(config-router)#network 172.16.0.0
192.168.20.1 192.168.30.1
S0
S0 S1
192.168.10.1 E0 S0
192.168.30.2 E0 192.168.40.1
192.168.20.2
R2# config t
R2(config)#router rip 192.168.40.2
A R2(config)#network 192.168.20.0 B
192.168.10.2 R2(config)#network 192.168.30.0
113
Verifying RIP Configuration
114
Displaying the
IP Routing Table
115
debug ip rip Command
116
Passive Interface
Passive-interface command prevents RIP update
broadcasts from being sent out a defined interface, but
same interface can still receive RIP updates
R1#config t
R1(config)#router rip
R1(config-router)#network 192.168.10.0
R1(config-router)#passive-interface serial 0
Passive-interface command depends upon the routing
protocol
RIP router with a passive interface will still learn about
the networks advertised by other routers
EIGRP, a passive-interface will neither send nor receive
updates.
117
RIP Version 2 (RIPv2)
R1# config t
R1(config)# )#router rip
R1(config)#network 192.168.10.0
R1(config)#network 192.168.20.0
R1(config)#version 2
118
Exercise - RIP Version 2
Configuration
192.168.0.4/30 192.168.0.8/30
S0
S0 S1
E0 S0
E0
192.168.0.16/29 192.168.0.32/28
A B
119
Exercise - RIP Version 2
Configuration
192.168.0.5 192.168.0.9
255.255.255.252
255.255.255.252
S0
S0 S1
E0 S0 192.168.0.33
192.168.0.10 E0 255.255.255.240
192.168.0.17 192.168.0.6 255.255.255.252
255.255.255.248 255.255.255.252
192.168.0.34
A B 255.255.255.240
192.168.0.18
255.255.255.248
120
Exercise - RIP Version 2
Configuration
192.168.0.4/30 192.168.0.8/30
S0
S0 S1
E0 S0
E0
R2# config t
192.168.0.16/29 R2(config)#router rip 192.168.0.32/28
R2(config)#network 192.168.0.4
R2(config)#network 192.168.0.8
R2(config)#version 2
A B
121
Enabling IGRP
CISCO Proprietary
More scalable than RIP
Sophisticated metric
123
IGRP Composite Metric
Bandwidth
Delay
Reliability
Load
MTU
124
IGRP
composite metric.
The main difference between RIP and IGRP configuration is
that when you configure IGRP, you supply the autonomous
system number. All routers must use the same number in order
to share routing table information.
125
IGRP Vs RIP
126
Configuring IGRP
128
IGRP Configuration
192.168.20.1 192.168.30.1
S0
S0 S1
192.168.10.1 E0 S0
192.168.30.2 E0 192.168.40.1
192.168.20.2
R2# config t
R2(config)#router igrp 10 192.168.40.2
A R2(config)#network 192.168.20.0 B
192.168.10.2 R2(config)#network 192.168.30.0
129
Verifying the IGRP Routing Tables
LabA#sh ip route
[output cut]
I 192.168.50.0 [100/170420] via 192.168.20.2, Serial0/0
I 192.168.40.0 [100/160260] via 192.168.20.2, Serial0/0
I 192.168.30.0 [100/158360] via 192.168.20.2, Serial0/0
C 192.168.20.0 is directly connected Serial0/0
C 192.168.10.0 is directly connected, FastEthernet0/0
• The I means IGRP-injected routes. The 100 in [100/160360] is the
administrative distance of IGRP. The 160,360 is the composite
metric. The lower the composite metric, the better the route.
130
Debug Commands
debug ip igrp events Command
summary of the IGRP routing information that is running on the
network.
131