Académique Documents
Professionnel Documents
Culture Documents
The series of diagrams below reveal the cable types used for various
device connectivity.
Catalyst Switch
Management Console
Internet cloud
Aux 0
Modem
Remote computer Modem
3
Switch
Host Straight Through cable
Cross Over cable Cross Over cable
Router HUB
First let’s setup the Hyperterminal from windows – for interfacing with
the Cisco Devices and issue commands. Here we go…
4
We’ll name our Session My_Lab. The next screen requires us to configure
the COM port to which we are going to connect our Cisco Device.
5
On clicking OK, we’ll see the below screen & we are ready to talk to
our CISCO Switch/Router !
6
IOS BASICS
Pressing the RETURN key takes us to the USER EXEC mode.
Switch>
The “>” prompt denotes user exec mode. To move into Privilege mode, we
use the “enable” command.
Switch>enable
Switch#
Switch#configure terminal
Switch(config)#
To get into any specific interface mode we have use the “interface”
command with relevant interface number. To configure parameters
specific to interface 1 of module 0, we issue the command as shown
below.
7
Switch(config-if)#exit
Switch(config)#
Switch(config)#exit
Switch#
Switch#disable
Switch>
Switch>exit
Config-if# ^Z
Switch#
Also note that we can use “?” whenever we want to see the various
commands available in a particular mode or want to find out what
commands begin with a certain letter etc. This can be easily observed
in the below case.
Router#?
Exec commands:
access-enable Create a temporary Access-List entry
access-profile Apply user-profile to interface
access-template Create a temporary Access-List entry
archive manage archive files
cd Change current directory
<output omitted>
If we typed a wrong spelling & try to use help the output will display
as “Unrecognized command”. The same message is displayed even if we try
to use help when no further arguments are possible (or wrong arguments
used). Look at the below examples...
Router#show router ?
% unrecognized command
Router#show ip a
% Ambiguous command: "show ip a"
Router#show ?
access-expression List access expression
access-lists List access lists
accounting Accounting data for active sessions
aliases Display alias commands
arp ARP table
<output omitted>
Router#sh (tab)
Router#show
There are some shortcut keys that’ll help us to work with IOS faster.
Their description & use is given below.
Shortcut keys to access your CLI mode
Switching Labs
11
Assume we are on a Switch console and the switch’s ready – we see the
below message
Switch>enable
Switch# The prompt has changed from “>” to “#”. if you see “#” after
the hostname you are in Privilege mode
To get back from privilege mode to user exec mode use the command
disable
Switch#disable
Switch>
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# This prompt indicates global configuration mode
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface Fastethernet 0/1
Switch(config-if)#
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface Fastethernet 0/1
Switch(config-if)#description Host1
Switch#show running-config
Building configuration...
12
Let’s see some more basic show commands. (All show commands work only
in privilege mode)
We can also observe that it’s sufficient to use the first few letters
of the keyword Fastethernet – once these letters identify the unique
command, the balance letters needn’t be typed !
Switch#Show spanning-tree
No spanning tree instances exist.
Switch#show running-config
Building configuration...
Current configuration : 866 by
version 12.1
!
hostname Switch
!
interface FastEthernet0/1
description Host1
no ip address
<output omitted>
!
interface FastEthernet0/12
no ip address
!
interface Vlan1
no ip address
no ip route-cache
13
shutdown
!
line con 0
line vty 5 15
!
End
Switch#Show startup-config
Building configuration...
Current configuration : 866 bytes
!
version 12.1
!
hostname Switch
!
!
interface FastEthernet0/1
description Host1
no ip address
!
!
interface FastEthernet0/12
no ip address
!
interface Vlan1
no ip address
no ip route-cache
shutdown
!
line con 0
line vty 5 15
!
end
Switch#show mac-address-table
Mac Address Table
------------------------------------------
Vlan Mac Address Type Ports
---- ----------- ---- -----
No entries are seen! Let’s connect a host (computer) to port no. 1 and
generate some traffic from it.
Switch2950#sh mac-address-table
Mac Address Table
------------------------------------------
Vlan Mac Address Type Ports
---- ----------- ---- -----
1 0040.33a0.4bc7 Dynamic Fa0/1
The above table reveals the mac address of the host connected to
interface fa0/1. It also reveals that this is a dynamically learnt
entry.
F0/12 F0/12
Switch A Switch B
SwitchA#sh mac-address-table
Mac Address Table
------------------------------------------
Vlan Mac Address Type Ports
---- ----------- ---- -----
1 0000.0000.0002 Dynamic Fa0/1
1 0000.0000.0001 Dynamic Fa0/2
1 0000.0000.000A Dynamic Fa0/12
1 0000.0000.000B Dynamic Fa0/12
1 0000.0000.00B1 Dynamic Fa0/12
1 0000.0000.00B2 Dynamic Fa0/12
Total Mac Addresses for this criterion: 6
We observe that this switch reveals the cascaded switch B’s connected
host mac addresses and switch B’s Base Mac address (0000.0000.00B1) &
switch B’s cascade interface Fa0/12 Mac address (0000.0000.00B2) also.
A similar output would be seen for switch B’s mac table (shown below).
The base Mac Address is common for the entire switch while every
interface of the switch has a unique Mac address of its own also.
SwitchB#sh mac-address-table
Mac Address Table
------------------------------------------
Vlan Mac Address Type Ports
---- ----------- ---- -----
1 0000.0000.000A Dynamic Fa0/1
1 0000.0000.000B Dynamic Fa0/2
1 0000.0000.0001 Dynamic Fa0/12
1 0000.0000.0002 Dynamic Fa0/12
1 0000.0000.00A1 Dynamic Fa0/12
1 0000.0000.00A2 Dynamic Fa0/12
Total Mac Addresses for this criterion: 4
Switch#show version
Cisco Internetwork Operating System Software
IOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(12c)EA1, RELEASE
SOFTWARE (fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Sun 24-Nov-02 23:31 by antonino
Image text-base: 0x80010000, data-base: 0x80562000
To clear all the contents of the mac table, use the below command (this
will remove only dynamic entries. Static/Permanent entries will not be
removed).
Switch#clear mac-address-table *
Switch#erase startup-config
Switch(config)#hostname Switch2950
Switch2950(config)#
After configuring the secret password let see the output in show
running-config command
Switch2950#show run
Building configuration...
Current configuration : 939 bytes
<output omitted>
hostname Switch2950
!
enable secret 5 $1$z9ZE$mO/4D6DgtZcTrmzmyX3Ys/ (this is how the
encrypted password is seen)
!
<output omitted>
End
Switch2950#sh run
Building configuration...
Current configuration : 939 bytes
<output omitted>
hostname Switch2950
!
enable password cisco (our password is in clear text which is in
readable format)
!
<output omitted>
end
Switch2950(config)#line console 0
Switch2950(config-line)#login
% Login disabled on line 0, until 'password' is set
Switch2950(config-line)#password cisco
Switch#show running-config
!
line con 0
password cisco
login
!
<Out put omitted>
18
no ip address
!
interface FastEthernet0/9
no ip address
!
interface FastEthernet0/10
no ip address
!
interface FastEthernet0/11
no ip address
!
interface FastEthernet0/12
!
interface Vlan1
no ip address
shutdown
!
ip http server
!
!
line con 0
password cisco
login
line vty 0 4
line vty 5 15
!
End
Note: if both secret and enable passwords exist, only secret will be
used to get into privilege mode.
Let’s say we have some remote administrators who’ll logon into this
switch remotely. (They can do so because Cisco switches run terminal
services). However, setting the vty password is a must for telnet
access & this is how we do it.
Switch2950(config)#line vty 0 15
Switch2950(config-line)#login
% Login disabled on line 1, until 'password' is set
% Login disabled on line 2, until 'password' is set
% Login disabled on line 3, until 'password' is set
% Login disabled on line 4, until 'password' is set
% Login disabled on line 5, until 'password' is set
% Login disabled on line 6, until 'password' is set
% Login disabled on line 7, until 'password' is set
% Login disabled on line 8, until 'password' is set
% Login disabled on line 9, until 'password' is set
% Login disabled on line 10, until 'password' is set
% Login disabled on line 11, until 'password' is set
% Login disabled on line 12, until 'password' is set
% Login disabled on line 13, until 'password' is set
% Login disabled on line 14, until 'password' is set
% Login disabled on line 15, until 'password' is set
% Login disabled on line 16, until 'password' is set
20
Switch2950>enable
Switch2950#configure terminal
Switch2950(config)#interface vlan 1
Switch2950(config-if)#ip address 1.1.1.1 255.0.0.0 (this is the command
to configure ip address for an interface).
So, we configure the IP address to VLAN1 (we’ll learn more about vlan
later).
Let’s now see how we can control the speed & Duplex operation of the
switch
Note : Duplex will not be set until speed is set to non-auto value
Switch2950(config-if)#speed 10
Switch2950(config-if)#duplex half
Had the switch auto negotiated, the output would have been
Port Name Status Vlan Duplex Speed Type
Fa0/1 Host1 connected 1 a-half a-10 10/100BaseTX
Fa0/2 notconnect 1 auto auto 10/100BaseTX
Fa0/3 notconnect 1 auto auto 10/100BaseTX
Fa0/4 notconnect 1 auto auto 10/100BaseTX
Fa0/5 notconnect 1 auto auto 10/100BaseTX
Fa0/6 notconnect 1 auto auto 10/100BaseTX
Fa0/7 notconnect 1 auto auto 10/100BaseTX
Fa0/8 notconnect 1 auto auto 10/100BaseTX
Fa0/9 notconnect 1 auto auto 10/100BaseTX
Fa0/10 notconnect 1 auto auto 10/100BaseTX
Fa0/11 notconnect 1 auto auto 10/100BaseTX
Fa0/12 notconnect 1 auto auto 10/100BaseTX
PORT SECURITY : Let’s now learn how switch interfaces can be configured
to allow connectivity only for pre-defined hosts (based on their Mac-
Addresses). This is done on a per interface basis.
Before configuring port security for the interfaces, let’s see the
output of “show port-security” command
Switch#show port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
(Count) (Count) (Count)
-----------------------------------------------------------------------
-----------------------------------------------------------------------
Total Addresses in System : 0
Max Addresses limit in System : 1024
Now let’s configure port security for interface Fa 0/1 – only system
with mac id 0000.0000.a111 should be allowed connectivity – any other
device connection to this interface should result in the interface
shutting down.
Switch2950#sh run
Building configuration...
Current configuration : 1089 bytes
!
hostname Switch2950
!
enable secret 5 $1$z9ZE$mO/4D6DgtZcTrmzmyX3Ys/
enable password cisco
!
!
22
interface FastEthernet0/1
switchport mode access
switchport port-security
switchport port-security mac-address 0000.0000.A111
no ip address
duplex half
speed 10
<output omitted>
Switch2950#show port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
(Count) (Count) (Count)
-----------------------------------------------------------------------
Fa0/1 1 1 0 Shutdown
-----------------------------------------------------------------------
Total Addresses in System : 0
Max Addresses limit in System : 1024
We can also ask the switch to auto-learn the mac address of the
connected host using the keyword “sticky”
Switch2950#show running-config
Building configuration...
Current configuration : 1089 bytes
!
hostname Switch2950
!
enable secret 5 $1$z9ZE$mO/4D6DgtZcTrmzmyX3Ys/
enable password cisco
!
!
interface FastEthernet0/2
switchport mode access
switchport port-security
switchport port-security mac-address sticky
switchport port-security mac-address 0000.0000.A112
no ip address
<output ommitted>
Switch2950#show port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
(Count) (Count) (Count)
-----------------------------------------------------------------------
Fa0/1 1 1 0 Shutdown
Fa0/2 1 1 0 Shutdown
-----------------------------------------------------------------------
Total Addresses in System : 0
Max Addresses limit in System : 1024
23
Switch2950#sh run
Building configuration...
Current configuration : 1089 bytes
!
hostname Switch2950
!
enable secret 5 $1$z9ZE$mO/4D6DgtZcTrmzmyX3Ys/
enable password cisco
!
interface FastEthernet0/3
switchport mode access
switchport port-security
switchport port-security maximum 4
no ip address
<output omitted>
Switch2950#show port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
(Count) (Count) (Count)
-----------------------------------------------------------------------
Fa0/1 1 1 0 Shutdown
Fa0/2 1 1 0 Shutdown
Fa0/3 4 0 0 Shutdown
-----------------------------------------------------------------------
Total Addresses in System : 0
Max Addresses limit in System : 1024
The security action is shutdown by default & we can change this among
one of 3 modes.
If we chose protect
24
Switch2950#sh run
Building configuration...
Current configuration : 1089 bytes
!
hostname Switch2950
!
enable secret 5 $1$z9ZE$mO/4D6DgtZcTrmzmyX3Ys/
enable password cisco
!
interface FastEthernet0/4
switchport mode access
switchport port-security
switchport port-security violation protect
switchport port-security mac-address 0000.0000.A131
no ip address
<output omitted>
Switch2950#show port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
(Count) (Count) (Count)
-----------------------------------------------------------------------
Fa0/1 1 1 0 Shutdown
Fa0/2 1 1 0 Shutdown
Fa0/3 4 0 0 Shutdown
Fa0/4 1 0 0 Protect
-----------------------------------------------------------------------
Total Addresses in System : 0
Max Addresses limit in System : 1024
Switch A Switch B
1000.0000.000A 0000.0000.000A
With reference to the above diagram, the Root Bridge is Switch B
because it has the lowest mac-address 0000.0000.000A. Switch A will be
the non-root bridge. Let’s see the output of show spanning-tree command
now.
SwitchB#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0000.0000.000A
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
SwitchA#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0000.0000.000A
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Switch2950#show vlan
VLAN Name Status Ports
---- ------------------------ --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Tran1 Tran2
---- ----- ------ ---- ------ ------ -------- --- ------- ----- -----
1 enet 100001 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - srb 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
We can observe that all the interfaces are associated with the default
VLAN1.
Now let’s get on to creating STATIC VLANs & define port associations.
Two possibilities exist. One from the privilege mode (using VLAN
Database) & the second from global config mode.
26
Switch2950#vlan database
Switch2950(vlan)#vlan 2 name CCNA – creating VLAN with id 2 & name CCNA
VLAN 2 added:
Name: CCNA
Switch2950(vlan)#apply – to save the configuration
APPLY completed.
Switch2950(vlan)#exit – implicit save & exit
APPLY completed.
Exiting....
Using “^Z” will not save the config & we will also exit from vlan
database.
Switch2950#show vlan
Switch2950#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12
2 CCNA active Fa0/4
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
<output omitted>
You are seeing the output from show run command after assigning the
membership for the interface 4
Switch2950#show run
Building configuration...
27
!
Current configuration : 98 bytes
!
interface FastEthernet0/4
switchport access vlan 2
switchport mode access
no ip address
end
Let’s repeat the above using the second method - Creating vlan using
global configuration mode
Switch2950#configure terminal
Switch2950(config)#vlan 3
Switch2950(config-vlan)#name CCNP
Switch2950(config-vlan)#exit
We can see that the outcome is the same wherever we create the VLAN
from.
If we wanted to know the VTP Domain name, version used, VTP switch
mode, we use the command “show vtp status”
Switch2950#vlan database
Switch2950(vlan)#vtp client
Setting device to VTP CLIENT mode.
Switch2950#configure terminal
28
Now we are going to change vtp domain name from “Null” to “Cisco” using
vlan database method
Switch2950#vlan database
Switch2950(vlan)#vtp domain Cisco
Changing VTP domain name from Null to Cisco
Switch2950(vlan)#exit
APPLY completed.
Exiting....
Switch2950#configure terminal
Switch(config)#vtp domain Cisco
Changing VTP domain name from Null to Cisco
Let’s see how mac address table reflects the vlan configuration in the
below case.
F0/12 F0/12
Switch A Switch B
Vlan 1
Vlan 2
Switch A & B’s mac address table & interface status reveal -
SwitchA#sh mac-address-table
Mac Address Table
------------------------------------------
Vlan Mac Address Type Ports
---- ----------- ---- -----
1 0000.0000.0002 Dynamic Fa0/1
2 0000.0000.0001 Dynamic Fa0/2
1 0000.0000.000A Dynamic Fa0/12
2 0000.0000.000B Dynamic Fa0/12
SwitchB#sh mac-address-table
Mac Address Table
------------------------------------------
Vlan Mac Address Type Ports
---- ----------- ---- -----
1 0000.0000.000A Dynamic Fa0/1
2 0000.0000.000B Dynamic Fa0/2
1 0000.0000.0001 Dynamic Fa0/12
1 0000.0000.0002 Dynamic Fa0/12
SwitchA#sh mac-address-table
Mac Address Table
------------------------------------------
Vlan Mac Address Type Ports
---- ----------- ---- -----
1 0000.0000.000A Dynamic Fa0/1
2 0000.0000.000B Dynamic Fa0/2
3 0000.0000.AAAA Static Fa0/11
1 0000.0000.0001 Dynamic Fa0/12
31
Routing
33
Static Routes
There are actually two ways that a router can learn a static route.
First, a router will look at its active interfaces, examine the
addresses configured on the interfaces and determine the corresponding
network numbers, and populate the routing table with this information.
This is commonly called a connected route.
Router_1#show ip route
The top portion of the display for this command has a table of codes.
These codes, which describe a type of route that may appear in the
routing table, are shown in the first column at the bottom part of the
display.
192.168.1.1 172.16.0.1
S0 172.16.0.2
S0 192.168.1.2
S1 S1
R1 R2 R3
E0 E0 E0
10.0.0.1 20.0.0.1 30.0.0.1
To configure a static route for IP, use one of these two commands:
-or-
The first parameter that you must specify is the destination network
number.
After the subnet mask parameter, you have two ways to specify how to
reach the destination network:
(i)By specifying the next hop neighbor’s IP address (safe to use this
– as this is suitable for all environments)
or
R1#sh run
Building configuration...
version 12.2
interface Ethernet0
ip address 10.0.0.1 255.0.0.0
!
interface Serial0
ip address 192.168.1.1 255.255.255.0
no fair-queue
clockrate 64000
!
ip route 20.0.0.0 255.0.0.0 192.168.1.2
ip route 30.0.0.0 255.0.0.0 192.168.1.2
ip route 172.16.0.0 255.255.0.0 192.168.1.2
ip http server
!
line con 0
transport input none
line aux 0
!
end
The following shows the routing table of a Router (R1 – the leftmost
Router) with Static Routes configured.
R1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B –
BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter
area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external
type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E –
EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-
IS inter area * - candidate default, U - per-user static route,
o – ODR P - periodic downloaded static route
Two values in “[1 / 0]” represent the Administrative Distance (AD) &
Metric value respectively (details discussed in separate section).
Suffice to remember that the first value is the AD value and its
default value is “1” for a static route. The next value indicates the
metric & the default value of a statically configured route is always
“0”.
via 192.168.1.2 represents the gateway address, i.e. the next router’s
interface IP address – this is the interface through which the data has
to travel from R1 to reach destination Network 20.0.0.0 (which is
connected to router R2).
36
R2#sh run
Building configuration...
Current configuration : 654 bytes
(irrelevant output omitted)
!
interface Ethernet0
ip address 20.0.0.1 255.0.0.0
!
interface Serial0
ip address 172.16.0.1 255.255.0.0
clockrate 64000
!
interface Serial1
ip address 192.168.1.2 255.255.255.0
!
no ip http server
ip classless
ip route 10.0.0.0 255.0.0.0 Serial1
ip route 30.0.0.0 255.0.0.0 172.16.0.2
!
line con 0
line aux 0
line vty 0 4
password cisco
login
!
!
end
R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS
level-2 ia - IS-IS inter area, * - candidate default, U - per-
user static route o - ODR, P - periodic downloaded static route
In this example, there are three connected routes, and two static
routes. The static route (10.0.0.0) is treated as a directly connected
route, since it was created by specifying the interface to exit the
router – “SERIAL1”.
37
BACKUP ROUTE
Please note that you can create multiple static routes to the same
destination. For instance, you might have primary and backup paths to
the destination. For the primary path, use the default administrative
distance value. For the backup path, use a number higher than this,
such as 2. Once you have configured a backup path, the router will use
the primary path, and if the interface on the router fails for the
primary path, the router will use the backup route.
192.168.1.1
S0 172.16.0.2
192.168.1.2 172.16.0.1
S0 S1
S1
R1 R2 S1 R3
200.0.0.1 S0
E0 E0 E0
200.0.0.2
10.0.0.1 20.0.0.1 30.0.0.1
R3#sh run
Building configuration...
Current configuration : 725 bytes
!
version 12.2
!
enable password cisco
(irrelevant output omitted)
!
interface Ethernet0
ip address 30.0.0.1 255.0.0.0
duplex auto
speed auto
!
interface Serial0
ip address 172.16.0.2 255.255.0.0
!
interface Serial1
ip address 200.0.0.2 255.255.255.0
38
!
ip route 20.0.0.0 255.0.0.0 172.16.0.1
ip route 20.0.0.0 255.0.0.0 Serial0 2
ip http server
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
password cisco
login
!
end
R3#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B -
BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter
area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external
type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E –
EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-
IS inter area * - candidate default, U - per-user static route,
o – ODR P - periodic downloaded static route
Mark here that even though we have configured 20.0.0.0 network with the
outgoing interface Serial0 , it has not been populated in the routing
table because of higher Administrative Distance number.
172.16.0.1 172.16.0.2
S0 S1
R2 R3
E0 E0
20.0.0.1 30.0.0.1
Note that if a router does not have any path in its routing table
telling it how to reach a destination, and the router receives a packet
destined for this network, the router will drop the packet. Therefore,
a default route can serve as a catch-all: if there is no specific path
to the destination, the router will use the default route to reach it.
To set up a default route, use the following syntax for a static route:
-or-
R3#sh run
Building configuration...
(irrelevant output omitted)
interface Ethernet0
ip address 30.0.0.1 255.0.0.0
duplex auto
speed auto
!
interface Serial1
ip address 172.16.0.2 255.255.0.0
!
ip route 0.0.0.0 0.0.0.0 Serial1
line con 0
!
end
R3#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B –
BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter
area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external
type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E –
EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-
IS inter area * - candidate default, U - per-user static route,
o – ODR P - periodic downloaded static route
RIP
We shall have a simple setup to learn how RIP routing is enabled and
also try to find out what happens dynamically when a network change
occurs.
1.1.1.1 3.3.3.3
L0
11.0.0.1 L0
11 11.0.0.2
Router1 Serial 1 Router3
2
Serial 0
1. To create a loopback interface use the “interface loopback <id>”
command. This is very similar to a regular interface command – a
loopback automatically gets created.
Router1(config)#int loopback 0
Router1(config-if)#ip address 1.1.1.1 255.0.0.0
Rotuer1(config-if)#exit
Rotuer3(config)#int loopback 0
Rotuer3(config-if)#ip address 3.3.3.3 255.0.0.0
Rotuer3(config-if)#exit
Router1#sh controller s 1
HD unit 0, idb = 0x29A524, driver structure at 0x2A1AE8
buffer size 1524 HD unit 0, V.35 DTE cable
cpb = 0xE1, eda = 0x4940, cda = 0x4800
RX ring with 16 entries at 0xE14800
00 bd_ptr=0x4800 pak=0x2A5AFC ds=0xE1ECC8 status=00 pak_size=0
01 bd_ptr=0x4814 pak=0x2A584C ds=0xE1E60C status=00 pak_size=0
02 bd_ptr=0x4828 pak=0x2A559C ds=0xE1DF50 status=00 pak_size=0
03 bd_ptr=0x483C pak=0x2A52EC ds=0xE1D894 status=00 pak_size=0
04 bd_ptr=0x4850 pak=0x2A503C ds=0xE1D1D8 status=00 pak_size=0
<output omitted>
<output omitted>
The above reveals that Router3’s serial interface is the DCE end &
implies that we need to configure the clockrate on Router3’s S0
interface using the “clock rate <value>” command.
We can also view the enabled ROUTED PROTOCOL using “show protocols”
command.
(This reveals that IP is enabled).
Rotuer3#show protocols
Global values:
Internet Protocol routing is enabled
Ethernet0 is administratively down, line protocol is down
Ethernet1 is administratively down, line protocol is down
Loopback0 is up, line protocol is up
Internet address is 3.3.3.3/8
Serial0 is up, line protocol is up
Internet address is 11.0.0.2/8
Serial1 is administratively down, line protocol is down
Router3#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B –
BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter
area * - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
If status shows as up, the link is OK. If it shows as down, the network
is down. If it’s administratively down, it means that the network has
been manually shut down using the “shutdown” command. If protocol shows
as down, it means that the line protocol is not properly configured.
Typically either the encapsulation or the clock rate is not configured
properly.
Router3(config)#router rip
Router3(config-router)#Network 3.0.0.0
Router3(config-router)#Network 11.0.0.0
Router3(config-router)#end
Router3#
Router3#show running-config
Building configuration...
no ip address
shutdown
!
interface Ethernet1
no ip address
shutdown
!
interface Serial0
ip address 11.0.0.2 255.0.0.0
clockrate 64000 <DCE interface>
!
interface Serial1
no ip address
shutdown
!
router rip
network 3.0.0.0
network 11.0.0.0
!
ip kerberos source-interface any
ip classless
ip http server
!
line con 0
transport input none
line aux 0
line vty 0 4
password cisco
login
!
end
similarly in Router1,
Router1(config)#router rip
Router1(config-router)#network 1.0.0.0
Router1(config-router)#network 11.0.0.0
Router1(config-router)#end
Router1#show running-config
Building configuration...
hostname Router1
!
interface Loopback0
ip address 1.1.1.1 255.0.0.0
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 11.0.0.1 255.0.0.0
44
!
router rip
network 1.0.0.0
network 11.0.0.0
!
end
<output omitted>
Router1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B –
BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter
area* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Rotuer3#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B –
BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter
area * - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Router1#sh ip protocols
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 24 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
(Displays various timer values)
Outgoing update filter list for all interfaces is
Incoming update filter list for all interfaces is
Redistributing: rip
Default version control: send version 1, receive any version
(Configured RIP Version is 1)
Interface Send Recv Triggered RIP Key-chain
Loopback0 1 1 2
Serial1 1 1 2
Automatic network summarization is in effect
Routing for Networks: (Displays networks published)
1.0.0.0
11.0.0.0
Routing Information Sources:
Gateway Distance Last Update
11.0.0.2 120 00:00:16
Distance: (default is 120) (Displays default AD value)
Rotuer3#debug ip rip
RIP protocol debugging is on
Rotuer3#
01:05:49: RIP: received v1 update from 11.0.0.1 on Serial0
(V1 represents version 1)
01:05:49: 1.0.0.0 in 1 hops (This is what is received from router1)
01:05:59: RIP: sending v1 update to 255.255.255.255 via Loopback0 (3.3.3.3)
(Broadcast update sent)
01:05:59: RIP: build update entries
46
Observe that full routing table is not sent as updates in all directions –
because of split horizon rule. Let’s see how similar the debug output is in
router1
Router1#debug ip rip
RIP protocol debugging is on
Router1#
01:07:50: RIP: received v1 update from 11.0.0.2 on Serial1
01:07:50: 3.0.0.0 in 1 hops
01:08:05: RIP: sending v1 update to 255.255.255.255 via Loopback0 (1.1.1.1)
01:08:05: RIP: build update entries
01:08:05: network 3.0.0.0 metric 2
01:08:05: network 11.0.0.0 metric 1
01:08:05: RIP: sending v1 update to 255.255.255.255 via Serial1 (11.0.0.1)
01:08:05: RIP: build update entries
01:08:05: network 1.0.0.0 metric 1
01:08:18: RIP: received v1 update from 11.0.0.2 on Serial1
01:08:18: 3.0.0.0 in 1 hops
01:08:33: RIP: sending v1 update to 255.255.255.255 via Loopback0 (1.1.1.1)
01:08:33: RIP: build update entries
01:08:33: network 3.0.0.0 metric 2
01:08:33: network 11.0.0.0 metric 1
01:08:33: RIP: sending v1 update to 255.255.255.255 via Serial1 (11.0.0.1)
01:08:33: RIP: build update entries
01:08:33: network 1.0.0.0 metric 1
Rotuer1#undebug all
X 1.1.1.1 3.3.3.3
L0 L0
11.0.0.1
11.0.0.2
Router1 Serial 1 Router3
Serial 0
Router1(config)#int loopback 0
Router1(config-if)#shut
47
Router1(config-if)#
01:21:17: %LINK-5-CHANGED: Interface Loopback0, changed state to
administratively down
Router1#debug ip rip
RIP protocol debugging is on
01:21:17: RIP: sending v1 flash update to 255.255.255.255 via Serial1
(11.0.0.1) (this indicates a Triggered Update)
01:21:17: RIP: build flash update entries
01:21:17: network 1.0.0.0 metric 16
(metric 16 means infinity for RIP – route poisoning)
01:21:19: RIP: received v1 update from 11.0.0.2 on Serial1
01:21:19: 1.0.0.0 in 16 hops (inaccessible)
(“inaccessible” implies that Poison-Reverse message is received from Router3)
01:21:22: RIP: sending v1 update to 255.255.255.255 via Serial1 (11.0.0.1)
01:21:22: RIP: build update entries
01:21:22: network 1.0.0.0 metric 16
Router1(config-if)#^Z
Router1#sh ip route
01:21:30: %SYS-5-CONFIG_I: Configured from console by consoleroute
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
IGRP
1.1.1.1 3.3.3.3
L0
100.0.0.1 L0
11 100.0.0.2
Router1 Serial 1 Router3
2
Serial 0
Router1#sh run
Building configuration...
<output omitted>
!
interface Loopback0
ip address 1.1.1.1 255.0.0.0
!
interface Serial1
ip address 100.0.0.1 255.0.0.0
<output omitted>
!
End
Router1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B -
BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS
inter area * - candidate default, U - per-user static route, o –
ODR P - periodic downloaded static route
“router igrp <AS number>” command & publish connected networks using
“network <network id>” command.
Router1(config-router)#network 100.0.0.0
(publish directly connected networks)
Router1#sh run
Building configuration...
<output omitted>
!
interface Loopback0
ip address 1.1.1.1 255.0.0.0
!
interface Serial1
ip address 100.0.0.1 255.0.0.0
!
router igrp 100
network 1.0.0.0
network 100.0.0.0
!
<output omitted>
!
End
Router3#sh run
Building configuration...
Current configuration : 776 bytes
!
<output omitted>
!
interface Loopback0
ip address 3.3.3.3 255.0.0.0
!
interface Serial0
ip address 100.0.0.2 255.0.0.0
clockrate 64000
!
router igrp 100
network 3.0.0.0
network 100.0.0.0
!
<output omitted>
!
end
After configuring IGRP let’s see if the routing tables of Routers 1 & 3
have information about IGRP learnt routes.
Router1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B –
50
Router3#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B –
BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter
area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external
type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E –
EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-
IS inter area * - candidate default, U - per-user static route,
o – ODR P - periodic downloaded static route
Router1#sh ip protocols
Routing Protocol is "igrp 100"
Sending updates every 90 seconds, next due in 37 seconds
Invalid after 270 seconds, hold down 280, flushed after 630
Outgoing update filter list for all interfaces is
Incoming update filter list for all interfaces is
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
IGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
IGRP maximum hopcount 100
IGRP maximum metric variance 1
Redistributing: igrp 100
Routing for Networks:
1.0.0.0
100.0.0.0
Routing Information Sources:
Gateway Distance Last Update
100.0.0.2 100 00:00:09
Distance: (default is 100)
Router3#sh ip protocols
Routing Protocol is "igrp 100"
51
X 1.1.1.1 3.3.3.3
L0 L0
100.0.0.1
100.0.0.2
Router1 Serial 1 Router3
Serial 0
Router1(config)#int loopback 0
Router1(config-if)#shutdown
52
Router1#sh run
Building configuration...
Observe the debug output after shutting down the loopback 0 interface
of router1 the metric value for network 1.0.0.0 goes to 4294967295 –
representing infinity.
The routing table now reflects this change as “possibly down” – doesn’t
remove the entry immediately – waits for hold-down timer to expire and
then decides to remove the entry/reinstate the entry if the network has
come up!
Rotuer3#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
EIGRP
S0
25.0.0.1 S0
1.1.1.1 25.0.0.2 3.3.3.3
L0 Router1 L0
50.0.0.1 Router3
50.0.0.2
S1 S1
BASIC CONFIGURATION
In this case, we’ll consider a slightly different scenario where we
have two paths to a destination. We’ll be able to understand redundancy
& load balancing also with this case study.
Let’s first configure the Routers according to the above diagram &
observe the routing table without configuring the routing protocols.
Router1(config)#
Router1(config)#int loop 0
Router1(config-if)#ip add 1.1.1.1 255.0.0.0
Router1(config-if)#exit
Router1(config)#int s0
Router1(config-if)#ip add 25.0.0.1 255.0.0.0
Router1(config-if)#no shut
Router1(config-if)#exit
Router1(config)#int s1
Router1(config-if)#ip add 50.0.0.1 255.0.0.0
Router1(config-if)#no shut
Router1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B –
BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter
area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external
type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E –
EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-
IS inter area * - candidate default, U - per-user static route,
o – ODR P - periodic downloaded static route
Router3(config)#int loop 0
Router3(config-if)#ip add 3.3.3.3 255.0.0.0
Router3(config-if)#exit
Router3(config)#int s0
Router3(config-if)#ip add 25.0.0.2 255.0.0.0
Router3(config-if)#clock rate 64000
Router3(config-if)#no shut
54
Router3(config-if)#exit
Router3(config)#int s1
Router3(config-if)#ip add 50.0.0.2 255.0.0.0
Router3(config-if)#clock rate 64000
Router3(config-if)#no shut
Router3#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B –
BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter
area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external
type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E –
EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-
IS inter area * - candidate default, U - per-user static route,
o – ODR P - periodic downloaded static route
ENABLING EIGRP
Now, we’ll enable the routing protocol on both the routers using
“Router EIGRP <AS number>” command & publish Networks using
“Network <Network id>” command
Router1#sh run
Building configuration...
<output omitted>
interface Serial0
ip address 25.0.0.1 255.0.0.0
!
interface Serial1
ip address 50.0.0.1 255.0.0.0
!
router eigrp 200
network 1.0.0.0
network 25.0.0.0
network 50.0.0.0
auto-summary (Observe this is automatically added!)
55
no eigrp log-neighbor-changes
!
<output omitted>
End
Router3#sh run
Building configuration...
<output omitted>
interface Serial0
ip address 25.0.0.2 255.0.0.0
clockrate 64000
!
interface Serial1
ip address 50.0.0.2 255.0.0.0
clockrate 64000
!
router eigrp 200
network 3.0.0.0
network 25.0.0.0
network 50.0.0.0
auto-summary (Automatically added indicating Auto-summarisation)
no eigrp log-neighbor-changes)
<output omitted>
End
As there are 2 equally good paths between the routers, 2 routes must be
seen in the routing table of these routers. We can also see “D” in the
first column of the highlighted entry indicating EIGRP learnt routes.
Router1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B –
BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter
area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external
type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E –
EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-
IS inter area * - candidate default, U - per-user static route,
o – ODR P - periodic downloaded static route
The above indicates two paths to reach network 3.0.0.0 from Router1. A
similar table can be seen in Router3.
Router3#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B –
BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter
area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external
type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E –
56
The “show ip route eigrp” command displays only EIGRP learnt routes.
In this case, the same neighbor is learnt via 2 paths & hence 2
entries. Had there been only one path between the 2 routers, only one
entry would be seen.
If both paths were with different metrics, the one with the best metric
would have been the successor & the other feasible successor. Then it
would display 1 successor & not 2 successors as we’ll see in the next
section.
“P”in the first column indicates that it’s in the passive state.
S0
25.0.0.1 S0
1.1.1.1 25.0.0.2 3.3.3.3
L0 Router1 L0
50.0.0.1 Router3
50.0.0.2
S1 S1
We’ll change the bandwidth of both the paths ensuring they have
different metrics.
Router1#conf t
Router1(config)#int s1
Router1(config-if)#bandwidth 128
Router3#conf t
Router3(config)#int s1
Router3(config-if)#bandwidth 128
Having changed the metrics, we now have one path which is better than
the other. So we’ll be able to see only the best path in the Routing
table.
Router1#sh ip route
If we see the topology table, we’ll be able to see both – the best
(successor) & the next best (feasible successor) paths
Router3#sh ip route
Back up path
If the best path goes down, the feasible successor immediately gets
installed in the routing table. This is how the feasible successor
works like a backup path.
S0
25.0.0.1 S0
1.1.1.1 X 25.0.0.2 3.3.3.3
L0 Router1 L0
50.0.0.1 Router3
50.0.0.2
S1 S1
Router1#conf t
Router1(config)#int s0
Router1(config-if)#shutdown
Router1#sh ip route