Download as pdf or txt
Download as pdf or txt
You are on page 1of 86

CCNA Routing and Switching | (Exam: 200-125 CCNA)

LAB WORKBOOK

Written by : Bipul Roy CCIE x2#36690

1
Device and Cable Requirement:
Cisco 1841 x3

Cisco 2960 x2

Cisco 3560 x2

PC x5

Serial Cable x1

Ethernet Cable x11

Note:- Only R1 and R3 is connected over Serial cable and rest of all devices are
connected over Ethernet cable.

2
2.1 Static Routing

 Configure IP address as per Diagram 2.


 Configure static routing to reach from subnet 172.16.10.0/24 to 172.16.30.0/24 and vice-
versa.
 Shutdown the Serial link between R2 and R3.
 Configure IP address on PC’s as below and test the connectivity between PC’s using ping
 PC-1 = 172.16.20.5/24
 PC-2 = 172.16.20.10/24
 PC-3 = 172.16.30.5/24
 PC-4 = 172.16.30.10/24

Configuration

R1:

R1(config)#interface fastEthernet 0/0


R1(config-if)#ip address 172.16.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#interface fastEthernet 0/1
R1(config-if)#ip address 172.16.13.1 255.255.255.0
R1(config-if)#no shutdown

R1(config)#ip route 172.16.30.0 255.255.255.0 172.16.13.3


R1(config)#ip route 172.16.20.0 255.255.255.0 172.16.12.2

R2:

R2(config)#interface fastEthernet 0/0


R2(config-if)#ip address 172.16.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface fastEthernet 0/1
R2(config-if)#ip address 172.16.20.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface serial 0/1/0
R2(config-if)#ip address 172.16.23.2 255.255.255.0
R2(config-if)#shutdown

R2(config)#ip route 172.16.30.0 255.255.255.0 172.16.12.1

3
R3:

R3(config)#interface fastEthernet 0/0


R3(config-if)#ip address 172.16.13.3 255.255.255.0
R3(config-if)#no shutdown
R3(config)#interface fastEthernet 0/1
R3(config-if)#ip address 172.16.30.3 255.255.255.0
R3(config-if)#no shutdown
R3(config)#interface serial 0/1/0
R3(config-if)#ip address 172.16.23.3 255.255.255.0
R3(config-if)#shutdown

R3(config)#ip route 172.16.20.0 255.255.255.0 172.16.13.1

PC-1:

PC-2:

PC-3:

4
PC-4:

Varification

In CCNA we will see two type of routing mechanism, one is Static Routing and another one is
Dynamic Routing. In the static routing mechanism we create route statically/manually. ip route
command is used to configure the static route. Static Route implementation in a big network will
be nightmare for Network Administrator. Just keep in mind, when you are configuring Static
Route, you have to configure forwarding route and reverse route (two way path) for traffic/data
to reach destination.

Let me explain you in more detail, when you will start ping to IP 172.16.30.5 from PC-1, then
what would be Source and Destination IP of the Layer 3 header of ping packet.

Source IP (PC-1) – 172.16.20.5


Destination IP (PC-3) – 172.16.30.5

When you will start ping from PC-1, packet will go to R1’s Fa0/1 (Computer will check its own IP
and destination IP whether they are in same subnet or different subnet, in our case destination
IP is in different subnet. If destination IP in different subnet then for Routing Computer will send
the traffic to Gateway, in our case Router R2), then router will check the destination IP of the
Layer 3 header, which is 172.16.30.5. This is the reason IPv4 Class A, B and C is called
destination based Routing.

5
Then in the Routing Table it will find the path to reach destination. In the routing table it will find
which network/IP is matching with our destination IP – 172.16.30.5, So we need configure a
Static Route for Destination 172.16.30.0/24 with next HOP IP – 172.16.12.1.

Then it will see network 172.16.30.0/24 which will be pointing to IP 172.16.12.1 (Next-HOP IP).
That means if I want to reach destination 172.16.30.5 I have to go to R1 (172.16.12.1 is R1’s IP
used in Fa0/0). This process also called L3 lookup or Routing lookup. I hope now you know how
the traffic is reaching to destination. For CCNA this is enough, but there is lot you will come to
know in CCIE.

Before I start verification, I would like to tell you one thing, Ping is 2 way process. Sending ICMP
echo Request to Destination and destination is sending ICMP echo reply back to source. When
Ping request will reach to PC-3 then PC-3 will change Layer 3 header.

Source IP (PC-3) – 172.16.30.5


Destination IP (PC-1) – 172.16.20.5

And when ICMP echo reply will hit the R3’s interface Fa0/1, then R3 also will do the same
destination based lookup. On R3 we need a static route to reach 172.16.20.0/24 with the next
hop 172.16.13.1.

We have seen that Static Route is required on R2 for Destination 172.16.30.0/24 with next hop
IP – 172.16.12.1. Also we have seen that Static Route is required on R3 for destination
172.16.20.0/24 with next hop IP – 172.16.13.1. Both the router R2 and R3 is pointing traffic to
R1. What R1 will do now?

R1 needs two static routes, when traffic is coming from R3 it will send to R2 and when traffic will
come from R2 it will send to R3.

On R1 we need Static Route for Destination 172.16.20.0/24 with next hop IP – 172.16.12.2
(Traffic coming from R3) and another one is, for destination 172.16.30.0/24 with next hop IP –
172.16.13.3 (Traffic coming from R2).

First, let’s check IP address assignment on all three Routers.

R1#show ip interface brief


Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 172.16.12.1 YES manual up up

FastEthernet0/1 172.16.13.1 YES manual up up

6
R2#show ip interface brief
Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 172.16.12.2 YES manual up up

FastEthernet0/1 172.16.20.2 YES manual up up

Serial0/1/0 172.16.23.2 YES manual administratively down down

R3#show ip interface brief


Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 172.16.13.3 YES manual up up

FastEthernet0/1 172.16.30.3 YES manual up up

Serial0/1/0 172.16.23.3 YES manual administratively down down

Serial0/1/1 unassigned YES unset administratively down down

R2#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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 3 subnets


C 172.16.12.0 is directly connected, FastEthernet0/0 <<<Directly connected network>>>
C 172.16.20.0 is directly connected, FastEthernet0/1
S 172.16.30.0 [1/0] via 172.16.12.1 <<<Static Route>>>

7
On the above output we are seeing R2’s Routing table, on R2 one static route was configured
for destination 172.16.30.0/24 with next hop IP – 172.16.12.1. That means, if any traffic is come
from PC-1 or PC-2 and destined for network 172.16.30.0/24, it will pass the information to R1.

Static route is identified by “S” in the routing table and “C” for connected Network.

R3#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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 3 subnets


C 172.16.13.0 is directly connected, FastEthernet0/0 <<<Directly connected network>>>
S 172.16.20.0 [1/0] via 172.16.13.1 <<<Static Route>>>
C 172.16.30.0 is directly connected, FastEthernet0/1

On the above output we are seeing R3’s Routing table, on R3 one static route was configured
for destination 172.16.20.0/24 with next hop IP – 172.16.13.1. That means, if any traffic is come
from PC-3 or PC-4 and destined for network 172.16.20.0/24, it will pass the information to R1.

R1#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

8
Gateway of last resort is not set

172.16.0.0/24 is subnetted, 4 subnets


C 172.16.12.0 is directly connected, FastEthernet0/0
C 172.16.13.0 is directly connected, FastEthernet0/1
S 172.16.20.0 [1/0] via 172.16.12.2
S 172.16.30.0 [1/0] via 172.16.13.3

As we discussed earlier, on R1 we need two static routes, when traffic is coming from R3 it will
send to R2 and when traffic is coming from R2 it will send to R3.

On the above output we can see on R1, there are two Static Routes. One for Destination
172.16.20.0/24 with next hop IP – 172.16.12.2 (Traffic coming from R3 for destination
172.16.20.0/24) and another one is, for destination 172.16.30.0/24 with next hop IP –
172.16.13.3 (Traffic coming from R2 for destination 172.16.30.0/24).

*** You may notice there are two values inside the bracket “[1/0]”. First one is AD
(Administrative Distance) and second one is Metric. Always you will see metric “0” for static
route. Let me show you one more verification command to see a route.

R1#show ip route 172.16.30.0


Routing entry for 172.16.30.0/24
Known via "static", distance 1, metric 0 <<<AD and Metric>>>
Routing Descriptor Blocks:
* 172.16.13.3
Route metric is 0, traffic share count is 1

Now we will do the ping test.

From PC-1:

9
From PC-4:

10
2.2 Default Static Route

 Use the topology 5 and configure IP address as per diagram.


 R2 is Service Provider’s Router and 1000 of Servers are connected on it. One of the
Server has IP – 59.16.20.10/24 from Public Network.
 Configure one Static Route on R1 to reach all 1000 Servers from PC-1 and PC-2.
 Do only ping test from PC-1 and PC-2 to Server – 59.16.20.10.
 Configure IP address on PC’s as below
 PC-1 = 172.16.10.5/24
 PC-2 = 172.16.10.10/24

Configuration

Note:- R2 is a Service Provider’s Router. Basically you do not have to configure Service
Provider Router if you are working on Enterprise Network. I have given the configuration as
below you may configure R2 as same. SRV-1 (Server) also located in Internet, you do not have
to configure it in real world, so you may configure the IP address same as below.

R2:

R2(config)#interface fastEthernet 0/0

11
R2(config-if)#ip address 59.16.20.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface fastEthernet 0/1
R2(config-if)#ip address 172.16.12.2 255.255.255.0
R2(config-if)#no shutdown

R2(config)#ip route 172.16.10.0 255.255.255.0 172.16.12.1

R1:

R1(config)#interface fastEthernet 0/1


R1(config-if)#ip address 172.16.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 172.16.10.1 255.255.255.0
R1(config-if)#no shutdown

R1(config)#ip route 0.0.0.0 0.0.0.0 172.16.12.2

SRV-1:

PC-1:

PC-2:

12
Varification
Static Default route was configured on R1 as it has to reach 1000 of Servers are located in the
Internet. In the Internet we may not know all the servers IP as we access those servers using
their name. In such scenario we can use Static Default Route. Also question said, only one
route I can configure, so this must me Static Default Route, because Default Route on R1 will
pass all the IP traffic to R2 to reach internet. There is one more reason you should know why we
configure default route, when your router can not handle huge amount of route in the routing
table, on that scenario you can use Default Route to save resources on the Router.

Note:- Be careful while you are configuring Default route in Complex Network, think all the
possible ways before applying default route as it may create loop in the routing table. If you are
100% sure that creating Default Route will not introduce loop in the network then go for it.

R1#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

Gateway of last resort is 172.16.12.2 to network 0.0.0.0

172.16.0.0/24 is subnetted, 2 subnets


C 172.16.10.0 is directly connected, FastEthernet0/0
C 172.16.12.0 is directly connected, FastEthernet0/1
S* 0.0.0.0/0 [1/0] via 172.16.12.2

13
On the above output we can see, R1 has installed a default route in routing table. Now any
request comes to R1 (request to reach any destination IP) that will be forwarded to R2 (Next
hop IP – 172.16.12.2). Always you will see * sign on the default route as it indicates default
route. Also you are seeing Gateway of last resort is 172.16.12.2. It says if there is no match to
destination IP in the routing table it should use default route.

Ping test from PC-1 to SRV-1

Ping test from PC-1 to SRV-1

14
2.3 Floating Static Route

 Use the diagram 2 and configure IP as per diagram.


 Shutdown the Serial Interface Between R2 and R3
 Enable RIP in all the Routers for all networks.
 Configure static routing to reach from subnet 172.16.10.0/24 to 172.16.30.0/24 and vice-
versa.
 When you will do the ping test, router will forward packet based on RIP route in the
routing table, not Static Route.
 Configure IP address on PC’s as below and test the connectivity between PC’s using ping
 PC-1 = 172.16.20.5/24
 PC-2 = 172.16.20.10/24
 PC-3 = 172.16.30.5/24
 PC-4 = 172.16.30.10/24

Configuration
R1:

R1(config)#interface fastEthernet 0/0


R1(config-if)#ip address 172.16.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#interface fastEthernet 0/1
R1(config-if)#ip address 172.16.13.1 255.255.255.0
R1(config-if)#no shutdown

R1(config)#ip route 172.16.30.0 255.255.255.0 172.16.13.3 130  AD


R1(config)#ip route 172.16.20.0 255.255.255.0 172.16.12.2 130  AD

R1(config)#router rip
R1(config-router)#network 172.16.12.0
R1(config-router)#network 172.16.13.0

15
R2:

R2(config)#interface fastEthernet 0/0


R2(config-if)#ip address 172.16.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface fastEthernet 0/1
R2(config-if)#ip address 172.16.20.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface serial 0/1/0
R2(config-if)#ip address 172.16.23.2 255.255.255.0
R2(config-if)#shutdown

R2(config)#ip route 172.16.30.0 255.255.255.0 172.16.12.1 130

R2(config)#router rip
R2(config-router)#network 172.16.20.0
R2(config-router)#network 172.16.12.0

R3:

R3(config)#interface fastEthernet 0/0


R3(config-if)#ip address 172.16.13.3 255.255.255.0
R3(config-if)#no shutdown
R3(config)#interface fastEthernet 0/1
R3(config-if)#ip address 172.16.30.3 255.255.255.0
R3(config-if)#no shutdown
R3(config)#interface serial 0/1/0
R3(config-if)#ip address 172.16.23.3 255.255.255.0
R3(config-if)#shutdown

R3(config)#ip route 172.16.20.0 255.255.255.0 172.16.13.1 130

R3(config)#router rip
R3(config-router)#network 172.16.13.0
R3(config-router)#network 172.16.30.0

PC-1:

16
PC-2:

PC-3:

PC-4:

Varification

Floating static route is, when static route will be used as backup route by increasing the AD
(Administrative Distance) value. For Example, in our network we used Static Route as well as

17
RIP routing protocol and we want Static should be used as backup route, I mean when RIP
failed then static routing should work.

If we run Static and RIP both the routing mechanism, by default Static Route will take
preference and Static Route will be installed in the Routing Table, not RIP Route. The reason is
AD value, who has lowest AD that route will install in Routing table. We know Static Route has
AD of 1 and RIP has AD of 120.

Actual Rules, if any network is learning from 2 different routing protocol then who has the lowest
AD that routing protocol route will be seen in the routing table. In our case, Static Routing as it
has lowest AD. But question said, RIP route will be installed in the Routing table. It is possible if
we configure Static Route with higher AD than RIP. At the end of the static route syntax we can
add AD value on static route.

Let’s do the routing table verification

R2#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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 4 subnets


C 172.16.12.0 is directly connected, FastEthernet0/0
R 172.16.13.0 [120/1] via 172.16.12.1, 00:00:20, FastEthernet0/0
C 172.16.20.0 is directly connected, FastEthernet0/1
R 172.16.30.0 [120/2] via 172.16.12.1, 00:00:20, FastEthernet0/0

On the above output, we did not find Static Route on R2’s routing table. Here “R” indicates RIP.

R1#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

18
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 4 subnets


C 172.16.12.0 is directly connected, FastEthernet0/0
C 172.16.13.0 is directly connected, FastEthernet0/1
R 172.16.20.0 [120/1] via 172.16.12.2, 00:00:11, FastEthernet0/0
R 172.16.30.0 [120/1] via 172.16.13.3, 00:00:24, FastEthernet0/1

On the above output, we did not find Static Route on R1’s routing table. Here “R” indicates RIP.

R3#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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 4 subnets


R 172.16.12.0 [120/1] via 172.16.13.1, 00:00:02, FastEthernet0/0
C 172.16.13.0 is directly connected, FastEthernet0/0
R 172.16.20.0 [120/2] via 172.16.13.1, 00:00:02, FastEthernet0/0
C 172.16.30.0 is directly connected, FastEthernet0/1

On the above output, we did not find Static Route on R3’s routing table. Here “R” indicates RIP.

Let’s do some ping test from PC.

From PC-1:

19
From PC-4:

20
2.4 Routing Information Protocol (RIP)

 Remove previous static route configuration from all the routers.


 Enable RIP on R1, R2 and R3 for all the links including the Serial link between R2 and
R3.
 If Serial link between R2 and R3 goes down then also subnet 172.16.20.0/24 can reach
subnet 172.16.30.0/24 and vice-versa.
 Configure IP address on PC’s as below and test the connectivity between PC’s using
ping.
 PC-1 = 172.16.20.5/24
 PC-2 = 172.16.20.10/24
 PC-3 = 172.16.30.5/24
 PC-4 = 172.16.30.10/24

Configuration

Note:- RIP is already configured in previous section except the Serial link between R2
and R3. Now we will enable RIP only on the Serial Interface between R2 and R3.

R1:

R1(config)#no ip route 172.16.30.0 255.255.255.0 172.16.13.3 130


R1(config)#no ip route 172.16.20.0 255.255.255.0 172.16.12.2 130

R2:

21
R2(config)#no ip route 172.16.30.0 255.255.255.0 172.16.12.1 130
R2(config)#router rip
R2(config-router)#network 172.16.23.0

R3:

R3(config)#no ip route 172.16.20.0 255.255.255.0 172.16.13.1 130


R3(config)#router rip
R3(config-router)#network 172.16.23.0

Varification
RIP is a Distance Vector Routing protocol. RIP operates on UDP port 520, all RIP packets have
a source and destination port equal to 520.

RIP Metric:
Hop Count. Maximum is 15.

If we do not mention version 2 under RIP configuration then version 1 will be running. Also
network command in RIP is classful for v1 and v2. RIPv1 is out of market, nobody using it now
a days.

We have configured network command as below on R2.

R2(config)#router rip
R2(config-router)#network 172.16.20.0
R2(config-router)#network 172.16.12.0
R2(config-router)#network 172.16.23.0

But, in the running-configuration it is showing as below. So, network command in RIP is classful.

router rip
network 172.16.0.0 <<<Major Network>>>

RIPv1 is a classful routing protocol, so it does not advertise subnet mask information along with
advertised routes. For RIPv1 to determine what the subnet mask is of the destination network,
RIP pulls the subnet mask from the interface in which the route was received. This is true only if
the route was received and directly connected subnet both are in same major network. If the
route received is not in the same major network, the router will do auto-summarization at the
classful network.
RIPv1 does not support VLSM if the subnets are from different major network.
RIPv1 does not support control plane protection, that is called authentication.

22
RIPv1 sends broadcast update to 255.255.255.255.

RIPv1 has few limitations so RIPv2 was introduced. Now let’s do the verification.

R2#sh ip protocols
Routing Protocol is "rip" <<<RIP is running on this Router>>>
Sending updates every 30 seconds, next due in 25 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Redistributing: rip
Default version control: send version 1, receive any version
Interface Send Recv Triggered RIP Key-chain
FastEthernet0/0 1 21
FastEthernet0/1 1 21
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
172.16.0.0
Passive Interface(s):
Routing Information Sources:
Gateway Distance Last Update
172.16.12.1 120 00:00:21 <<<gateway for Routing, next hop>>>
172.16.23.3 120 00:00:08 <<<gateway for Routing, next hop>>>
Distance: (default is 120)

On the above output we can see, Router is running RIP Protocol and that is RIPv1. Because
RIPv1 sends v1 update and capable to receives v1 and v2 update.
Also we can see RIP timers, sending update every 30 sec.
Maximum path 4, which means it can load share between four equal paths.
Routing for Networks, it is basically the network was configured by network command under RIP
global configuration mode.

Now see the routing table.

R2#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

23
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 5 subnets


C 172.16.12.0 is directly connected, FastEthernet0/0
R 172.16.13.0 [120/1] via 172.16.12.1, 00:00:18, FastEthernet0/0
[120/1] via 172.16.23.3, 00:00:01, Serial0/1/0
C 172.16.20.0 is directly connected, FastEthernet0/1
C 172.16.23.0 is directly connected, Serial0/1/0
R 172.16.30.0 [120/1] via 172.16.23.3, 00:00:01, Serial0/1/0

From routing table we can see, network 172.16.13.0 is doing load sharing as from R2 we can
reach network 172.16.13.0 using 2 paths, both has same metric (hop count) 1.
If we want to reach network 172.16.30.0 from R2 then we have to go 172.16.23.3 which is R3.

Let’s see in detail of the network 172.16.13.0.

R2#sh ip route 172.16.13.0


Routing entry for 172.16.13.0/24
Known via "rip", distance 120, metric 1
Redistributing via rip
Last update from 172.16.12.1 on FastEthernet0/0, 00:00:07 ago
Routing Descriptor Blocks:
* 172.16.12.1, from 172.16.12.1, 00:00:07 ago, via FastEthernet0/0
Route metric is 1, traffic share count is 1
172.16.23.3, from 172.16.23.3, 00:00:22 ago, via Serial0/1/0
Route metric is 1, traffic share count is 1

RIP distance is 120.


Here in the output, 172.16.12.1 and 172.16.23.3 both are Next-Hop to reach network
172.16.13.0.
We can see metric is 1 for both path and traffic share count also 1, that means 1:1.

You can see R1 and R3’s Routing table using same show commands.
Let’s see some debug output, as I said RIPv1 sending update to broadcast IP 255.255.255.255
and cannot send subnet mask information on the update.

24
R2#debug ip rip
RIP protocol debugging is on
RIP: sending v1 update to 255.255.255.255 via FastEthernet0/0 (172.16.12.2)
RIP: build update entries
network 172.16.20.0 metric 1
network 172.16.23.0 metric 1 <<<There is no subnet mask info in update>>>
network 172.16.30.0 metric 2
RIP: sending v1 update to 255.255.255.255 via FastEthernet0/1 (172.16.20.2)
RIP: build update entries
network 172.16.12.0 metric 1
network 172.16.13.0 metric 2
network 172.16.23.0 metric 1
network 172.16.30.0 metric 2
RIP: sending v1 update to 255.255.255.255 via Serial0/1/0 (172.16.23.2)
RIP: build update entries
network 172.16.12.0 metric 1
network 172.16.20.0 metric 1

Let’s do some ping test from PC.

From PC-1:

From PC-4:

25
Now the question said, if the serial link between R2 and R3 goes down there should be any
connectivity failure between subnet 172.16.20.0/24 & 172.16.30.0/24.
To test it, we will manually shutdown the serial interface from R2. Then we will check ping.

R2(config)#interface serial 0/1/0


R2(config-if)#shutdown

Make sure you no shutdown the serial interface on R2.


Let’s do some ping test from PC.

From PC-1:

26
From PC-4:

Connectivity is still file between subnet 172.16.20.0/24 & 172.16.30.0/24.

2.5 RIPv2

Configure RIPv2 and check the difference on the update.


RIPv2 must be enabled on all the routers.

Configuration

R2:

R2(config)#router rip
R2(config-router)#version 2

R1:

R1(config)#router rip
R1(config-router)#version 2

R3:

R3(config)#router rip
R3(config-router)#version 2

27
Varification
Already RIPv1 was running, so only one command is required to enable RIPv2, that is version 2
under RIP global process. RIPv2 is an extension of RIP-1.

RIPv2 provide the following enhancements to RIP:

 RIPv2 is sending update to multicast address 224.0.0.9.


 RIPv2 does support authentication.
 RIPv2 has ability to stop auto-summarization.
 RIPv2 sends subnet mask info with routing update.
 RIPv2 does support VLSM.
 RIPv2 can send External route tag information on update

Now let’s see debug output from one of the RIP running router.

R3#debug ip rip
RIP protocol debugging is on
RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (172.16.13.3)
RIP: build update entries
172.16.20.0/24 via 0.0.0.0, metric 2, tag 0
172.16.23.0/24 via 0.0.0.0, metric 1, tag 0 <<<Sending subnet mask info>>>
172.16.30.0/24 via 0.0.0.0, metric 1, tag 0
RIP: sending v2 update to 224.0.0.9 via FastEthernet0/1 (172.16.30.3)
RIP: build update entries
172.16.12.0/24 via 0.0.0.0, metric 2, tag 0
172.16.13.0/24 via 0.0.0.0, metric 1, tag 0
172.16.20.0/24 via 0.0.0.0, metric 2, tag 0
172.16.23.0/24 via 0.0.0.0, metric 1, tag 0
RIP: sending v2 update to 224.0.0.9 via Serial0/1/0 (172.16.23.3)
RIP: build update entries
172.16.13.0/24 via 0.0.0.0, metric 1, tag 0
172.16.30.0/24 via 0.0.0.0, metric 1, tag 0

As we can see, RIPv2 is sending update on Multicast address 224.0.0.9.


Also sending subnet mask information and tag information on update. There should not be any
change in the routing table, let’s check it out.

R2#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

28
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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 5 subnets


C 172.16.12.0 is directly connected, FastEthernet0/0
R 172.16.13.0 [120/1] via 172.16.12.1, 00:00:19, FastEthernet0/0
[120/1] via 172.16.23.3, 00:00:03, Serial0/1/0
C 172.16.20.0 is directly connected, FastEthernet0/1
C 172.16.23.0 is directly connected, Serial0/1/0
R 172.16.30.0 [120/1] via 172.16.23.3, 00:00:03, Serial0/1/0

In RIPv1 we have seen that network 172.16.13.0 is doing load sharing, same is in RIPv2.

2.6 RIPv2 with Passive Interface

 Configure Passive-interface on R2 for interface Fa0/0 and Serial0/1/0.


 Check the routing table on R3 and R1 before you apply passive-interface and after you
apply passive-interface.

Configuration
R2:

R2(config)#router rip
R2(config-router)#passive-interface serial 0/1/0
R2(config-router)#passive-interface fastEthernet 0/0

Varification
Once you apply passive-interface for an interface, that interface will stop sending Broadcast or
Multicast update, but it will be able to receive broadcast or multicast update. Passive-interface
cannot stop sending unicast update on RIP.

show ip route output from R1 before we apply passive-interface on R2.

29
R1#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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 5 subnets


C 172.16.12.0 is directly connected, FastEthernet0/0
C 172.16.13.0 is directly connected, FastEthernet0/1
R 172.16.20.0 [120/1] via 172.16.12.2, 00:00:09, FastEthernet0/0
R 172.16.23.0 [120/1] via 172.16.13.3, 00:00:24, FastEthernet0/1
[120/1] via 172.16.12.2, 00:00:09, FastEthernet0/0
R 172.16.30.0 [120/1] via 172.16.13.3, 00:00:24, FastEthernet0/1

show ip route output from R3 before we apply passive-interface on R2.

R3#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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 5 subnets


R 172.16.12.0 [120/1] via 172.16.13.1, 00:00:21, FastEthernet0/0
[120/1] via 172.16.23.2, 00:00:21, Serial0/1/0
C 172.16.13.0 is directly connected, FastEthernet0/0
R 172.16.20.0 [120/1] via 172.16.23.2, 00:00:21, Serial0/1/0
C 172.16.23.0 is directly connected, Serial0/1/0
C 172.16.30.0 is directly connected, FastEthernet0/1.

show ip route output from R1 after we apply passive-interface on R2.

30
R1#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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 4 subnets


C 172.16.12.0 is directly connected, FastEthernet0/0
C 172.16.13.0 is directly connected, FastEthernet0/1
R 172.16.23.0 [120/1] via 172.16.13.3, 00:00:03, FastEthernet0/1
R 172.16.30.0 [120/1] via 172.16.13.3, 00:00:03, FastEthernet0/1

Can you see the change in the routing table on R3? RIP route 172.16.20.0/24 not there in
routing table, as R2’s fa0/0 and Se0/1/0 cannot send update for this network. Now let’s see
routing table of R3.

show ip route output from R3 after we apply passive-interface on R2.

R3#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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 5 subnets


R 172.16.12.0 [120/1] via 172.16.13.1, 00:00:19, FastEthernet0/0
C 172.16.13.0 is directly connected, FastEthernet0/0
C 172.16.23.0 is directly connected, Serial0/1/0
C 172.16.30.0 is directly connected, FastEthernet0/1

Can you see the change in the routing table on R3? RIP route 172.16.20.0/24 not there in
routing table, as R2’s fa0/0 and Se0/1/0 cannot send update for this network.

31
2.7 RIPv2 unicast neighbor

 Do not make any changes on the previous configuration.


 Configure passive-interface on R1’s fa0/0.
 Configure unicast neighbor on R1 and R2.
 Check the routing table of all three routers.

Configuration
R1:

R1(config)#router rip
R1(config-router)#passive-interface fastEthernet 0/0
R1(config-router)#neighbor 172.16.12.2

R2:

R2(config)#router rip
R2(config-router)#neighbor 172.16.12.1

Varification

In Previous configuration passive-interface was configured on R2’s fa0/0 and this interface was
not able to send any broadcast or multicast update.

32
Now we have configured passive-interface on R1’s Fa0/0 and this interface will not be able to
send broadcast or multicast update, these interfaces can send unicast update and that can be
configured using neighbor command under RIP routing process.
Now both the interfaces will send unicast update instead of multicast. IP which was configured
with neighbor command, that is interface IP of another end. For example, on R1 we have
configured neighbor 172.16.12.2, this IP is R2’s interface IP on the connected link.

Now enable debug ip rip command on R2, check the debug logs. R2 now sending unicast
update instead of multicast.

R2#debug ip rip
RIP protocol debugging is on
R2#
RIP: sending v2 update to 172.16.12.1 via FastEthernet0/0 (172.16.12.2)
RIP: build update entries
172.16.20.0/24 via 0.0.0.0, metric 1, tag 0
2.8 RIPv2 auto-summary and Split-horizon

 Shutdown the serial link between R2 and R3.


 Change the subnet on the link between R1 and R3 to 192.168.10.0/24. Configure IP
address 192.168.10.1/24 on R1’s interface Fa0/1 and configure IP address
192.168.10.3/24 on R3’s interface Fa0/0.
 Enable RIP on the link between R1 and R3.
 Disable split-horizon on R2’s Fa0/0.

Configuration
R1:

R1(config)#interface fastEthernet0/1
R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#network 192.168.10.0

R2:

R2(config)#interface serial 0/1/0


R2(config-if)#shutdown

R2(config)#interface fastEthernet 0/0


R2(config-if)#no ip split-horizon

33
R3:

R3(config)#interface serial 0/1/0


R3(config-if)#shutdown

R3(config)#interface fastEthernet 0/0


R3(config-if)#ip address 192.168.10.3 255.255.255.0
R3(config-if)#exit
R3(config)#router rip
R3(config-router)#network 192.168.10.0

Varification

RIPv1 and v2 both does the auto-summarization at the classful/major network boundary. In our
case, R1 is major network boundary as Fa0/0 has IP address 172.16.12.1/24 and it’s major
network is 172.16.0.0/16, at the other side R1 has Fa0/1 which has IP address 192.168.10.1/24
and it’s major network also same, 192.168.10.0/24.

When R1 will send update to R3, It will not send update for individual subnets (172.16.12.0/24 &
172.16.20.0/24), instead it will send major network 172.16.0.0/16, and we can verify it by seeing
R3’s routing table.

R3#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

34
P - periodic downloaded static route

Gateway of last resort is not set

172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks


R 172.16.0.0/16 [120/1] via 192.168.10.1, 00:00:21, FastEthernet0/0
C 172.16.30.0/24 is directly connected, FastEthernet0/1
C 192.168.10.0/24 is directly connected, FastEthernet0/0

This behavior can be turned off on RIPv2 using the command no auto-summary. Let’s
configure no auto-summary on R1 and will check R3’s routing table.

R1(config)#router rip
R1(config-router)#no auto-summary
Wait for some time to converge the RIP then you check R3’s routing table as we know RIP is
very slow protocol by default. But we can tune the timers to converge it little faster. Or you can
refresh the routing table of R3 using command clear ip route * but do not use this command in
production.

R3#clear ip route *
R3#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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 3 subnets


R 172.16.12.0 [120/1] via 192.168.10.1, 00:00:10, FastEthernet0/0
R 172.16.20.0 [120/2] via 192.168.10.1, 00:00:01, FastEthernet0/0
C 172.16.30.0 is directly connected, FastEthernet0/1
C 192.168.10.0/24 is directly connected, FastEthernet0/0

Now, we can see two RIP routes on R3’s routing table. Is that clear to you?

Next, we will verify split-horizon, it is basically used to prevent loop in the RIP. Split-horizon
says, if an update is received on an interface the same update will not be sent back over the
same interface.

35
R2 is receiving update from R1 on interface Fa0/0, the same update R2 will not send back to R1
over the interface Fa0/0.
But we have disables the split-horizon on R2’s fa0/0, so it will break the rules and will send back
the same update which was received on interface Fa0/0.
Basically split-horizon need to disable on Hub router in Hub and Spoke topology, where Hub
router need to send back same update over the same interface to share the routing update with
Spoke routers.

R2#show ip interface fastEthernet 0/0


FastEthernet1/0 is up, line protocol is up
Internet address is 172.16.12.2/24
Broadcast address is 255.255.255.255
Address determined by setup command
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Multicast reserved groups joined: 224.0.0.9
Outgoing access list is not set
Inbound access list is not set
Proxy ARP is enabled
Local Proxy ARP is disabled
Security level is default
Split horizon is disabled
ICMP redirects are always sent
ICMP unreachables are always sent
ICMP mask replies are never sent
IP fast switching is enabled

36
[…output omitted…]

2.9 RIPv2 Default Information Originate

 Enable the split-horizon on R2’s interface Fa0/0.


 Enable the serial link between R2 and R3.
 Advertise a default route on R1 from RIP.

Configuration
R1:

R1(config)#router rip
R1(config-router)#default-information originate

R2:

R2(config)#interface fastEthernet 0/0


R2(config-if)#ip split-horizon

R2(config)#interface serial 0/1/0


R2(config-if)#no shutdown

Varification

If you want to advertise default route from RIP you may use the command default-information
originate under RIP global process which will propagate throughout the entire RIP routing
domain.

37
Check the routing table of R2 and R3, both installed a default route.

R2#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

Gateway of last resort is 172.16.23.3 to network 0.0.0.0

172.16.0.0/24 is subnetted, 4 subnets


C 172.16.12.0 is directly connected, FastEthernet0/0
C 172.16.20.0 is directly connected, FastEthernet0/1
C 172.16.23.0 is directly connected, Serial0/1/0
R 172.16.30.0 [120/1] via 172.16.23.3, 00:00:11, Serial0/1/0
R 192.168.10.0/24 [120/1] via 172.16.23.3, 00:00:11, Serial0/1/0
R* 0.0.0.0/0 [120/2] via 172.16.23.3, 00:00:11, Serial0/1/0

R3#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

Gateway of last resort is 192.168.10.1 to network 0.0.0.0

172.16.0.0/24 is subnetted, 4 subnets


R 172.16.12.0 [120/1] via 192.168.10.1, 00:00:17, FastEthernet0/0
R 172.16.20.0 [120/2] via 192.168.10.1, 00:00:17, FastEthernet0/0
C 172.16.23.0 is directly connected, Serial0/1/0
C 172.16.30.0 is directly connected, FastEthernet0/1
C 192.168.10.0/24 is directly connected, FastEthernet0/0
R* 0.0.0.0/0 [120/1] via 192.168.10.1, 00:00:17, FastEthernet0/0

38
Now, split-horizon is enabled on R2’s interface fa0/0.

R2#show ip interface fastEthernet 1/0


FastEthernet1/0 is up, line protocol is up
Internet address is 172.16.12.2/24
Broadcast address is 255.255.255.255
Address determined by setup command
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Multicast reserved groups joined: 224.0.0.9
Outgoing access list is not set
Inbound access list is not set
Proxy ARP is enabled
Local Proxy ARP is disabled
Security level is default
Split horizon is enabled
ICMP redirects are always sent
ICMP unreachables are always sent
ICMP mask replies are never sent
IP fast switching is enabled
[…output omitted…]

39
2.10 Enhanced Interior Gateway Routing Protocol (EIGRP)

 Remove all the previous RIP configurations and change the subnet on the link between
R1 and R3 to 172.16.13.0/24.
 Use the Topology 2
 Configure EIGRP on R1, R2 and R3 and disable auto-summarization on all the routers.
 Configure IP address on PC’s as below and test the connectivity between PC’s using
ping.
 PC-1 = 172.16.20.5/24
 PC-2 = 172.16.20.10/24
 PC-3 = 172.16.30.5/24
 PC-4 = 172.16.30.10/24

Configuration
R2:

R2(config)#no router rip

R2(config)#router eigrp 1
R2(config-router)#no auto-summary
R2(config-router)#network 172.16.20.2 0.0.0.0
R2(config-router)#network 172.16.23.2 0.0.0.0
R2(config-router)#network 172.16.12.2 0.0.0.0

R1:

40
R1(config)#no router rip
R1(config)#interface fastEthernet 0/1
R1(config-if)#ip address 172.16.13.1 255.255.255.0

R1(config)#router eigrp 1
R1(config-router)#no auto-summary
R1(config-router)#network 172.16.12.1 0.0.0.0
R1(config-router)#network 172.16.13.1 0.0.0.0

R3:

R3(config)#no router rip


R3(config)#interface fastEthernet 0/0
R3(config-if)#ip address 172.16.13.3 255.255.255.0

R3(config)#router eigrp 1
R3(config-router)#no auto-summary
R3(config-router)#network 172.16.13.3 0.0.0.0
R3(config-router)#network 172.16.23.3 0.0.0.0
R3(config-router)#network 172.16.30.3 0.0.0.0

PC-1:

PC-2:

PC-3:

41
PC-4:

Varification

Enhanced Interior Gateway Routing Protocol (EIGRP) is an advanced distance-vector


routing protocol, or we can say it is hybrid routing protocol.

Why would you chose EIGRP?


- Simple configuration
- Backup Routes – Faster Convergence (Use DUAL Algorithm)
- Flexibility in Summarization configuration
- Unequal cost load-balancing
- Use function of both Distance Vector and Link-state (Hybrid)
- Supports multiple network Protocol
- Power of Metric

Note:- Now EIGRP is not a Cisco Proprietary Protocol


**DUAL - Diffusing Update Algorithm

EIGRP Distance-vector properties:

 An EIGRP router only advertises its best route to its neighbor, not every route that is
aware of.

42
 An EIGRP router does not have a complete map of the topology, it is only aware of
what its neighbors have told it (routing by rumor).
 Ability to send the full routing table as an update (but only when 2 neighbors first come
up)

EIGRP Link-state properties:

 An EIGRP router does form neighbor relationships, create Topology table


 Sends Triggered updates. An update is only sent when a change in the topology
occurs

EIGRP Tables:
A Router running EIGRP maintain three different tables

 Neighbor Table
 Topology Table
 Routing Table

EIGRP Packets type:

 Hello : To form neigborship, send to 224.0.0.10


 Update : Send update message
 Query : To sends query for Route
 Reply : Response for a query
 ACK : Acknowledgement for Update Query and Reply message, except Hello.

EIGRP Metric:

EIGRP use five parameters to calculate it’s metric. EIGRP identifies these parameters by K
values. By Default EIGRP use Bandwidth and Delay for metric calculation.

 Bandwidth = K1
 Delay = K3
 Load = K2
 Reliability = K4
 MTU = K5

 Bandwidth = Lowest Bandwidth along path in Kbps


 Delay = Cumulative delay along the path in Tens of Microsecond
 Load = Highest load along the path
 Reliability = Lowest reliability along the path
 MTU = MTU of the path

43
How EIGRP works?

EIGRP first finds its neighbor on EIGRP enabled connected interfaces using hello packet,
then neighbors exchange update packets to share each other’s route/networks. These
route/network information are stored in topology table. Now EIGRP will run DUAL algorithm
to calculate the metric and find the best path. Once best path was found then it will be
installed in Routing table.

EIGRP Neigborship Forming Criteria:

 Interface primary address must be in the same subnet on neighboring routers


 Must use the same Autonomous System Number on the "router" configuration
command.
 K-values *must* match
 Must pass router authentication (If authentication is configured)

EIGRP network command can be configured with wild card mask and it is classful if you do
not use wildcard mask.
Wildcard mask is opposite of subnet mask. If you know the subnet mask easily you can
calculate wild card mask. For example, you have a subnet 10.1.1.0/24, now you want to
calculate the wild card mask. Just follow me.

255.255.255.255
255.255.255. 0
------------------------
0 . 0 . 0 . 255

What I did, just subtract the subnet mask from 255.255.255.255 and the result what I got
that is wild card mask, which is 0.0.0.255.

We have configured network command under EIGRP global process as below (without wild
card mask).
router eigrp 1
network 172.16.20.0

But, when we will check running-configuration it will show as below.


router eigrp 1
network 172.16.0.0

44
Router ID (RID) is nothing but Router Name. It is used to prevent loop in EIGRP routing
domain and it has to be unique, otherwise duplicate RIDs may cause problems when
configuring EIGRP.

Let’s start verification on R2.

R2#show ip protocols

Routing Protocol is "eigrp 1 "


Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
EIGRP maximum hopcount 100
EIGRP maximum metric variance 1
Redistributing: eigrp 1
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
172.16.20.2/32
172.16.23.2/32
172.16.12.2/32
Routing Information Sources:
Gateway Distance Last Update
172.16.12.1 90 6706967
172.16.23.3 90 6797587
Distance: internal 90 external 170

On the above output we can see,

 Router is running EIGRP and its K values. K1 = 1 and K3 = 1, that means K1 and K3 is
enabled. K2, K4 & K5 = 0, that means these are disabled by default.
 EIGRP also calculate HOP count, by default which is 100 but you can increase it to 255.
 Automatic summarization not in effect as we disabled the auto-summary.
 Also we can see, maximum path 4, means EIGRP router can do load sharing in 4 equal
metric path.

45
 Routing for networks, means networks were added by the network command which
matches the interface network/IP and enabled EIGRP on those interfaces.
 Gateway, this router has two neighbors and their IP address to route packets.
 EIGRP Administrative Distance is 90 for Internal and 170 for External.

Now we will check Neighbor Table on R2.

R2#show ip eigrp neighbors


IP-EIGRP neighbors for process 1
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 172.16.23.3 Se0/1/0 14 00:05:00 40 1000 0 25
1 172.16.12.1 Fa0/0 11 00:05:00 40 1000 0 23

We can see, R2 has two neighbors (R1 & R3) and their IP address on the connected interface.
Now let me explain each and every field of this output.

H = Handle, or you may think like serial number. It starts from 0 and first neighbor will use 0.

Address = Neighbor interface IP of connected Link.

Interface = Interface of local router through which it finds neighbor.

Hold = It is calculated in second. This is neighbor’s hold time and neighbor shared this hold
time in hello packet.

Uptime = Uptime of neighbor, since how long this neighbor is up.

SRTT (Smooth round-trip time) = The number of milliseconds it takes to send an EIGRP
packet to your neighbor and receive an acknowledgment packet back.

RTO (Retransmission timeout) = It is basically retransmission wait time. The amount of


time in milliseconds that EIGRP will wait before retransmitting a packet from the
retransmission queue to this neighbor.

Q Cnt (Q Count) = The number of EIGRP packets (Update, Query or Reply) in the queue
that are waiting for transmission. Ideally you want this number to be 0 otherwise it might be
an indication of congestion on the network.

46
Seq Num (Sequence number): This will show you the sequence number of the last
update, query or reply packet that router received from your EIGRP neighbor.

Excellent; that’s how EIGRP stores neighbor information! Our next step is of course to take
a look at the EIGRP Topology table:

R2#show ip eigrp topology


IP-EIGRP Topology Table for AS (1)/ID 172.16.23.2

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,


r - Reply status

P 172.16.20.0/24, 1 successors, FD is 28160


via Connected, FastEthernet0/1
P 172.16.12.0/24, 1 successors, FD is 28160
via Connected, FastEthernet0/0
P 172.16.23.0/24, 1 successors, FD is 2169856
via Connected, Serial0/1/0
P 172.16.13.0/24, 1 successors, FD is 30720
via 172.16.12.1 (30720/28160), FastEthernet0/0
via 172.16.23.3 (2172416/28160), Serial0/1/0
P 172.16.30.0/24, 1 successors, FD is 33280
via 172.16.12.1 (33280/30720), FastEthernet0/0
via 172.16.23.3 (2172416/28160), Serial0/1/0

If you look at the gray marked area, you can see that we are looking at the EIGRP topology
table for AS (Autonomous System) number 1. Keep in mind that the AS number has to
match on EIGRP routers in order to become neighbors. Also you can see “P” in front of
each route/network, that means Passive, good route. If you see “A” instead of “P” then
that route is bad route, not up.

Just notice here, R2 is learning route 172.16.13.0/24 from two different neighbors, R1 (via
172.16.12.1) and R3 (via 172.16.23.3). When the route is leaning from R1 it has metric
30720 and when it is learning from R3 it has metric 2172416. Metric lowest is best. Next we will
verify routing table and we will see route 172.16.13.0/24 is installed from R1 (172.16.12.1) as it
has lower metric. Same you may verify for route 172.16.30.0/24.

Let’s Routing table on R2.

47
R2#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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 5 subnets


C 172.16.12.0 is directly connected, FastEthernet0/0
D 172.16.13.0 [90/30720] via 172.16.12.1, 01:51:15, FastEthernet0/0
C 172.16.20.0 is directly connected, FastEthernet0/1
C 172.16.23.0 is directly connected, Serial0/1/0
D 172.16.30.0 [90/33280] via 172.16.12.1, 01:51:15, FastEthernet0/0

Here we can see routing table of R2. As discussed above, R2 will install route 172.16.13.0/24
from R1 (via 172.16.12.1), same we can see here. So it means, in topology table we can see
router is learning one route from many different neighbors but routes from best neighbor will be
installed in routing table. Here “D” indicates EIGRP route.

Now we will do the ping test from PC.

From PC-1:

48
From PC-4:

49
2.11 EIGRP Static Neighbors and Split-horizon

 Do not modify any configuration had done in previous section.


 Configure EIGRP static neighbor between R1 and R2.
 Disable Split-horizon on the interface between R1 and R2

Configuration

R1:

R1(config)#router eigrp 1
R1(config-router)#neighbor 172.16.12.2 fastEthernet 0/0

R1(config)#interface fastEthernet 0/0


R1(config-if)#no ip split-horizon eigrp 1

R2:

R2(config)#router eigrp 1
R2(config-router)#neighbor 172.16.12.1 fastEthernet 0/0

R2(config)#interface fastEthernet 0/0


R2(config-if)#no ip split-horizon eigrp 1

Varification
EIGRP static neighbor configuration will stop sending multicast packets to neighbor, instead it
will send unicast packet.

Let’s do some high level verification to see how EIGRP is sending hello packet to unicast IP.

R1#debug ip packet detail


IP packet debugging is on (detailed)
R1#debug eigrp packets hello
(HELLO)
EIGRP Packet debugging is on
IP: tableid=0, s=172.16.12.2 (FastEthernet0/0), d=172.16.12.1 (FastEthernet0/0), routed via RIB
IP: s=172.16.12.2 (FastEthernet0/0), d=172.16.12.1, len 60, stop process pak for forus packet, proto=88
EIGRP: Received HELLO on FastEthernet0/0 nbr 172.16.12.2
AS 1, Flags 0x0:(NULL), Seq 0/0 interfaceQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
IP: s=172.16.12.1 (local), d=172.16.12.2 (FastEthernet0/0), len 60, sending, proto=88
IP: s=172.16.12.1 (local), d=172.16.12.2 (FastEthernet0/0), len 60, sending full packet, proto=88
EIGRP: Sending HELLO on FastEthernet1/0 nbr 172.16.12.2
AS 1, Flags 0x0:(NULL), Seq 0/0 interfaceQ 0/0 iidbQ un/rely 0/0

50
Let’s turn on following two debug commands,

- debug ip packet detail


- debug eigrp packets hello

Check the Source IP (s) and Destination IP (d) both are unicast IP for hello packet. Also you
can see IP Protocol number 88, that indicates EIGRP.

Now, we will check Split-horizon, concept is same as I explained in RIP. It is basically used to
prevent loop in the EIGRP. Split-horizon says, if an update is received on an interface the same
update will not be sent back over the same interface.

R1#show ip eigrp interfaces detail


EIGRP-IPv4 Interfaces for AS(1)
Xmit Queue Mean Pacing Time Multicast Pending
Interface Peers Un/Reliable SRTT Un/Reliable Flow Timer Routes
Fa1/0 1 0/0 253 0/1 1281 0
Hello-interval is 5, Hold-time is 15
Split-horizon is disabled
Next xmit serial <none>
Un/reliable mcasts: 0/1 Un/reliable ucasts: 6/7
Mcast exceptions: 1 CR packets: 1 ACKs suppressed: 0
Retransmissions sent: 2 Out-of-sequence rcvd: 0
Topology-ids on interface - 0
Authentication mode is not set

51
2.12 EIGRP Unequal Load Balancing and Timer

 Enable split-horizon on the link between R1 and R2.


 On R2 configure unequal cost load balancing to install 172.16.13.0/24 and
172.16.30.0/24 in Routing table.
 On R2’s Fa0/0 change the hello time to 10 sec and hold time to 30 sec.

Configuration
R1:

R1(config)#interface fastEthernet 0/0


R1(config-if)#ip split-horizon eigrp 1

R2:

R2(config)#interface fastEthernet 0/0


R2(config-if)#ip split-horizon eigrp 1

R2(config)#router eigrp 1
R2(config-router)#variance 71

R2(config)#interface fastEthernet 0/0


R2(config-if)#ip hello-interval eigrp 1 10
R2(config-if)#ip hold-time eigrp 1 30

Varification
EIGRP is only routing protocol supports unequal cost load balancing. Let me explain first what is
load balancing, Cisco router cannot do the actual load balancing, but still we say router is doing
load balancing. Cisco router can do load sharing, it is basically, when router will send data to
destination it will use multiple path to send data towards destination. So multiple path must be
exist in the routing table to accomplish this.
Now we will understand what is unequal cost/metric load balancing? It is basically load
balancing between different metric path/link. As we know in topology table EIGRP can keep
multiple path for same destination and best path will be chosen based on metric and put it in
routing table. What about those paths which was not chosen as best path? These paths also
can be installed in the routing table by configuring variance under EIGRP global process.
You cannot install all paths/routes in routing table from topology table, there is a condition that
must match. Condition is – route must be meeting feasibility condition.

52
Metric - the metric is used when determining the best path to a destination network. It is worked
out from a formula that included Bandwidth, Delay, Load, Reliability and MTU.

Before I go further we should know about some EIGRP Terminology.

 Feasible Distance (FD) – Feasible distance is the best metric along a path to a
destination network. Actually the metric from a router to destination.

 Advertise Distance (AD) – This is the cost of reaching a destination network


as advertised by the neighboring router. This is actually metric from my neighbor router
to destination.

 Reported distance (RD) - The metric advertised by a neighboring router for a specific
route. It other words, it is the metric of the route used by the neighboring router to reach
the network.

 Successor – The best route, which is going to Routing table from topology table.

 Feasible Successor – A feasible successor is a path whose reported distance is less


than the feasible distance on successor. Actually it is backup route, store in topology
table.

 Active Route – Bad route, if the route goes down you may see “A” in front of the route in
topology table.

 Passive Route – Good route.

What is feasible condition?


EIGRP uses feasible condition to select backup route or feasible successor and keep these
routes in topology table. Feasibility condition says, if any route has advertise distance lower
than successor’s feasible distance that route is called Feasible Successor or Backup Route.

In our case, route 172.16.13.0/24 coming from neighbor R3 has met feasibility condition and we
can install this route from topology table to Routing table.

Let’s have a look at topology table for route 172.16.13.0/24.

R2#show ip eigrp topology


IP-EIGRP Topology Table for AS (1)/ID 172.16.23.2

53
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - Reply status

P 172.16.20.0/24, 1 successors, FD is 28160


via Connected, FastEthernet0/1
P 172.16.12.0/24, 1 successors, FD is 28160
via Connected, FastEthernet0/0
P 172.16.23.0/24, 1 successors, FD is 2169856
via Connected, Serial0/1/0
P 172.16.13.0/24, 1 successors, FD is 30720
via 172.16.12.1 (30720/28160), FastEthernet0/0
via 172.16.23.3 (2172416/28160), Serial0/1/0
P 172.16.30.0/24, 1 successors, FD is 33280
via 172.16.12.1 (33280/30720), FastEthernet0/0
via 172.16.23.3 (2172416/28160), Serial0/1/0

Now let me explain you how the route 172.16.13.0/23 has come from R3 met feasibility
condition.

 Marked in Red = FD of route 172.16.13.0/24 coming from R1


 Marked in Yellow = FD of route 172.16.13.0/24 coming from R3
 Marked in Green = AD of route 172.16.13.0/24 coming from R1
 Marked in Pink = AD of route 172.16.13.0/24 coming from R3

We know the rule, right? Rule says, AD of a route < FD of successor

Here, AD of a route = 28160


And FD of successor = 30720

Final result is, 28160 < 30720 = True

So, the route has come from R3 can be chosen for unequal cost/metric load balancing.
Equal cost load balancing can happen automatically, but unequal cost load balancing cannot
happen automatically. We have configure for that, the configuration will be done under EIGRP
routing process using command variance [multiplier].
Here multiplier is, how many times longer Feasible Successor’s FD than Successor’s FD.
In our case,

(Feasible Successor’s FD / Successor’s FD)


2172416/30720 = 70.71 or 71

54
Note: - variance command does not change metric of routes. The biggest drawback of variance
command is, it will take effect of all routes those are fall under this condition. You cannot do it
for a single route.

Now we will check routing table of R2 to check whether the route 172.16.13.0/24 has come from
R3 was installed in the routing table or not.

R2#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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 5 subnets


C 172.16.12.0 is directly connected, FastEthernet0/0
D 172.16.13.0 [90/30720] via 172.16.12.1, 01:44:51, FastEthernet0/0
[90/2172416] via 172.16.23.3, 01:44:54, Serial0/1/0
C 172.16.20.0 is directly connected, FastEthernet0/1
C 172.16.23.0 is directly connected, Serial0/1/0
D 172.16.30.0 [90/33280] via 172.16.12.1, 01:44:51, FastEthernet0/0
[90/2172416] via 172.16.23.3, 01:44:54, Serial0/1/0

Check the above output, now route 172.16.13.0/24 is doing unequal cost load balancing. But
what about the route 172.16.30.0/24, it is also doing unequal cost load balancing as I said when
you configure variance it will take effect of all routes those are fall under this condition.

Now we will verify the timers on R2.

R2#sh ip eigrp interfaces detail


EIGRP-IPv4 Interfaces for AS(1)
Xmit Queue Mean Pacing Time Multicast Pending
Interface Peers Un/Reliable SRTT Un/Reliable Flow Timer Routes
Fa0/0 1 0/0 236 0/1 1185 0
Hello-interval is 10, Hold-time is 30

55
Split-horizon is enabled
Next xmit serial <none>
Un/reliable mcasts: 0/1 Un/reliable ucasts: 5/5
Mcast exceptions: 0 CR packets: 0 ACKs suppressed: 0
Retransmissions sent: 0 Out-of-sequence rcvd: 1
Topology-ids on interface - 0
Authentication mode is not set

In EIGRP Hello and hold time can be different between neighbors, it should not be same
between neighbors to form neighborship. Cisco recommends, when you are changing hello and
hold time please do change on all the interfaces throughout the EIGRP routing domain.

2.13 EIGRP Router-ID and Auto-summarization

 Do not modify any configuration of previous section.


 Shutdown the interface Fa0/0 and Serial 0/1/0 on R3.
 Configure manually EIGRP Router-ID 2.2.2.2 on R2.
 Change the subnet on the link between R1 and R3 to 192.168.10.0/24. Configure IP
address 192.168.10.1/24 on R1’s interface Fa0/1 and configure IP address
192.168.10.3/24 on R3’s interface Fa0/0.
 Enable auto-summary on R1, R2 and R3.
 Enable EIGRP on the link between R1 and R3 on new subnet.

Configuration
R1:

R1(config)#interface fastEthernet 0/1


R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config)#router eigrp 1
R1(config-router)#network 192.168.10.1 0.0.0.0
R1(config-router)#auto-summary

R2:

56
R2(config)#router eigrp 1
R2(config-router)#eigrp router-id 2.2.2.2
R2(config-router)#auto-summary

R3:

R3(config)#interface fastEthernet 0/0


R3(config-if)#ip address 192.168.10.3 255.255.255.0
R3(config)#router eigrp 1
R3(config-router)#network 192.168.10.3 0.0.0.0
R3(config-router)#auto-summary

R3(config)#interface fastEthernet 0/1


R3(config-if)#shutdown
R3(config-if)#exit
R3(config)#interface serial 0/1/0
R3(config-if)#shutdown

Varification
Router ID (RID) is nothing but Router Name. It is used to prevent loop in EIGRP routing
domain and it has to be unique on the routers in EIGRP routing domain, otherwise duplicate
RIDs may cause problems when configuring EIGRP.

Let’s verify on R2

R2#show ip protocols

Routing Protocol is "eigrp 1"


Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
Redistributing: eigrp 1
EIGRP-IPv4 Protocol for AS(1)
Metric weight K1=1, K2=0, K3=1, K4=0, K5=0
NSF-aware route hold timer is 240
Router-ID: 2.2.2.2
Topology : 0 (base)
Active Timer: 3 min
Distance: internal 90 external 170
Maximum path: 4
Maximum hopcount 100

57
Maximum metric variance 1
[…output omitted…]

EIGRP does the auto-summarization at the classful/major network boundary. In our case, R1 is
major network boundary as Fa0/0 has IP address 172.16.12.1/24 and it’s major network is
172.16.0.0/16, at the other side R1 has Fa0/1 which has IP address 192.168.10.1/24 and it’s
major network also same, 192.168.10.0/24.

When R1 will send update to R3, It will not send update for individual subnets (172.16.12.0/24 &
172.16.20.0/24), instead it will send major network 172.16.0.0/16, and we can verify it by seeing
R3’s routing table.

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

Gateway of last resort is not set

D 172.16.0.0/16 [90/30720] via 192.168.10.1, 00:00:08, FastEthernet0/0


C 192.168.10.0/24 is directly connected, FastEthernet0/0

58
2.14 EIGRP Passive Interface

 Do not modify any configuration of previous section.


 Configure EIGRP passive interface on R2’s interface Fa0/0.

Configuration
R2:

R2(config)#router eigrp 1
R2(config-router)#passive-interface fastEthernet 0/0

Varification
EIGRP passive interface will stop sending multicast and unicast packet. When you will configure
passive-interface on R2’s interface Fa0/0 after some time you will see a log message on the
screen that neighbor gone down, hold time expired. Because, the interface is not able send
hello to maintain neighborship.

Log message:

R2#

59
%DUAL-5-NBRCHANGE: IP-EIGRP 1: Neighbor 172.16.12.1 (FastEthernet0/0) is down:
holding time expired

2.15 OSPF Shortest Path First (OSPF)

 Remove all EIGRP configurations from R1, R2 and R3.


 Configure IP addresses as per Diagram 2.
 Enable OSPFv2 on R1 and R2 with their connected interfaces (use network command).
 Enable OSPFv2 on R3 with its connected interfaces (use interface level command).
 Keep all the interfaces in area 0.
 Configure Router-ID as below:
 R1 = 1.1.1.1
 R2 = 2.2.2.2
 R3 = 3.3.3.3
 Configure IP address on PC’s as below and test the connectivity between PC’s using ping
 PC-1 = 172.16.20.5/24
 PC-2 = 172.16.20.10/24
 PC-3 = 172.16.30.5/24
 PC-4 = 172.16.30.10/24

Configuration
R1:

60
R1#write erase
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
R1#reload
Proceed with reload? [confirm]

R1(config)#interface fastEthernet 0/0


R1(config-if)#ip address 172.16.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#interface fastEthernet 0/1
R1(config-if)#ip address 172.16.13.1 255.255.255.0
R1(config-if)#no shutdown

R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 172.16.12.1 0.0.0.0 area 0
R1(config-router)#network 172.16.13.1 0.0.0.0 area 0

R2:

R2#write erase
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
R2#reload
Proceed with reload? [confirm]

R2(config)#interface fastEthernet 0/0


R2(config-if)#ip address 172.16.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface fastEthernet 0/1
R2(config-if)#ip address 172.16.20.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface serial 0/1/0
R2(config-if)#ip address 172.16.23.2 255.255.255.0
R2(config-if)#no shutdown

R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 172.16.12.2 0.0.0.0 area 0
R2(config-router)#network 172.16.23.2 0.0.0.0 area 0
R2(config-router)#network 172.16.20.2 0.0.0.0 area 0

61
R3:

R3#write erase
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
R3#reload
Proceed with reload? [confirm]

R3(config)#interface fastEthernet 0/0


R3(config-if)#ip address 172.16.13.3 255.255.255.0
R3(config-if)#no shutdown
R3(config)#interface fastEthernet 0/1
R3(config)#ip address 172.16.30.3 255.255.255.0
R3(config-if)#no shutdown
R3(config)#interface serial 0/1/0
R3(config-if)#ip address 172.16.23.3 255.255.255.0
R3(config-if)#no shutdown

R3(config)#interface fastEthernet 0/0


R3(config-if)#ip ospf 1 area 0
R3(config)#interface fastEthernet 0/1
R3(config-if)#ip ospf 1 area 0
R3(config)#interface serial 0/1/0
R3(config-if)#ip ospf 1 area 0

R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3

PC-1:

PC-2:

62
PC-3:

PC-4:

Varification
About OSPF:
 OSPF is a Dynamic Routing Protocol (IGP).
 Link State Routing Protocol Use Dijkstra SPF Algorithm
 Guarantees Loop Free Topology within Area
 Hierarchy using “areas”
 Fast Convergence
 Efficient Update packets
 Efficient Metric – Cost
 Use Control plane security

How OSPF works?


OSPF maintains three tables;
 Neighbor Table
 Topology Table

63
 Routing Table

OSPF works in three step process;


Step 1
Discover OSPF neighbor and Exchange Topology Information

Step 2
Chose best path via SPF

Step 3
Neighbor and Topology Table maintenance

All neighbor information stores in neighbor table. In topology table OSPF keeps all link
information. All OSPF routers within an area keeps same topology table or all routers within an
area will have same view of the topology. Because OSPF router exchange topology table at the
time of forming adjacency to keep same topology information inside an area. Once topology
table synchronized then Router run SPF algorithm to find the best path and put that path in
Routing table.

Step 1 – Neighbor and Topology discovery

 Like EIGRP, OSPF also use Hello packets to discover neighbor on OSPF enable link.
 Use IP Protocol 89.
 Sends Multicast to 224.0.0.5 or 224.0.0.6 or Unicast.
 Hello packets contain different parameters that neighbor must agree on to form
adjacency.
 Once Neighborship is negotiated, LSDB (Link State Database) is exchanged.

OSPF Router ID
 Identify the node/router in the Link State Graph
 That needs to be different between nodes

Chosen based upon …


 Manual configuration
 Highest Active loopback IP
 Highest Active Interface IP

Note:- Router ID nothing but router name, Cisco recommends to configure Router ID manually.
If router ID is configured manually then router will not take router id automatically.

64
OSPF adjacency occurs when connect neighbors use hello packets to agree on unique and
common attributes. Not all OSPF Neighbors are form adjacency.

OSPF Hello Packets


Initial hello packet is used find neighbor on the link. OSPF Router sends periodic hello packets
out of every OSPF enabled link to maintain neighborship, called hello-interval

Hello Packets contains….


 Router ID
 Area ID
 Subnet mask
 Interface Priority
 Hello and Dead Interval
 Authentication Type and Password
 DR and BDR Address
 Stub Flag
 Router ID of other neighbor of Link

OSPF Packet Type:

 Hello = neighbor discovery, build neighbor adjacencies and maintain them.

 Database Description (DBD) = Carries brief information about local link state database
(LSDB) and used to synchronize LSDB between the routers. Basically this packet is
used to check if the LSDB between 2 routers is the same. The DBD is a summary of the
LSDB.

 Link State Request (LSR) = Request for required LSA from neighbor after DBD’s have
been exchanged successfully.

 Link state Update (LSU) = Sends the required LSA’s to neighbor.

 Link State Acknowledgment (LSAck) = OSPF is a reliable protocol so it use a packet


to acknowledge the others. Acknowledge the receive LSA’s.

OSPF Adjacency State Machine:

65
OSPF Adjacency process uses 8 states to determine progress of Adjacency establishment. If
two routers on a link reaches up to 2-way state that means, both the routers are formed
neighborship. Once they will synchronize their database then they will form adjacency.

 Down
No hellos have been received from neighbor.

 Attempt
Unicast Hello packet has been sent to Neighbor, but no hello has been received back.
This state only used in manually configured NBMA (Non-broadcast Multi Access) neighbors.

 Init
Hello has been received from neighbor, but they have not acknowledged from me.

 2 – way
I have received a Hello packet from neighbor and neighbor has received acknowledged Hello
from me. Also I will see my Router ID in neighbor’s hello packet.
At the end of this stage, the DR (Designated Router) and BDR (Backup Designated Router) for
broadcast and non-broadcast multi-access networks are elected.

***If router cannot go to 2 – way state there could be some possibility of L1 or L2 issue.

 ExStart
This is first step of actual adjacency. Master and Slave relationship is formed, where Master has
higher Router ID.
Master chooses the starting sequence number for the DBD (Database Descriptor) packets that
are used for actual LSA (Link State Advertisement) exchange.

 Exchange
Local Link state database is sent through DBD packets. Database descriptors contain link-state
advertisement (LSA) headers only and describe the contents of the entire link-state database.
Routers also send link-state request (LSR) packets and link-state update packets (which contain
the entire LSA) in this state.

 Loading
Link state Request packets are sent to ask for more information about a particular LSA. The
neighbor then provides the requested link-state information in link-state update packets.

 Full
Neighbors are fully adjacent and database is synchronized.

Step 2: Chose best path via SPF (Shortest Path First) algorithm

66
 Once databases are synchronized path selection begins
 Best path to the link lowest end to end cost
 Multiple equal cost paths are allowed
 Cisco’s implementation bandwidth based cost
Default Cisco Cost = 100 / Link Bandwidth in Mbps

Step 3: Neighbor and Topology Table maintenance

 Hello packets are used to track neighbor changes


 Hello packets are sent to each OSPF enabled link. Hello is sent on every 10 or 30 sec
depending on Interface Type
 If hello packets are not received from a neighbor within dead Interval, Router will be
declared dead. Default dead timer is 4 times of Hello, 40 sec or 120 sec.

OSPF use two level area hierarchies:


 Backbone Area
 Non-Backbone Area

Backbone area is called AREA 0; any other area number is called Non-backbone area. Between
Non-backbone area communication must be through backbone area.
OSPF Router Type:

 Backbone Router = At least one link to area 0.


 Internal Router = Router inside an area, all links in one area.
 Area Border Router = Links in both, area 0 and non-backbone
 Autonomous System Boundary Router (ASBR) = At least one link will be connected
to OSPF domain and least one another link will be connected to outside OSPF domain
and Inject external information inside OSPF domain.

OSPF LSA (Link State Advertisement) Type:

Link state advertisement is an advertisement about link status. In OSPF routing domain routers
are exchanged LSA to build the topology table/LSDB, then SPF will run to build shortest path
tree.

LSA Types are sent depend on –


 Router Type
 OSPF Network Type
 Area Type

67
LSA Types and their name …
 Type 1 = Router LSA
 Type 2 = Network LSA
 Type 3 = Network Summary LSA
 Type 4 = ASBR Summary LSA
 Type 5 = External LSA
 Type 7 = NSSA External LSA

Who is generated what?


- Type 1 = Routers in an area
- Type 2 = DR
- Type 3 = ABR (Area Border Router)
- Type 4 = ABR (Area Border Router)
- Type 5 = ASBR (Autonomous System Boundary Router)
- Type 7 = ASBR in NSSA area

There are total 11 type of LSA exist in OSPF but in CCNA course we will see only first three
type LSA.

LSA Type 1 (Router LSA) – Generated by the routers in an area. Describes, router’s directly
connected Links, what are my link cost, who are my neighbors.

LSA Type 2 (Network LSA) – It is generated by DR in Broadcast and non-broadcast multi-


access network, describes, who is adjacent with DR. Basically it is view of DR on the network.

LSA Type 2 (Network Summary LSA) – It is generated by ABR, describe ABR’s reachability
to links in other area; include cost, but hide ABR’s actual path to the destination.

We have covered lots of theory so far, now let’s do some verification. First we will see
neighborship on all three routers. R1 will form neighborship with R2 and R3 and state will be full,
Likewise R2 will form neighborship with R1 and R3 and state will be full, same will be true for
R3.

R1#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

2.2.2.2 1 FULL/BDR 00:00:30 172.16.12.2 FastEthernet0/0

3.3.3.3 1 FULL/BDR 00:00:31 172.16.13.3 FastEthernet0/1

R2#show ip ospf neighbor

68
Neighbor ID Pri State Dead Time Address Interface

1.1.1.1 1 FULL/DR 00:00:31 172.16.12.1 FastEthernet0/0

3.3.3.3 0 FULL/ - 00:00:30 172.16.23.3 Serial0/1/0

R3#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

1.1.1.1 1 FULL/DR 00:00:31 172.16.13.1 FastEthernet0/0

2.2.2.2 0 FULL/ - 00:00:33 172.16.23.2 Serial0/1/0

Now we will check Topology table (LSDB) of all three routers.

R1#show ip ospf database

OSPF Router with ID (1.1.1.1) (Process ID 1)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count

1.1.1.1 1.1.1.1 1158 0x80000009 0x0028e3 2

3.3.3.3 3.3.3.3 1144 0x8000000a 0x00a7b7 4

2.2.2.2 2.2.2.2 1140 0x8000000a 0x00442d 4

Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum

172.16.12.1 1.1.1.1 1334 0x8000000b 0x00b7be

172.16.13.1 1.1.1.1 1158 0x8000000c 0x0083b1

On every router we will see two type of LSA on the topology table, Type 1 and Type 2. Marked
in Yellow which is type 1 and marked in green which is type 2 LSA. These two types of LSA will
be flooded (send) within the area.
As we know, Type 2 LSA is generated by DR in Broadcast or Non-broadcast multi-access
network, here R1 and R2, R1 and R3 is connected over Ethernet port, Ethernet media is OSPF
detected as Broadcast network that is the reason we see Type 2 LSA. You may check for R2
and R3’s topology table.

69
Now we will check whether our all interfaces are configured on area 0 or not.

R1#sh ip ospf interface brief


Interface PID Area IP Address/Mask Cost State Nbrs F/C
Fa0/1 1 0 172.16.13.1/24 1 BDR 1/1
Fa0/0 1 0 172.16.12.1/24 1 DROTH 0/1

R2#sh ip ospf interface brief


Interface PID Area IP Address/Mask Cost State Nbrs F/C
Se0/1/0 1 0 172.16.23.2/24 64 P2P 1/1
Fa0/0 1 0 172.16.12.2/24 1 DR 1/1
Fa0/1 1 0 172.16.20.2/24 1 DR 0/0

R3#show ip ospf interface brief


Interface PID Area IP Address/Mask Cost State Nbrs F/C
Fa0/1 1 0 172.16.30.3/24 1 DR 0/0
Se0/1/0 1 0 172.16.23.3/24 64 P2P 1/1
Fa0/0 1 0 172.16.13.3/24 1 DR 1/1

All interfaces on all the routers are in area 0. Let’s see routing table of R2.

R2#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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 5 subnets


C 172.16.12.0 is directly connected, FastEthernet0/0
O 172.16.13.0 [110/2] via 172.16.12.1, 03:16:40, FastEthernet0/0
C 172.16.20.0 is directly connected, FastEthernet0/1
C 172.16.23.0 is directly connected, Serial0/1/0
O 172.16.30.0 [110/3] via 172.16.12.1, 03:16:30, FastEthernet0/0

R2 is learning two routes from R1 and “O” indicate OPSF. Now we will check PC to PC ping
test.

70
From PC-1:

From PC-4:

71
2.16 OSPF Static Neighbors and Timers

 Configure OSPF neighbor manually on the link between R1 and R2.


 Change the Hello time to 5 second on R2’s interface Fa0/0.
 Change the Dead interval to 20 sec on R2’s interface Fa0/0.

Configuration
R1:

R1(config)#router ospf 1
R1(config-router)#neighbor 2.2.2.2

R1(config)#interface fastEthernet 0/0


R1(config-if)#ip ospf hello-interval 5
R1(config-if)#ip ospf dead-interval 20

R1(config)#int fastEthernet 0/0


R1(config-if)#ip ospf network non-broadcast

R2:

R2(config)#router ospf 1

72
R2(config-router)#neighbor 1.1.1.1

R2(config)#interface fastEthernet 0/0


R2(config-if)#ip ospf hello-interval 5
R2(config-if)#ip ospf dead-interval 20

R2(config)#interface fastEthernet 0/0


R2(config-if)#ip ospf network non-broadcast

Varification
We already know that, static neighbor is sending unicast instead of multicast. Here in this
scenario it will not work, need to change the network type to NBMA (non-broadcast multi-
access) then R1 and R2 will exchange information over unicast. Network type change is not
covered in CCNA syllabus.
OSPF does not allow static neighbors except in non-broadcast networks, i.e. NBMA or P2MP-
NB. In that case, the multicast communication is completely blocked, unicast communication is
required.

But still I am showing you how to change network type, in the configuration section I changed
the network type to NBMA on R1 and R2’s interface Fa0/0, now R1 and R2 will exchange
unicast packet.

 Before I change network type; R1 was sending multicast (224.0.0.5) hello.

R1#debug ip ospf hello


OSPF hello events debugging is on
OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 172.16.12.1
OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/1 from 172.16.13.1

 After I change network type; R1 is sending unicast (172.16.12.2) hello.

R1#debug ip ospf hello


OSPF hello events debugging is on
OSPF: Send hello to 172.16.12.2 area 0 on FastEthernet0/0 from 172.16.12.1
OSPF: Rcv hello from 2.2.2.2 area 0 from FastEthernet0/0 172.16.12.2
OSPF: End of hello processing

Hello and Dead interval must be same on both end of the link to form adjacency. In question
said, change hello and dead interval only on R2, but you have to change on R1 as well. Also
changing the hello interval automatically changes the dead interval on the interface. But do not

73
depend on automatic change, just do it yourself. Now we will see how to check hello and dead
interval.

R2#show ip ospf interface fastEthernet 0/0


FastEthernet0/0 is up, line protocol is up
Internet Address 172.16.12.2/24, Area 0
Process ID 1, Router ID 2.2.2.2, Network Type NON_BROADCAST, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 2.2.2.2, Interface address 172.16.12.2
Backup Designated router (ID) 1.1.1.1, Interface address 172.16.12.1
Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:03
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
[…output omitted…]

R1#show ip ospf interface fastEthernet 0/0


FastEthernet0/0 is up, line protocol is up
Internet Address 172.16.12.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type NON_BROADCAST, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 2.2.2.2, Interface address 172.16.12.2
Backup Designated router (ID) 1.1.1.1, Interface address 172.16.12.1
Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:04
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
[…output omitted…]

74
2.17 OSPF Multi-Area and Interface Cost

 Configure OSPF are 2 on the link between R1 and R3.


 Configure OSPF such a way that when you are trying to reach network 172.16.30.0/24
from network 172.16.20.0/24 traffic should go via R2R3, not through R1.

Configuration
R1:

R1(config)#router ospf 1
R1(config-router)#network 172.16.13.1 0.0.0.0 area 2

R2:

R2(config)#interface fastEthernet 0/0


R2(config-if)#ip ospf cost 80

R3:

R3(config)#interface fastEthernet 0/0


R3(config-if)#ip ospf 1 area 2

75
Varification
We have configured here OSPF multi area. When you are configuring OSPF multi area just
keep in mind that non-backbone area must be connected to area 0. It is a loop prevention
mechanism OSPF used to prevent loop. In our case, link between R1 and R3 was configured
for area 2 and another link on R1 and R3 was connected to area 0.
First we will check whether the link between R1 and R3 is really on the area 2 or not.

R1#show ip ospf interface brief


Interface PID Area IP Address/Mask Cost State Nbrs F/C
Fa0/0 1 0 172.16.12.1/24 1 BDR 1/1
Fa0/1 1 2 172.16.13.1/24 1 BDR 1/1

R3#sh ip ospf interface brief


Interface PID Area IP Address/Mask Cost State Nbrs F/C
Fa0/1 1 0 172.16.30.3/24 1 DR 0/0
Se0/1/0 1 0 172.16.23.3/24 64 P2P 1/1
Fa0/0 1 2 172.16.13.3/24 1 DR 1/1

Now, next we will check how the traffic is flowing over the network from PC-1.

PC-1:

I used traceroute, it is a tool to check the hop by hop details of traffic flowing. I did the
traceroute to IP 172.16.30.5 from PC-1. From the output we can see the traffic flowing path.
First traffic is going to R2 (172.16.20.2) as the IP I can see on the output. Second, it is going to
R1 (172.16.12.1), then it is going to R3 (172.16.13.3), at last it is reaching to destination, which
is PC-3 (172.16.30.5). I can see hare in my network traffic flow is R2 R1  R3. But question
said, traffic should flow from Subnet 172.16.20.0/24 to 172.16.30.0/24 over the Serial link
between R2 and R3, that means R2  R3. How can we achieve it?

76
There are two path to reach network 172.16.30.0/24 from 172.16.20.0/24. One is, R2  R1 
R3. Another one, R2  R3. We know that OSPF is choosing path through R1 because of best
metric. Now we will compare the metric between both the paths.

Path = R2  R1  R3 = 2
You can see from the routing table before changing cost. See below

R2#show ip route
O IA 172.16.13.0/24 [110/2] via 172.16.12.1, 00:02:07, FastEthernet1/0

Path = R2  R3 = 65
On R2 just shutdown the interface Fa0/0 and check routing table.

R2(config)#interface fastEthernet 0/0


R2(config-if)#shutdown

R2#show ip route
O IA 172.16.13.0/24 [110/65] via 172.16.23.3, 00:00:26, Serial0/1/0

Once you are done then no shutdown the interface.

R2(config)#interface fastEthernet 0/0


R2(config-if)#no shutdown

We have seen both the path metric, now if we increase the metric (metric should be more than
65) on R2’s interface Fa0/0 than the metric which has serial (metric 65) link then we will be able
to see route 172.16.30.0/24 on the R2’s routing table and R2 will receive from R3 directly as
serial link will have lower metric. That means, traffic will flow from R2  R3.

In the configuration section you can see the command ip ospf cost 80 under R2’s Fa0/0, that
will make the change of metric. You will know more about changing cost or route manipulation
in CCNP and CCIE. Now we will check R2’s routing table.

R2#sh ip ospf int brief


Interface PID Area IP Address/Mask Cost State Nbrs F/C
Fa0/1 1 0 172.16.20.2/24 1 DR 0/0
Se0/1/0 1 0 172.16.23.2/24 64 P2P 1/1
Fa0/0 1 0 172.16.12.2/24 80 DR 0/0

R2#show ip route
O IA 172.16.13.0/24 [110/65] via 172.16.23.3, 00:16:16, Serial0/1/0
[…output omitted…]

77
Again we will do the traceroute from PC-1 to check how the traffic is flowing now.

PC-1:

Excellent, now traffic is going to R2  R3  PC-1.

2.18 OSPF Default Route Propagation

 Configure R1 to advertise Default route inside OSPF routing domain.

Configuration

R1:

R1(config)#router ospf 1
R1(config-router)# default-information originate always

Varification
Default routes injected into a normal area can be originated by any OSPF router. The OSPF
router does not, by default, generate a default route into the OSPF domain. In order for OSPF to
generate a default route, you must use the default-information originate command.

R2#show ip route

Gateway of last resort is 172.16.23.3 to network 0.0.0.0

78
O*E2 0.0.0.0/0 [110/1] via 172.16.23.3, 00:07:56, Serial0/1/0
[…output omitted…]

R3#show ip route

Gateway of last resort is 172.16.13.1 to network 0.0.0.0


O*E2 0.0.0.0/0 [110/1] via 172.16.13.1, 00:07:56, Fa0/0
[…output omitted…]

Note- Use the default-information originate with always keyword, or else default route
advertising router must have a 0.0.0.0 route in routing table. Here, always keyword is used as
the advertising router does not have 0.0.0.0 route in the routing table.

2.19 OSPF Passive Interface

 Configure Passive-interface on R2 for interface Fa0/0.

Configuration

R2:

R2(config)#router ospf 1
R2(config-router)#passive-interface fastEthernet 0/0

Varification
OSPF passive interface will stop sending multicast and unicast packet. When you will configure
passive-interface on R2’s interface Fa0/0 after some time you will see a log message on the
screen that neighbor gone down, hold time expired. Because, the interface is not able send
hello to maintain neighborship.

Log message:

R2#

79
%OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on FastEthernet0/0 from FULL to DOWN, Neighbor
Down: Interface down or detached

2.20 Router on a Stick

 Remove all the OSPF configurations from all three routers on diagram 2.
 Do not need to configure IP addresses on R1 and R3’s interfaces.
 Shutdown the R2’s interface Fa0/0 and Serial0/1/0, do not configure IP address.
 Do not use device R1, R3, PC-3 and PC-4.
 Configure VLAN 10 and 20 on SW-1
 Assign VLAN ID 10 on SW-1’s interface Fa0/2.
 Assign VLAN ID 20 on SW-1’s interface Fa0/3.
 Configure IP address on PC-1 and PC-2 as below.
 PC-1 = 172.16.10.5/24 GW IP = 172.16.10.1
 PC-2 = 172.16.20.5/24 GW IP = 172.16.20.1
 Make sure PC-1 and PC-2 can communicate with each other (do not use ip routing on
SW-1)

Configuration
R1:

R1#write erase
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]

80
[OK]
Erase of nvram: complete
R1#reload
Proceed with reload? [confirm]

R2:

R2#write erase
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
R2#reload
Proceed with reload? [confirm]

R2(config)#interface fastEthernet 0/0


R2(config-if)#shutdown
R2(config)#interface serial 0/1/0
R2(config-if)#shutdown

R2(config)#interface fastEthernet 0/1


R2(config-if)#no shutdown
R2(config)#interface fastEthernet 0/1.10
R2(config-subif)#encapsulation dot1Q 10
R2(config-subif)#ip address 172.16.10.1 255.255.255.0
R2(config-subif)#exit
R2(config)#interface fastEthernet 0/1.20
R2(config-subif)#encapsulation dot1Q 20
R2(config-subif)#ip address 172.16.20.1 255.255.255.0

R3:

R3#write erase
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
R2#reload
Proceed with reload? [confirm]

SW-1:

SW-1(config)#vlan 10

81
SW-1(config-vlan)#exit
SW-1(config)#vlan 20

SW-1(config)#interface fastEthernet 0/2


SW-1(config-if)#switchport access vlan 10
SW-1(config-if)#exit
SW-1(config)#interface fastEthernet 0/3
SW-1(config-if)#switchport access vlan 20

SW-1(config)#interface fastEthernet 0/1


SW-1(config-if)#switchport trunk encapsulation dot1q
SW-1(config-if)#switchport mode trunk

PC-1:

PC-2:

Varification

Here in question says that PC-1 and PC-2 will communicate and both are in different VLAN, as
we know that for different VLAN communication we need help of Layer 3 device for routing.
Question also said that we cannot enable ip routing on SW-1. So there is only a option left out
which is Router on a Stick.
This technology does the inter-VLAN routing and we will chose R2 for the same. Router-on-a-
stick is a type of router configuration in which a single physical interface manages traffic
between multiple VLANs on a network. The router interface have to be configured to operate as
a trunk link, also we have to create sub-interface on a physical interface. Actually we are just
logically dividing one physical interface into multiple logical interfaces as per requirement (It will
depend on number of VLAN communication; in our case we need 2 sub-interfaces as we have
only 2 VLAN). Router is connected to a switch port (SW-1) which will have to be configured in

82
trunk mode. The router receives VLAN tagged traffic on the trunk interface from the switch, and
forwards the routed traffic out to destination with VLAN tagged using the same interface.

Explanation of Communication:

 PC-1 on VLAN10 is communicating with PC-2 on VLAN20 through router R1 using


interface Fa0/1.
 PC1 sends its unicast traffic to switch SW-1.
 Switch SW-1 tag the traffic on interface Fa0/1 and forwards the tagged traffic out the
trunk interface towards router R2.
 Router R2 accepts the tagged unicast traffic on interface Fa0/1.10 and routes it to
VLAN20 using its configured sub-interfaces Fa0/1.20.
 The unicast traffic is tagged with VLAN20 as it is sent out the router interface to switch
SW-1. Switch SW-1 removes the VLAN tag of the unicast frame and forwards the frame
out to PC-2 on port Fa0/3.

Now we will do ping testing.

PC-1:

83
PC-2:

2.21 Inter-VLAN Routing using SVI

 Shutdown the Router R1’s interface Fa0/1.


 Shutdown the Switch SW-1’s interface Fa0/1.
 Do not change any IP address on PC.
 PC-1 should communicate with PC-2 using SW-1.

Configuration

SW-1:

84
SW-1(config)#interface vlan10
SW-1(config-if)#ip address 172.16.10.1 255.255.255.0
SW-1(config-if)#exit
SW-1(config)#interface vlan20
SW-1(config-if)#ip address 172.16.20.1 255.255.255.0
SW-1(config-if)#exit
SW-1(config)#ip routing

Varification

Here we have to configure inter-VLAN routing on SW-1, as switch SW-1 is Layer 3 switch we
can configure inter-VLAN routing.
For inter-VLAN routing on a L3 switch, we have to configure VLAN interface or SVI (sometime
people in the networking industry call it as Layer 3 VLAN) and SVI (Switch Virtual Interface)
number must be same as VLAN ID. Then configure IP address under SVI. At last just enable
routing features on the L3 switch by using command ip routing. This is the advantage of using
L3 switch as it can do both Routing as well as switching and we don’t have to rely on Router for
inter-vlan routing.

First we will check routing table on SW-1.

SW-1#show ip route

172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks


C 172.16.10.0/24 is directly connected, Vlan10
C 172.16.20.0/24 is directly connected, Vlan20

Now we will do ping test from PC.

PC-1:

85
PC-2:

86

You might also like