CCNP Notes Routing
CCNP Notes Routing
Lecture # 3
Categories of Routing Protocol: There are two main categories of routing protocol:
Interior Gateway Protocol (IGP): IGPs configured to perform Convergence within an Autonomous
System (AS).
AS: “A network with single/same routing policy is called an AS.” Or “A network with single
administration is called an AS”
Routing Policy: There are different policies for example: Best path, reliability, bandwidth etc. if there are
two different policies then the redistribution will be implemented between these policies.
Redistribution: Allows different routing policies to communicate or it allows routing between different
routing policies. Its act like a translator, translate one administrative policy to another one. For example:
if two languages Chinese and English, than it is used to translate chines to English and English to
Chinese.
(Note: Process delay, more resources utilization in redistribution. So better to choose autonomous
network other than ordinary network.)
RIP, RIP vr2 OSPF, EIGRP, Intermediate System to Intermediate System (IS-IS or Router to Router).
(Note: IS-IS is not in CCNA (R & S), CCNP (R & S), CCIE (R & S) track, its only available or study in CCIE
Service Provider.)
Exterior Gateway Protocol (EGP): It is configured to perform convergence between different AS.
BGP configured on Border Router, ”A router that connects different AS is called border router ”. As
shown in figure 1.
Figure 1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 1
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
(Note: You can have single or multiple border routers in an AS (figure 1). Advantages of multiple border
routers are redundancy, backup and load balancing.)
Administrative Distance (AD): “AD value is a numeric value that defines priority of a routing method”
Note: “S --> with next Hop IP Address” is not a good idea b/c IP could be changed.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 2
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 4
Open Shortest Path First (OSPF):
Properties of OSPF
1:- Algorithm:
OSPF’s algorithm is known as: Link state or DIJKSTRA (*J is silent) or SPF (shortest path first).
“OSPF metric is a property of a link that is why it is called Link State Algorithm”
Note: Dijkstra's algorithm conceived by computer scientist Edsger Dijkstra in 1956 and published in 1959.
4:- Routing Updates: Routing protocols share/advertise information about best path or share routing
table with others. In OSPF, its advertisement is known as “LSA” (Link State Advertisement). OSPF
advertisement is a multicast advertisement.
Note: There are three ways of advertisement: 1- Unicast, 2- Multicast and 3- Broadcast.
1. [Link]
2. [Link]
Note: There are two basics type of a network: 1- Point to Point and 2- Multi-access.
Point to Point: “A network, in which two devices can be connected and communicate with each
other.”
If a network has 30 bits “/30” then host bits left 2 (formula for calculating host that is 22-2 = 4-2 = 2.) it’s
an example of point to point network in which only two IP addresses are available for hosts but it’s not a
valid confirmation of point to point connectivity. Point to point confirmation that you can get by
knowing which protocol/encapsulation is running in the network. In point to point network,
encapsulation is always and only HDLC or PPP.
Multi-access: “A network in which two or more than two devices can be connected or
communicate with each other.”
If a network has /30, /29, /28 and so on we get more hosts by doing this, mean it is a multi-access
network but it’s not a final confirmation that the network is multi-access or not. Multi-access network
confirmation that you can get by knowing which protocol/encapsulation is running in the network. In
multi-access network, encapsulation is Ethernet and Frame relay.
Now come to the point, why there is another multicast address [Link] for OSPF?
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 3
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
OSPF over Multi-access: As we know that the address “[Link]” represents all OSPF enabled devices
but OSPF over multi-access (Ethernet, Frame relay) is a special case in which the address “[Link]” is
used. (We’ll study more detail of this address in next lectures.)
Note: In OSPF updates are incremental and triggered. Only changed updates are triggered.
The OSPF Metric is a “COST”. “Cost is a simple small and a unit less number”.
Note: The cost is a derived and calculated number. It’s not a constant number.
Cost ∝ 1 /BW
By this formula we have this definition: “A path with the minimum cost is the best path in OSPF”.
Cost Calculation: Dijkstra said cost is always equal to 1 not less than 1, the days Dijkstra calculated the
cost, maximum bandwidth was 100Mbps, and he derived constant (reference bandwidth) equal to
Maximum bandwidth available in those days.
Reference Bandwidth
Constant
Cost =
Bandwidth
Maximum Bandwidth
So, Bandwidth = 100Mbps, Constant = 100Mbps. By putting these values into formula, we get cost=1.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 4
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
From A (1) through A1 (64) through A2 (10) through B (1) to X/24 = 76 = Cost
From A (64) through B1 (1) through B2 (64) through B (1) to X/24 = 130 = Cost
As we know a path with minimum cost is the best path, so the path with 76 cost is the best path.
GE = 1000Mbps = Bandwidth
Cost = 100/1000 = 0.1 ≈ 1 which is less than 1 so the system considered it approximately 1.
In the above scenario unequal load balancing is performed, even though GE link is better than FE,
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 5
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
by considering this Dijsktra stated “Constant is Configurable”. So with the presence of GE, constant
value becomes “Constant = 1000 Mbps”.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 6
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 5
Open Shortest Path First (OSPF):
6:- OSPF Tables: Routing procedure/mechanism in OSPF is reliable and efficient. For reliability and
efficiency, three tables are created in OSPF:
1- Neighbor Table
Every OSPF enable device sends HELLO packet to confirm OSPF enable devices in its neighbor. For
example three routers with protocol OSPF ‘A’, ‘B’ and ‘C’ are connected with each other. ‘A’ will send
HELLO packet to ‘B’ and ‘C’ to confirm its neighbor with OSPF and ‘B’ will send HELLO packet to ‘C’ and
‘A’, similarly ‘C’ will send HELLO packet to ‘B’ and ‘A’ to confirm either it is OSPF enable device or not
and then keep information of all OSPF enable devices in Neighbor Table.
Note: Only OSPF enable devices share routing information with OSPF enable devices in their Neighbors.
What if a device/router ‘D’ added in neighbors of ‘A’, ‘B’ and ‘C’ with protocol RIP and later on OSPF runs
on it, shares routing information with ‘A’, ‘B’,’C’. It is a drawback that an un authenticated/unknown
router ‘D’ added in network with OSPF and gets the routing information from neighbors. To get rid of it
“An Encrypted Password is added” in HELLO packets of authenticated routers ‘A’, ‘B’ and ‘C’. (In coming
lectures we’ll study it in details.)
2- Database Table
All possible paths to reach the destination are placed in database table. It is also known as topology
table.
3- Routing Table
Routing Table contains the best paths to reach the destination network.
Note: If the best path lost/vanished in routing table, no problem we can copy again the best path
information form database table. This is an advantage of Database Table.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 7
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
7:- OSPF supports both kind of routing “Class-less Routing” and “Class-full Routing”.
10:- OSPF is designed for large size networks or ASs and its convergence time is fast.
We can divide large size OSPF enabled AS into ‘AREAS’ for fast convergence.
If an administrator feels that the convergence time is slow than he can divide a large size AS system to
AREAS for fast convergence.
Note: In one large AS 232 Areas can be created, it’s not practically possible.
A1 A2
A Large Size AS 1
A3 A4
1 1
Divided into Areas
Note: SPF calculations are performed per ‘Area’. Area1 has its own SPF calculations. Area2 has its own
and so on. At the end total calculation performed of all areas.
Single Area OSPF, we have already study in CCNA, we’ll study Multiple Area in this CCNP course.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 8
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
1- Process ID
2- Area ID
3- Wildcard Mask
4- Router ID
Question: In which ways two different policy base AS cloud connect with each other?
1st Case:
Two Autonomous Systems AS -1 and AS-2, AS-1 running RIP and AS-2 running OSPF on it. These are two
diff AS with different policies. To connect these isolated AS, on independent border routers BGP will
applies on A and on B. As in figure-1.
Figure -1
2nd Case: In this case redistribution will apply on both different autonomous system on common border
router B. As in figure-2.
Figure -2
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 9
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
3rd Case: In this case routing policies are same neither we apply BGP on it nor redistribution. And in this
case routing information automatically shares with each other if policy is not implemented which is a
bad idea but policy base routing implements on both sides.
Figure -3
To overcome on above case OSPF with Process ID will be implemented (as in figure-4). On single router
with OSPF, Process ID has no significance but a router with a common border, process id has importance
b/c with these different process ids we have two different AS with different polices and redistribution
implements in this case.
Note: Process ID differentiates between different autonomous systems on a common border router. As in
figure below on Router B.
Figure -4
In Router B two OSPF databases are created by OSPF-5 and OSPF-7 and do not be merge until
redistribution applies with policy.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 10
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
More clearly:
B#router ospf 1
B#interface [Link]
exit
B#router ospf 5
B#interface [Link]
exit
B#router ospf 7
B#interface [Link]
B#interface [Link]
Exit
Note: above are not complete commands these are just for an example.
Three databases are created on common border router B but these databases do not merge until
redistribution performed with policy like ACL etc.
Note: Process id is locally significant. Process ID does not advertise with routing.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 11
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
2- Area ID: It must be configure in case of Single/Multiple OSPF. We can divide AS (Autonomous System)
into small Areas. OSPF can never be configured without area, atleast one area is required for OSPF.
3- Wildcard Mask: It is an inverse of subnet mask. Its result indicates how many available IP addresses
or IP subnets are within certain VLSM (Variable Length Subnet Mask) network.
Note: Wildcard mask we can say it is an inverse of subnet mask of any class for example in:
Class A the subnet mask is [Link] and wildcard mask in inverse i.e. [Link]
Class B the subnet mask is [Link] and wildcard mask in inverse i.e. [Link]
Class C the subnet mask is [Link] and wildcard mask in inverse i.e. [Link]
We can also get wildcard mask by subtracting subnet mask from broadcast IP.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 12
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 6
OSPF Router ID:
As we know, every OSPF enabled device/router sends hello packet to its neighbors to collect information
of OSPF enable devices and it keep that information in its neighbor table against some id that id is
known as “Router ID”.
Note: Router ID/IP Address is a concept in OSPF it does not mean it is an IP Address of a router.
Methods to configure Router ID: There are three different ways/methods to configure OSPF Router ID.
[Link]
[Link] [Link]
[Link]
#Router OSPF 1
It will start searching for OSPF Router ID and selects highest IP Address on physical interface for OSPF
Router ID for process ‘OSPF 1’.
Note: Every OSPF Process has its own OSPF Router ID/IP Address.
Note: if a router has reloaded or OSPF Process has restarted than OSPF Router ID ll again elect on the
basis of highest IP address of physical interfaces.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 13
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: A Router has diff virtual Interfaces and Loopback interface is one of them. We can add/create no.
of loopback interfaces on a router. It is just for testing purposes. 0-2147483647 loopback interfaces can
be created.
In the presence of loopback interfaces the physical interfaces do not participate in OSPF Router ID
election and with the highest loopback interface IP address, selected for OSPF Router ID. In the figure
above [Link] selected for OSPF Router ID.
Note: It is better than the method-1 but same if router has reloaded or OSPF Process has restarted than
OSPF Router ID ll again elect on the basis of highest IP address of loopback interfaces.
3- Hard Coded Router ID: The 3rd method is Hardcoded Router ID, in this method an administrator select
OSPF Router ID himself. It is more reliable than the previous two methods.
R(config-if)#no shutdown
R(config-if)#no keepalive
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 14
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R1
R1#configure terminal
R1(config-if)#No shutdown
R1(config-if)#exit
R1(config-if)#no shutdown
R1(config-if)#no keepalive
R1(config-if)#exit
R1#write
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 15
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R2
R2#configure terminal
R2(config-if)#No shutdown
R2(config-if)#exit
R2(config-if)#No shutdown
R2(config-if)#exit
R2(config)#interface loopback 0
R2(config-if)#no shutdown
R2(config-if)#no keepalive
R2(config-if)#exit
R2(config-if)#no shutdown
R2(config-if)#no keepalive
R2(config-if)#exit
R2#write
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 16
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R3
R3#configure terminal
R3(config-if)#No shutdown
R3(config-if)#exit
R3(config-if)#no shutdown
R3(config-if)#no keepalive
R3(config-if)#exit
R3#write
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 17
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 7
Single Area OSPF Configuration LAB
AREA 0
Tasks
A- Election on R1
C- Hardcoded ID on R3
3- Per Platform/Global on R3
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 18
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: Before configuring any protocol on router, first should check is there any route/routing protocol is
configured/running or not.
Command Description
#Show IP route Privileged EXEC Mode command to verify IP Route.
#Show IP protocols Privileged EXEC Mode command to verify IP
Protocols.
R1#config t
R1(Config)#router ospf 1 (As we enter this command OSPF Router ID will be selected. )
Command Description
#Show IP ospf OR #show ip protocols Privileged EXEC Mode commands to verify Router
ID. choose the highest IP address of any other
physical interface.
R1#config t
R1(Config)#router ospf 1
Command Description
R1(Config)#router ospf 1 Global Configuration Mode Command, Starts OSPF
process 1. The process ID is any positive integer
value between 1 and 65,535.
R1(Config-router)#network OSPF advertises interfaces, not networks. Uses the
wildcard mask to determine which interfaces to
advertise
Note: OSPF does not accept discontinuous wild card mask (see page 12).
For example if we enter the wrong wildcard mask like network [Link] [Link] router will generate
the following error.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 19
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Command Description
#show ip aliases Privileged EXEC Mode commands to verify Directly
connected IP.
R2#config t
R2(Config)#router ospf 1 (As we enter this command OSPF Router ID will be selected. )
Command Description
#Show IP ospf OR #show ip protocols Privileged EXEC Mode commands to verify Router
ID. choose the highest loopback IP address if
configured
Note: Now when you launch the OSPF process, the router ID will be picked amoung existing addresses. If
after that you set it manually, or set a loopback that should become the router ID, the change won't take
place until you reset the OPF process, or reload the router.
Or run “show running” copy the particular OSPF configuration on notepad and then3. run “no router ospf
1” and again configure the OSPF in this way you can get the right Router OSPF ID.
Command Description
#Show ip aliases Privileged EXEC Mode commands to verify directly
connected IP address.
R2(config)#router ospf 1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 20
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Hardcoded ID on R3
R3(config)#router ospf 1
R3(config-router)#router-id [Link]
Command Description
R3(config-router)#router-id <id> By this command you can configure hardcoded
OSPF router id.
3- Per Platform/Global on R3
Note: This method is not practically recommended. This method is almost for lab environment. All
interfaces (current and coming) of router 3 will advertise in area 0. This method is not recommended in
multiple area ospf and in boder router case.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 21
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Verifications On Router 1
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
R1#show ip protocols
Note: FULL means the router is fully adjacent with its neighbor mean routing is complete. The Dead Time
field indicates the amount of time remaining that the router waits to receive an OSPF hello packet from
the neighbor before declaring the neighbor down. On broadcast and point-to-point media, the default
dead interval is 40 seconds.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 22
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Verifications On Router 2
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
R2#sh ip protocols
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 23
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Verifications On Router 3
R3#sh ip route
R3#sh ip protocols
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 24
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 8
Multiple Area OSPF
Remember OSPF Area created in AS not AS created in Area. AS is a set and Area is its subset.
In this multiple area AS, every single area has its own ‘SPF’, neighbor table, database table and each
area shares information after completing its internal calculation for example routing information etc.
A0 shares with A2, A1 and A2 with A0, A3 and A3 with A1, A2 and A1 with A0, A3 but in this design we
have a drawback that is “Loopback”.
With the help of a little change we can avoid from Loop. As shows in figure below.
A1
A5 A2
A0 Figure 3
A4 A3
Let say we have created a special area A0, and all other area A1, A2, A3, A4 and A5 are directly
connected with A0. In this case all blue colored areas do not share SPF information with each other,
These area’s share SPF information with special area A0. For example A1 needs information about A3
than A0 will provide this information to A1 and so on.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 25
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
In Figure 3 ‘A0’ is a backbone area and in blue colors areas are regular areas.
Note: The backbone acts as a hub for inter-area transit traffic and the distribution of routing information
between areas. The OSPF backbone area is also known as area 0. And there is no two backbone areas in
an AS.
1
a
re
A
Note: in 48 port multilayers switch 42 routers can be connected, 6 ports are for trunk.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 26
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
S2/0 S2/1
S2/0 S2/0
[Link]
[Link] [Link] [Link]
R1 R2
Loopback 0
[Link]
Answer: There is no problem b/c we have two areas i.e. Area 0 ‘backbone area’ and Area 1 ‘regular
area’.
1) Internal Router
2) OSPF backbone Router
i) Backbone Internal Router
ii) Area Border Router (ABR)
3) Autonomous System boundary Router (ASBR)
1)Internal Router: “A router with all interfaces in a regular area is called an Internal Router.”
2) Backbone Router: “A router with at least single interface in backbone is called a Backbone Router”
A router with all interface in backbone area is called a backbone internal router. R1 is backbone
internal router.
3)ASBR: “A Router that connects an OSPF domain with a non OSPF domain (RIP, IGRP)”
Note: Redistribution is must in ASBR. One router can be ABR & ASBR.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 27
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R1
R1(config)#router ospf 1
R2
R2(config)#router ospf 1
R3
R3(config)#router ospf 1
Verifications
Router R1
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 28
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R2
R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Router R3
R3#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Note: Intra Area routes are the "O" routes that you see in the routing table. These routes are routes that
are in the same area. Inter-area routes are the "O IA" routes that are learned in different areas.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 29
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 9
Tasks: ABR and ASBR in Lab
S2/0 S2/1
S2/0 S2/0
[Link]
[Link] [Link] [Link]
R1 R2
Loopback 0
[Link]
R1
R1(config)#router ospf 1
R2
R2(config)#router ospf 1
R3
R3(config)#router ospf 1
Note: For ABR and ASBR please see page no. 27 of lecture # 8.
Command Description
#Show ip ospf neighbor Privileged EXEC Mode commands to verify OSPF
neighbors.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 30
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
On router R2 run “Show ip ospf neighbor” to verify OSPF is running properly or not.
Command Description
#Show ip ospf Privileged EXEC Mode commands to verify router
ID, ABR, ASBR.
By running this command “Show ip ospf” on router R1 we don’t get the information about ABR, ASBR its
mean this router is not ABR or ASBR. Now by running this command on router R2 we get the following
information:
R2#show ip ospf
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 31
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Command Description
#Show ip ospf interface brief Privileged EXEC Mode command to Display a
summary of OSPF interfaces, PID, Area, Ip Address,
cost, state etc..
Note: This command is useful to rectify mistake. For example an interface added in wrong area.
There are different ways to make R3 to ASBR for example add a ‘Router R4’ and configure OSPF 2/ RIP or
EIGRP on it or Add/configure Null route on router R3. We’ll adopt Null Routes considering we don’t have
4th router.
Note: In a router we can create virtual interfaces even virtual Autonomous System.
Suppose we have four LAN with different network id. i.e. And suppose this is a 4th router.
[Link]/24
[Link]/24
[Link]/24
[Link]/24
R3#conf t
R3(config)#ip route [Link] [Link] null 0
R3(config)#ip route [Link] [Link] null 0
R3(config)#ip route [Link] [Link] null 0
R3(config)#ip route [Link] [Link] null 0
Now you can see there are two different domain on router 3, one is OSPF domain and another is static
domain.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 32
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Now run show ip route on R3 you can see the static route:
As we know we have a different virtual domain “Static” on router 3 to inject static to OSPF we have to
redistribute static to OSPF.
R3(config)#router ospf 1
Note:’ Subnet’ mean classfull and classless both are redistributed. This is only happen in OSPF protocol
not in other protocols like rip, eigrp etc there is no need for ‘subnet’. Must remember to add’ subnet’ in
OSPF while redistributing.
Two way redistribution is called mutual redistribution for example RIP into OSPF and OSPF into RIP.
R3#sh ip ospf
For External OSPF routes run this command “show ip route ospf” on R2.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 33
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Verification on R2
Verification on R1
As we have noticed in R2 and R1, redistributed routes are with ‘O E2’ and with same cost=20. ‘E’ for
external. According to rules cost should be change while crossing WAN link cost should be 64 on router
R2 and cost 128 on router R1.
• E1
• E2 (Default)
What is difference between E and E2 for understanding this first understand what is ‘Metric’.
Internal Metric: always calculated while crossing any link. For example for two WAN link calculation is
64+64=128
Note: As we know the metric of rip is ‘hope count/distance’ and OSPF’s metric is ‘cost’ there is no
comparison between hope count and cost. Distance cannot be converted in cost. For this in OSPF there
is fix cost that is “20” for external routes (Rip, EIGRP etc ) but in other protocols we have to define it.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 34
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
If OSPF type is ‘O E2’ than External/Seed metric is added and if OSPF type is ‘O E1’ than Seed + internal
added.
“Configure O E2 when there is single path and single ASBR”. ”processing saved”.
More concisely:
“If we have single ASBR and ASBR is reachable by single path than should configure O E2”.
And
“Configure O E1 when there are multiple ASBR or multiple paths to reach single ASBR”.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 35
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R3(config)#router ospf 1
In some cases for example we have two ASBR and we want to route traffic with O E1 and some traffic
with O E2 or for some traffic with metric 20 and other for 10, it is possible in policy base routing (PBR).
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 36
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 10
We have discussed static route, redistribution in previous lecture. And now…
For Data
[Link]
S 2/0 FE 0/0
[Link]
Point A Point B
S 2/0 FE 0/1
Data B
FE 0/0 FE 0/0
[Link]
Voice
S 2/1 FE 0/2
A D
[Link]
S 2/0 FE 0/1
[Link]
C
For Voice
By running OSPF in this AS all routers are converged. Router receives traffic of network [Link]/8 from
two paths and cost are same for this traffic that is 64+1+1=66. Load balancing is also in this scenario.
Traffic generated from Point A to Point B will reach from two paths you may say load balancing is
performed on this traffic half traffic form A B D and half from A C D.
Now we want that the “Data” traffic use this path A B D and “Voice” use path A B D. for this
situation we have to define some policies, this is called PBR or
“A routing with Administrator defined policy is called Policy Base Routing (PBR)”
There are tools for policy making there is no built in mechanism for PBR in any routing protocol we have
to use 3rd party tools like ACL. “ACL is a list of IP addresses and network IDs that can be used in many
ways e.g. NAT, security, PBR etc.”
3- Route Map
4- Distributed List
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 37
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
1- Access Control List: ACL Can be defined and apply. Policy making and implementation both are
available in ACL. Access lists filter network traffic by controlling whether routed packets are forwarded
or blocked at the router's interfaces. Permit and deny mechanism performed in ACL.
2- Prefix List or IP Prefix List: It is like ACL. Policy making and implementation both are available in Prefix
list with littler change in ACL we use wildcard mask with network and in Prefix list we use variable length
like in [Link]/24. Where [Link] is prefix and /24 is a prefix length. Permit and deny
mechanism performed in Prefix List.
Note: ACL and Prefix List does not support to change cost or seed matric, metric type, next hop etc.
3- Route Map: we can say route map is a set and ACL& Prefix list are its subset. To change in cost or
seed matric, metric type, next hop etc Route Map is used.
4- Distributed List: it is different from ACL, prefix list and route map. “It is used for implementation ACL,
route map and prefix list only in routing protocols”
Route Map
“It is used for advance policy. Route Map is just a combination of ‘match’ and ‘set’ clauses/conditions”.
According to our scenario “Data” traffic use this path A B D and “Voice” use path A B D. Or
data and voice used same path. For this we’ll use Route-Map.
Route-Map Structure:
Sequence: Any Sequence number 10, 20, 30, 100, 1000. You can say “how many Actions or equal to
action are performed.”
Match and Set: Match and set are conditions e.g. match data and set next hope.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 38
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note:
After last sequence must make an empty sequence 50. Empty sequence means “Match Any Set
Nothing”. Must make this sequence otherwise all data other than data, voice will discarded.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 39
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
AREA 1
Static route on R3
[Link]/24
[Link]/24
[Link]/24
[Link]/24
Tasks:
1) For network [Link]/24 and [Link]/24, matric type = 2 and seed matric = 10
2) For network [Link]/24 and [Link]/24, matric type = 1 and seed matric = 30
3) Two ACLs. ACL-1 for network [Link]/24 and [Link]/24 and ACL-2 for network
[Link]/24 and [Link]/24.
R1
R1(config)#router ospf 1
R2
R2(config)#router ospf 1
R3
R3#conf t
R3(config)#ip route [Link] [Link] null 0
R3(config)#ip route [Link] [Link] null 0
R3(config)#ip route [Link] [Link] null 0
R3(config)#ip route [Link] [Link] null 0
R3(config)#router ospf 1
R3(config-router)#network [Link] [Link] area 1
R3(config-router)#network [Link] [Link] area 1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 40
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: In Route-Map we cannot directly match IP address and network IDs we have to make ACL first. IN
route-map whole ACL could be matched. And in ACL there could be one network or multiple network, one
IP or could be multiple IPs.
R3#conf t
R3(config)#route-map CCNP permit 30 Empty Route-Map
R3(config)#router ospf 1
R3(config-router)#redistribute static subnets route-map CCNP
R3(config-router)#end
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 41
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Verifications on R2
R2#sh ip route
Before Policy
O E2 [Link]/24 [110/20] via [Link], 00:14:23, Serial2/1
O E2 [Link]/24 [110/20] via [Link], 00:14:14, Serial2/1
O E2 [Link]/24 [110/20] via [Link], 00:14:09, Serial2/1
O E2 [Link]/24 [110/20] via [Link], 00:13:59, Serial2/1
After Policy
O E2 [Link]/24 [110/10] via [Link], 00:00:27, Serial2/1 seed=10 Metric-Type=2
O E2 [Link]/24 [110/10] via [Link], 00:00:27, Serial2/1 seed=10 Metric-Type=2
O E1 [Link]/24 [110/94] via [Link], 00:00:29, Serial2/1 seed=30 Metric-Type=1
O E1 [Link]/24 [110/94] via [Link], 00:00:29, Serial2/1 seed=30 Metric-Type=1
Verifications on R1
R1#sh ip route
Before Policy
O E2 [Link]/24 [110/20] via [Link], 00:14:23, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:14:14, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:14:09, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:13:59, Serial2/0
After Policy
O E2 [Link]/24 [110/10] via [Link], 00:00:27, Serial2/0 seed=10 Metric-Type=2
O E2 [Link]/24 [110/10] via [Link], 00:00:27, Serial2/0 seed=10 Metric-Type=2
O E1 [Link]/24 [110/158] via [Link], 00:00:29, Serial2/0 seed=30 Metric-Type=1
O E1 [Link]/24 [110/158] via [Link], 00:00:29, Serial2/0 seed=30 Metric-Type=1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 42
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 11
Policy Base Routing LAB
Router “Data”
conf t
Hostname DATA
interface fastEthernet 0/0
ip address [Link] [Link]
no sh
ip route [Link] [Link] [Link] Default Routing
End
Command Description
# ip route [Link] [Link] (Forwarding router's Global configuration mode command To set the
address ) gateway of last resort on a router. Default Routing.
Router “Voice”
conf t
Hostname VOICE
interface fastEthernet 0/0
ip address [Link] [Link]
no sh
ip route [Link] [Link] [Link] Default Routing
End
Router R1
conf t
interface serial 2/0
ip address [Link] [Link]
no sh
interface serial 2/1
ip address [Link] [Link]
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 43
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
no sh
interface fastEthernet 0/0
ip address [Link] [Link]
no sh
Router R2
conf t
interface serial 2/0
ip address [Link] [Link]
no sh
Router R3
conf t
interface serial 2/0
ip address [Link] [Link]
no sh
end
wr
Router R4
conf t
interface serial 2/0
ip address [Link] [Link]
no sh
inter fa 0/0
ip address [Link] [Link]
no sh
no keep
end
wr
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 44
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
OSPF On R1
Conf t
Router ospf 1
passive-interface fastEthernet 0/0
network [Link] [Link] Area 0
Command Description
# passive-interface fastEthernet 0/0 Global configuration mode command to specify a
particular interface as a passive-interface in the
dynamic routing process.
Note: A passive interface does not send or process received hello’s thus not forming a neighbor
relationship or advertising routes.
OSPF On R2
Conf t
Router ospf 1
network [Link] [Link] Area 0
OSPF On R3
Conf t
Router ospf 1
network [Link] [Link] Area 0
OSPF On R4
Conf t
Router ospf 1
network [Link] [Link] Area 0
ACLs on R1
conf t
ip access-list standard DATA
permit [Link] [Link]
exit
ip access-list standard VOICE
permit [Link] [Link]
end
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 45
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Route-Map on R1
Command Description
# route-map Name/tag [permit | deny] Global configuration mode command defines a
[sequence-number] route map to control filtering.
Command Description
# match Name /tag [name ACL] Router configuration mode command matches
routes with a specified name, to be used as the
route map is referenced.
Conf t
Route-map PBR permit 10
match ip address DATA
set ip next-hop [Link]
exit
end
Command Description
# ip policy route-map (name) Interface configuration mode command To
identify a route map to use for policy routing on an
interface.
conf t
int fa 0/0
ip policy route-map PBR Route-Map implementation on common point Fast Ethernet 0/0 on R1
end
wr
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 46
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Verification On R1
Before Ping command from Router “Data” and “Voice” Results are:
Command Description
#Show route-map Privileged EXEC Mode command, displays
information about route maps configured on the
router.
R1#show route-map
After Ping command from Router “Data” and “Voice” Results are:
R1#sh route-map
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 47
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 12
Policy Base Routing (Continue)
It is multipurpose, used in security, quality of service, policy base routing and NAT.
Note: In single line ACL we can use range of IP addresses or range of Network IDs and wildcard mask
used for this ranges.
As we know IP format is: x.x.x.x. No.1 octet start from 1 to 255 same for Octet no 2 ,3 and 4.
IP Address
X X X X
Format
0 0 0 0
Full Range To To To To
255 255 255 255
Note: Each Octet 0 to 255 is known as its Full Range. Total 0 to 255 = 256
Single
Octet 256 128 64 32 16 8 4 2 1
Division
0-255 0-127 0-63 0-31 0-15 0-7 0-3 0-1 0
128-255 64-127 32-63 16-31 8-15 4-7 2-3 1
128-191 64-95 32-47 16-23 8-11 4-5 2
192-255 96-127 48-63 24-31 12-15 6-7 3
Groups
128-159 64-79 32-39 16-19 8-9 4
160-159 | | | | |
192-233 | | | | |
224-255 240-255 248-255 252-255 254-255 255
If we have a Range of IP addresses than group can be choose from this table, we cannot cross this
boundary. e.g.
We have a range of IP addresses is “[Link] to [Link] “ total IPs are four than we can select group “4-7”
of block#4, all four IP addresses are set in this group. In this case we have only one ACL for permit/deny.
Could it be set in any single group? No, because there is no such group for this range in the table, it
could be divide into two groups. i.e. 6-7 and 8-9 of block #2 in the table. “Starting and Ending values
should be match”. In this case we have two ACLs for permit/deny.
Suppose 4th octet of any IP range. Wild Card mask for the range for:
Suppose we have IP Addresses range from [Link] to [Link]. By subtraction we can get
wild card mask for this range. e.g.
[Link] is a wild card mask for this range and we have it already in the table above.
[Link] – [Link] = [Link] but it is not possible we don’t have this wild card mask In the
table as well.
For this ACL can be written as : [Link] [Link] (for 8-11 IP Addresses)
Suppose we have Network IDs range from “[Link]/24 to [Link]/24”. Here 3rd octet is varying.
No problem for this we have the combination above in block 32 of the table. i.e.
Network ID 172 16 0 0
Wildcard Mask 0 0 31 255
3rd Octet is for Network and the 4th octet is for the host, mean we have 32 network and each network
has 256 host. i.e.
Suppose we have a range of network id from [Link] to [Link] to calculate its wildcard mask.
Note: Only network ID will match, neither host nor broadcast ID will match.
“[Link]” is a wild card mask and It can be used in ACL but you cannot use this wildcard mask in OSPF.
Because this dis-contagious wildcard mask for OSPF we have to add 255 instead of 0 to make it
contagious i.e. “[Link]” in this way host and broadcast ID will match.
Class “A”
Range is 0-127
[Link] Start
[Link] End
[Link] Wild Card Mask
Class “B”
Range is 128-191
[Link] Start
[Link] End
[Link] Wild Card Mask
Class “B”
Range is 192-223
[Link] Start
[Link] End
[Link] Wild Card Mask
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 50
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Mathematics of ACL
Suppose we have Range [Link] [Link]. Wild card tells us we have 4 IPs in this range.
Convert the 4th octet in to binary of starting address and wild card mask i.e.
Wild card mask tells the system to make the combination of 31st and 32nd bit of the starting address i.e.
In
Bits 31 32
Decimal
Starting
0 0 0 0 0 0 0 0 0
Address
0 0 0 0 0 0 0 1 1
0 0 0 0 0 0 1 0 2
WM 0 0 0 0 0 0 1 1 3
Another Example
Suppose we have Range [Link] [Link]. Wild card tells us we have 4 IPs in this range.
Convert the 4th octet in to binary of starting address and wild card mask i.e.
Wild card mask tells the system to make the combination of 30th, 31st and 32nd bit of the starting address
i.e.
In
Bits 30 31 32
Decimal
Starting
0 0 0 0 0 1 0 0 4
Address
0 0 0 0 0 1 0 1 5
0 0 0 0 0 1 1 0 6
WM 0 0 0 0 0 1 1 1 7
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 51
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Static route on R3
[Link]/24
[Link]/24
[Link]/24
[Link]/24
Tasks:
1) For network [Link]/24 and [Link]/24, matric type = 2 and seed matric = 10
2) For network [Link]/24 and [Link]/24, matric type = 1 and seed matric = 10
R1
Conf t
router ospf 1
network [Link] [Link] area 1
R2
Conf t
router ospf 1
network [Link] [Link] area 1
R3
conf t
ip route [Link] [Link] null 0
ip route [Link] [Link] null 0
ip route [Link] [Link] null 0
ip route [Link] [Link] null 0
router ospf 1
network [Link] [Link] area 1
network [Link] [Link] area 1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 52
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Conf t
access-list 1 permit [Link] [Link] For Even Network
access-list 2 permit [Link] [Link] For Odd Network
conf t
router ospf 1
redistribute static subnets route-map CCNP
end
Verifications on R2
R2#sh ip route
Before Policy
O E2 [Link]/24 [110/20] via [Link], 00:14:23, Serial2/1
O E2 [Link]/24 [110/20] via [Link], 00:14:14, Serial2/1
O E2 [Link]/24 [110/20] via [Link], 00:14:09, Serial2/1
O E2 [Link]/24 [110/20] via [Link], 00:13:59, Serial2/1
After Policy
Verifications on R1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 53
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R1#sh ip route
Before Policy
O E2 [Link]/24 [110/20] via [Link], 00:14:23, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:14:14, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:14:09, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:13:59, Serial2/0
After Policy
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 54
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 13
OSPF Packet Types
As we know routing procedure of OSPF protocol is: neighbor ship, completing database table than
routing table than forwarding. OSPF uses five different packets from neighbor table to routing table.
In OSI reference modal the network layer attached its header to segment received form transport layer
become IP Packet. There is a filed for OSPF and EIGRP in this IP header, known as OSPF/EIGRP packet.
Note: RIP is an UDP base protocol uses port # 520 and BGP is TCP based but OSPF and EIGRP are pure
network layer protocol not depending on port numbers. There is unique ID for Network protocols. For
OSPF it is 89 and for EIGRP it is 88.
The values of 2 and 3 indicate OSPF versions 2 and 3 respectively. Version 2 for IPv4
Version
and version 3 is for IPv6.
Differentiates the 5 types of OSPF packets.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 55
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Hello packets are OSPF packet Type 1. These packets are multicast periodically to
[Link] multicast address on all interfaces enabling dynamic discovery of neighbors
Hello
and maintain neighbor relationships. Its “Data” contains list of neighbor or neighbor
table.
Describes your database to your neighbors or List of existing LSAs. For link-state
routing protocol, it is required that the link-state databases for all routers remain
DBD synchronized. The synchronization starts as soon as the adjacency is formed between
neighbors. OSPF uses Database Descriptor (DBD) packets for this purpose. DBD “Data”
is list of existing LSAs (Link State Advertisement)
Request for missing LSA and its “Data” is a list of missing LSAs. After DBD packets
LSR exchange process, the router may find it does not have an up-to-date database. The
LSR packet is used to request pieces of neighbor database that is more up-to-date.
Demanded/ Requested LSAs are in Link State Update Packet. Each LSA contains
LSU
routing, metric and topology information to describe a portion of OSPF network.
Its “Data” field is empty. Link State Acknowledgment (LSAck) packets are OSPF packet
LSAck Type 5. OSPF requires acknowledgment for the receipt of each LSA. Multiple LSAs can
be acknowledged in a single LSAck packet.
Note: Hello is periodic packet, exchanged in every 10 seconds to maintain neighbor table. Rest four
packets are not periodic.
OSPF Neighbors only exchange Hello packet and OSPF Adjacent Neighbors exchange all 5 packets.
If DBD has changed in one router than it will triggered the DBD “unicast”.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 56
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Hello
A B
DBD
LSR
LSU F C
LSAck
E D
Suppose we have a Multi-Access Network with Network ID [Link]/8. There is a change in DBD packet
of Router E it will send to all routers than all routers send LSR to Router E and Router E will send LSU to
all routers after receiving LSR, all routers also send LSU to Router E and in last Router E sends LSAck to
all routers and all routers also send LSAck to Router E.
We have configured OSPF in this multi-access network like point to point but this is not a good idea
because there is a chance of network choking in this case. Here the change is occur only in Router E,
what if there is a change in all routers A,B,C,D and F? Result is network Chock. As shown in figure above
there is no chance of data forwarding.
To overcome on it “Dijkstra” already provided the solution for this. That will be study in next lecture.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 57
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 14
OSPF Over Multi-Access Network
In previous lecture we discussed Multi-Access network in this network OSPF was running like point to
point network that cause network chock burden router processor etc.
The behavior of OSPF over Multi-Access network should be different from the behavior of Point to Point
network.
Every single router sends Hello to all OSPF routers in the network and as we know these packets are
multicast periodically to [Link] in every 10 seconds and become neighbors of each other after
exchanging hello packet.
Every multi-access network has a Designated Router and Backup Designated Router.
For example, on multi-access networks, DR and BDR serve as the central point for exchanging OSPF
routing information. Each DRO router will exchange routing information only with the DR and BDR,
instead of exchanging updates with every router on the network segment. DR will then distribute
information to every other router inside the same area. This reduces OSPF traffic.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 58
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
To send routing information to a DR or BDR the multicast address of [Link] is used. DR or BDR sends
routing updates to the multicast address of [Link]. If DR fails, BDR takes over its role of redistributing
routing information.
Note: Every router on a network segment establishes a full neighbor relationship with the DR and BDR.
DR others routers establish a two way neighbor relationship between themselves.
DR:
1. Router with the highest interface OSPF priority will become a DR. By default, all routers have a
priority of 1 and priority can be changed. Priority Value is form 0 to 255.
2. If there is a tie, a router with the highest router ID wins the election. In figure above Router A is DR.
Note: Any router with priority 0 means is not participating in DR, BDR election.
BDR:
The router with the second highest OSPF priority or router ID will become a BDR.
After DR, BDR election if a router with highest priority 250 added in network than already elected DR,
BDR are remain intact DR and BDR. And if, DR is down than BDR become DR and that newly added
router with highest priority, selected as a BDR. And if previous DR again up than it acts like a DRO.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 59
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
In Network (W) Router A is DR with priority 200 and BDR is Router B with priority 100, DRO is
Router Z with interface FE0 priority 10.
In Network (X) Router C is DR with priority 150 and BDR is Router Z with interface FE1 and
priority 100, DRO is Router D with priority 10.
In Network (Y) Router Z is DR with interface and priority 200 and BDR is Router F with priority
150, DRO is Router E with priority 50.
Network (Z) is with default priority 1. DR and BDR are elected on Highest Router ID. Router Z
with ID [Link] is DR and Router H with ID [Link] is BDR, Router G is DRO.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 60
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: On point-to-point links a DR and BDR are not elected since only two routers are directly connected.
In this multi-access network there is DR and BDR with default priority and DR and BDR selected on
Highest Router ID.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 61
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 15
OSPF Over Multi-Access Network LAB
Tasks:
LAB:
R1
R1#Conf t
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip add
R1(config-if)#ip address [Link] [Link]
R1(config-if)#no sh
R1(config-if)#no keepalive
R1(config-if)#end
R2
R2#Conf t
R2 (config)#interface fastEthernet 0/0
R2 (config-if)#ip add
R2 (config-if)#ip address [Link] [Link]
R2 (config-if)#no sh
R2 (config-if)#no keepalive
R2(config-if)#end
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 62
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R3
R3#Conf t
R3 (config)#interface fastEthernet 0/0
R1(config-if)#ip add
R3 (config-if)#ip address [Link] [Link]
R3 (config-if)#no sh
R3 (config-if)#no keepalive
R3(config-if)#end
R4
R4#Conf t
R4 (config)#interface fastEthernet 0/0
R4 (config-if)#ip add
R4 (config-if)#ip address [Link] [Link]
R4 (config-if)#no sh
R4 (config-if)#no keepalive
R4(config-if)#end
Command Description
R1(config-if)#ip ospf priority <0-255> Interface configuration mode command to set the
OSPF priority.
R1
R1#Conf t
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip ospf priority 200
R1(config-if)#exit
R2
R2#Conf t
R2(config)#interface fastEthernet 0/0
R2(config-if)#ip ospf priority 150
R2(config-if)#exit
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 63
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R1
R1(config)#router ospf 1
R2
R2(config)#router ospf 1
R3
R3(config)#router ospf 1
R4
R4(config)#router ospf 1
Router R1
R1#
R1#
Router R2
R2(config-router)#
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 64
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R2(config-router)#
Router R3
Router R4
We have noticed on R1 and on R3, 3 messages LOADING to FULL, Loading Done received but on the
other hand there are 2 messages on R3 and R4 why?
It is because,
Router R1
Note: Here Router R1 is adjacent with R2, R3 and R4. This is why three messages received on Router R1.
We are also getting the information about BDR and DROTHERs.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 65
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R2
Note: Here Router R2 is adjacent with R1, R3 and R4. This is why three messages received on Router R2.
And we are also getting the information about DR and DROTHERs.
Router R3
Note: Here Router R3 is only adjacent with R1 and R2 this is why two messages received on Router R3.
With router [Link] it is only a neighbor. And we are also getting the information about DR, BDR and
DROTHERs on router R3.
Router R4
Note: Here Router R4 is only adjacent with R1 and R2 this is why two messages received on Router R4.
With router [Link] it is only a 2WAY/DROther neighbor. DR, BDR and DROTHERs are shown here too.
Command Description
R1#show ip ospf interface <interface> Privileged EXEC Mode commands to verify OSPF on
interface.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 66
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R1
Backup Designated router (ID) [Link], Interface address [Link] BDR Information
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:06
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 4 msec
Router R2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:07
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 67
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R3
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:00
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Router R4
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:04
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 68
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Command Description
R1#show ip ospf interface brief Privileged EXEC Mode commands to verify OSPF,
briefly on interfaces of router.
Command Description
Privileged EXEC Mode commands to display
information on adjacency events related to Open
Shortest Path First (OSPF), such as packets being
R1#debug ip ospf adj
dropped due to a Time-to-Live (TTL) security
check. To disable debugging output, use the no
form of this command.
For changing in DBD of OSPF routers add loopback interface on all routers.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 69
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R4(config)#interface loopback 1
As we entered the Loop back address the results are below on R1, R2 and R3.
R1#
*Mar 1 00:14:56.447: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
R2#
*Mar 1 00:14:46.647: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
*Mar 1 00:14:46.819: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
R3#
*Mar 1 00:14:35.023: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
R4#
*Mar 1 00:15:04.303: OSPF: Build router LSA for area 1, router ID [Link], seq 0x80000003
*Mar 1 00:15:04.555: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
Here we have noticed that the R3 (DRO) only receive update from R1 (DR) not directly from R4 (DRO).
And R2 (BDR) received update directly from R4 and from R1.
R2#conf t
R2(config)#interface loopback 1
R2(config-if)#ip address [Link] [Link]
R2(config-if)#
*Mar 1 00:49:57.531: OSPF: Build router LSA for area 1, router ID [Link], seq 0x80000004
R1#
*Mar 1 00:50:07.363: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
R3#
*Mar 1 00:49:45.799: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
R4#
*Mar 1 00:50:15.291: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
Here we have noticed that the R2 (BDR) sends update directly to R1 (DR), R3 (DRO) and R4 (DRO).
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 70
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R1#conf t
R1(config)#interface loopback 1
R1(config-if)#ip address [Link] [Link]
R1(config-if)#
*Mar 1 00:58:49.955: OSPF: Build router LSA for area 1, router ID [Link], seq 0x80000004
R2#
*Mar 1 00:58:40.255: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
R3#
*Mar 1 00:58:28.459: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
R4#
*Mar 1 00:58:57.947: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
Here we have noticed that the R1 (DR) sends update directly to R2 (BDR), R3 (DRO) and R4 (DRO).
R3(config)#interface loopback 1
R3(config-if)#
*Mar 1 00:40:29.755: OSPF: Build router LSA for area 1, router ID [Link], seq 0x80000004
*Mar 1 00:40:29.871: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
R1#
*Mar 1 00:40:51.347: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
R2#
*Mar 1 00:40:41.611: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
*Mar 1 00:40:41.663: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
R4#
*Mar 1 00:40:59.447: OSPF: Rcv LS UPD from [Link] on FastEthernet0/0 length 76 LSA count 1
Here we have noticed that the R4 (DRO) only receive update from R1 (DR) not directly from R3 (DRO).
And R2 (BDR) received update directly from R3 and from R1 also.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 71
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
1. Down
2. INIT (1-Way)
3. 2-Way
4. Ex Start
5. Exchange
6. Loading
7. Full
Down This is the first OSPF neighbor state. It means that no information (hellos) has been
received from this neighbor or Hello packet is mismatched, but hello packets can still be
sent to the neighbor in this state.
During the fully adjacent neighbor state, if a router doesn't receive hello packet from a
neighbor within the RouterDeadInterval time or if the manually configured neighbor is
being removed from the configuration, then the neighbor state changes from Full to
Down.
INIT (1-Way) This state specifies that the router has received a hello packet from its neighbor, but the
receiving router's ID was not included in the hello packet. When a router receives a
hello packet from a neighbor, it should list the sender's router ID in its hello packet as an
acknowledgment that it received a valid hello packet.
2-Way This state designates that 2 way communications has been established between two
routers. 2-way means that each router has seen the other's hello packet. DR and BDR
are elected in this state.
Ex Start Process of Adjacency started form Ex-start state. DBD start from it. In this state, the
routers and their DR and BDR establish a master-slave relationship and choose the
initial sequence number for adjacency formation. The router with the higher router ID
becomes the master and starts the exchange, and as such, is the only router that can
increment the sequence number.
Remember that the DR/BDR election might be purely by virtue of a higher priority
configured on the router instead of highest router ID. Thus, it is possible that a DR plays
the role of slave. And also note that master/slave election is on a per-neighbor basis.
If adjacency is stuck or hanged in Ex start state the only reason is MTU mismatched.
To ignore MTU:
Exchange In the exchange state, OSPF routers exchange database descriptor (DBD) packets.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 72
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Database descriptors contain link-state advertisement (LSA) headers only and describe
the contents of the entire link-state database.
Loading In this state, the actual exchange of link state information occurs. Based on the
information provided by the DBDs, routers send link-state request packets. The
neighbor then provides the requested link-state information in link-state update
packets. During the adjacency, if a router receives an outdated or missing LSA, it
requests that LSA by sending a link-state request packet. All link-state update packets
are acknowledged.
Full Completion of process In this state, router is fully adjacent with each other. All the
router and network LSAs are exchanged and the routers' databases are fully
synchronized.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 73
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 16
OSPF LSA Types
There are 11 types of LSA but in CCNP, 7 types of LSAs are discussed:
Sr # LSA-Types Name
1 LSA-1 Router LSA
2 LSA-2 Network LSA
3 LSA-3
Summary LSA
4 LSA-4
5 LSA-5 External LSA
6 LSA-6 Multicast LSA
7 LSA-7 NSSA LSA
Router LSA Type 1 is generated by every router for each link that belongs to an area. “When a router
advertises its directly connected networks to its neighbors within same area is called “Router LSA””.
Displays with “O”. They are generated only inside of area to which they belong.
When a router advertises routing information received from a neighbor to another neighbor with the
same area is known as LSA-2. Usually generated by Designated Router (DR) for multi-access networks
and describe the routers that are connected to that segment. They are sent inside the area/same area to
which the network segment belongs. Displays with “O”.
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 74
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
When LSA-1 and LSA-2 become LSA-3 on changing their Area is known as LSA-3 “Summary LSA”. In type
3 LSAs are advertised networks from an area to the rest of the areas in AS. In routing table it displays in
“OIA”
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
LSA-4 does not appear in routing table. LSA-4 appears in database table. This type of LSAs contains
routes information to ASBR.
(Remember the Lecture # 9 and #10 ABR & ASBR LAB and Policy Base Routing Lab)
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 75
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Type 7 LSA allow injection of external routes throug Not-so-Stubby-Areas (NSSA). Generally external
routes are advertised by type 5 LSA but they are not allowed inside any stub area. That’s why Type 7
LSA is used, to trick OSPF. Type 7 LSA is generated by NSSA ASBR and is translated into type 5 LSA as it
leaves the area by NSSA ABR, which is then propagated throughout the network as type 5 LSA.
Area Types:
Stub Area:
“Such Area where only single exit point”. LSA-5 is not allowed to enter or to be generated in stub area.
A stub area is an area which does not receive route advertisements external to the autonomous system.
An ABR converts/delete type 5 LSAs from internal routers, sends them a default route of [Link] and
turns itself into a default gateway.
Benefit is this, OSPF regular areas are configured to manage resources, and it reduces LSDB and routing
table size for internal routers.
In this area LSA-5 and Summary LSA are blocked/not allowed to be entered. Default route is the
replacement of LSA-5 and Summary LSA.
Note: Default route is dynamically generated by OSPF in case of stub or totally stub.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 76
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
LSA-5 can be generated but cannot be received or you may say the ASBR generate addresses with a
type 7 LSA, the ABR converts a type 7 LSA to type 5 and sends it to other areas.
Note: Default route is not dynamically generated in NSSA. Administrator manually generates the default
route in NSSA whenever needed.
Totally NSSA:
LSA-5 and Summary LSAs are not be allowed in Totally NSSA but LSA-5 converts in LSA-7 and generated.
Default route dynamically generated.
In Summarized Form:
No Type 3 (Summary)LSA
No Type 5 (External )LSA
Totally Stub Area
NO ASBR
Default route is dynamically generated
No Type 3 (Summary)LSA
No Type 5 (External )LSA
Totally NSSA
ASBR Allowed
Default route dynamically generated
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 77
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 17
OSPF LSA Types LAB
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 78
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Command Description
Privileged Exec Mode commands to Show
R1#Show ip route summary
Summarized Route information.
Command Description
R1(config)#router ospf 1 Router configuration Mode commands to make
R1(config-router)#area 1 stub stub area.
Router R1
R1(config)#router ospf 1
R1(config-router)#area 1 stub
*Mar 1 00:35:50.835: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Serial2/0 from FULL to DOWN,
Neighbor Down: Adjacency forced to reset Regular area mismatch
R1#
R2(config)#router ospf 1
R2(config-router)#area 1 stub
After Configuring Stub Area there should not be LSA 5 on Router R1 And should be default route
injected by ABR.
R1#show ip route
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 79
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 80
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Command Description
R2(config)#router ospf 1 Router configuration Mode commands to make
R2(config-router)#area 1 stub no-summary not so stubby area.
Note: As we know that the ABR generates the LSA-3 so we will configure Total Stubby Area on R2 (ABR).
Router R2
R2(config)#router ospf 1
R2(config-router)#area 1 stub no-summary
Before Configuring Totally Stub Area After Configuring Totally Stub Area
Note: If there is already a static route on exist on R1 and R2 generated default route dynamically than
the administrative distance ll be noted for routing.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 81
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 82
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: Stub Area and NSSA are not configurable if we want to configure both Areas on Area 1.
R1(config)#router ospf 1
R1(config-router)#area 1 nss
R1(config-router)#area 1 nssa
R1(config-router)#
*Mar 1 00:21:42.471: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Serial2/0 from FULL to DOWN,
Neighbor Down: Adjacency forced to reset
R2(config)#router ospf 1
R2(config-router)#area
R2(config-router)#area 1 nss
R2(config-router)#area 1 nssa
R2(config-router)#
*Mar 1 00:23:04.111: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Serial2/0 from LOADING to
FULL, Loading Done
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 83
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Gateway of last resort is not set Gateway of last resort is not set
R3#show ip route
R2(config)#router ospf 1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 85
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R2(config)#router ospf 1
Gateway of last resort is [Link] to network [Link] Gateway of last resort is [Link] to network [Link]
No Type 3 (Summary)LSA
No Type 5 (External )LSA
ASBR Allowed
Default route dynamically generated
Note: Technically Router 1 have two default routes form Router 2 one as LSA-7 and other as LSA-3 as
default route. Lowest LSA highest priority.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 86
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 18
Route Summarization/Supernetting Or Classless Inter Domain Routing:
Route Summarization is combining several IP network addresses into one IP network address. It reduces
the number of entries in a routing table.
Let say we have a range and we want to summarize these addresses. How?
[Link]/24 To [Link]/24
Address Range 1st Octet 2nd Octet 3rd Octet 4th Octet
[Link] 11000000 10101000 00000000 00000000
[Link] 11000000 10101000 00000001 00000000
[Link] 11000000 10101000 00000010 00000000
[Link] 11000000 10101000 00000011 00000000
Secondly, match the common bits (which are shown in black). Lastly, the numbers of common bits are
counted i.e. 22. The summary route is found by setting the mismatched bits to zero, as shown below. It
is followed by a slash and then the number of common bits.
1st Octet 2nd Octet 3rd Octet 4th Octet Address Netmask
11000000 10101000 00000000 00000000 [Link] /22
For Every
128 64 32 16 8 4 2 1 Address
Octet
st
1 Octet 1 1 0 0 0 0 0 0 64+128=192
2nd Octet 1 0 1 0 1 0 0 0 128+32+8=168
3rd Octet 0 0 0 0 0 0 0 0 0
4th Octet 0 0 0 0 0 0 0 0 0
Subnet mask: By converting all 22 matched bits to “1” and mismatched bits to “0”.
For Every
128 64 32 16 8 4 2 1 Subnet Mask
Octet
st
1 Octet 1 1 1 1 1 1 1 1 64+128+32+16+8+4+2+1=255
2nd Octet 1 1 1 1 1 1 1 1 64+128+32+16+8+4+2+1=255
3rd Octet 1 1 1 1 1 1 0 0 64+128+32+16+8+4+0+0=252
4th Octet 0 0 0 0 0 0 0 0 0+0+0+0+0+0+0+0=0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 87
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Address Range 1st Octet 2nd Octet 3rd Octet 4th Octet
[Link] 11000000 10101000 00000100 00000000
[Link] 11000000 10101000 00000101 00000000
[Link] 11000000 10101000 00000110 00000000
[Link] 11000000 10101000 00000111 00000000
[Link] 11000000 10101000 00001000 00000000
Secondly, match the common bits (which are shown in black). Lastly, the number of common bits is
counted i.e 20. The summary route is found by setting the mismatched bits to zero, as shown below. It is
followed by a slash and then the number of common bits.
Octets 1st Octet 2nd Octet 3rd Octet 4th Octet Netmask
Binary 11000000 10101000 00000000 00000000
Decimal 192 168 0 0 /20
Note: Outgoing interface must be same and single to perform Route Summarization. It is performed for
resource management. [Link]/18 Interface S/0/0/0
Shortest Way for Route Summarization: What if we have a range from 1 to 65 than?
First and the last address of the range, is converted into binary format:
Address Range 1st Octet 2nd Octet 3rd Octet 4th Octet
[Link] 11000000 10101000 00000001 00000000
[Link] 11000000 10101000 00100001 00000000
Secondly, match the common bits (which are shown in black). Lastly, the number of common bits is
counted i.e 18. The summary route is found by setting the mismatched bits to zero, as shown below. It is
followed by a slash and then the number of common bits.
Octets 1st Octet 2nd Octet 3rd Octet 4th Octet Netmask
Binary 11000000 10101000 00000000 00000000
Decimal 192 168 0 0 /18
Note: This is the best way of calculation for route summarization. There is another way for
summarization please listen the audio of 18th lecture ”Route Summarization”.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 88
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 89
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: In OSPF there are only two LSAs on which Route Summarization is performed i.e. LSA-3 and LSA-5
or Route Summarization In OSPF, is only supported for LSA-3 and LSA-5.
Route Summarization for LSA-3 in configured on ABR and Route Summarization for LSA-5 is configured
on ASBR.
First and the last address of the range, is converted into binary format:
Address Range 1st Octet 2nd Octet 3rd Octet 4th Octet
[Link] 11000000 10101000 00000001 00000000
[Link] 11000000 10101000 00000011 00000000
Secondly, match the common bits (which are shown in black). Lastly, the number of common bits is
counted i.e 22. The summary route is found by setting the mismatched bits to zero, as shown below. It is
followed by a slash and then the number of common bits.
Subnet mask: By converting all 22 matched bits to “1” and mismatched bits to “0”.
Octets 1st Octet 2nd Octet 3rd Octet 4th Octet Netmask
Address Binary 11000000 10101000 00000000 00000000
Address Decimal 192 168 0 0 /22
Subnet Mask Binary 11111111 11111111 11111100 00000000
Subnet Mask Decimal 255 255 252 0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 90
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
First and the last address of a range, is converted into binary format:
Address Range 1st Octet 2nd Octet 3rd Octet 4th Octet
[Link] 10101100 00001000 00000000 00000000
[Link] 10101100 00001011 00000000 00000000
Secondly, match the common bits (which are shown in black). Lastly, the number of common bits is
counted i.e 14. The summary route is found by setting the mismatched bits to zero, as shown below. It is
followed by a slash and then the number of common bits.
Subnet mask: By converting all 14 matched bits to “1” and mismatched bits to “0”.
Octets 1st Octet 2nd Octet 3rd Octet 4th Octet Netmask
Address Binary 11000000 00001000 00000000 00000000
Address Decimal 192 16 0 0 /14
Subnet Mask Binary 11111111 11111100 00000000 00000000
Subnet Mask Decimal 255 252 0 0
Router R1
R1(config)#router ospf 1
R1(config-router)#network [Link] [Link] area 1
R1(config-router)#network [Link] [Link] area 1
Router R2
R2(config-router)#network [Link] [Link] area 1
*Mar 1 00:15:09.323: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Serial2/0 from LOADING to
FULL, Loading Done
R2(config-router)#network [Link] [Link] area 1
R2(config-router)#net [Link] [Link] area 0
R2(config-router)#net [Link] [Link] area 0
Router R3
R3(config)#router ospf 1
R3(config-router)#network [Link] [Link] area 0
*Mar 1 00:20:42.139: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Serial2/0 from LOADING to
FULL, Loading Done
R3(config-router)#network [Link] [Link] area 0
R3(config-router)#network [Link] [Link] area 0
R3(config-router)#network [Link] [Link] area 0
R3(config-router)#network [Link] [Link] area 0
R3(config-router)#network [Link] [Link] area 0
R3(config-router)#redistribute static subnets
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 91
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Command Description
R3(config)#router ospf 1 Router configuration Mode commands to
R3(config-router)# summary-address <summary Summarized Routes.
address> <summary mask>
R3(config)#router ospf 1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 92
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Route Summarization for Loopback Addresses Range on Router 2 (ABR) for LSA-3.
Command Description
R2(config)#router ospf 1 Router configuration Mode commands to
R2(config-router)# area 0 range <summary Summarized Routes on ABR.
address> <summary mask>
R2(config)#router ospf 1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 93
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
It is like ACL. Policy making and implementation both are available in Prefix list with littler change in ACL
we use wildcard mask with network and in Prefix list we use variable length like in [Link]/24.
Where [Link] is prefix and /24 is a prefix length. Permit and deny mechanism performed in Prefix
List.
Note: ACL is used for packet filtering and Prefix list is used to filter routes.
Prefix & length both should be same you want to permit/deny. If [Link] prefix is same but length
is /25 than prefix list does not work properly.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 94
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 19
As we discussed in previous lecture, “Route Summarization” performed on LSA- 3 and LSA- 5. For LSA-5
configuring on ASBR by “summary-address” command and for LSA-3 on ABR by “area 0 range”
command.
Now we’ll filter different LSAs in OSPF. After applying filtration on LSAs, communication will stop. In
summarization summarized route is injected for communication but in filtration there is no concept of
default route or summarized route.
Prefix is a route or network with its length i.e. [Link]/24. Prefix list deny/permit prefix.
In CCNA we have read two kinds of ACL Standard and Extended. Standard ACL is a Source IP based.
Deny/permit packet with source IP on the other hand Extended ACL is a source IP, destination IP and
port number based. Port number mean protocol like ping, telnet etc. Deny/permit ping, http, ftp or
telnet traffic is performed in extended ACL.
But prefix list is little different form ACL, it denies/permit route or network, incoming or outgoing.
Note: Deny and permit in Prefix-List exact match of prefix and its length is must. ip prefix-list CCNP deny
[Link]/24.
If asked for summarized single IP than base network will summarized for it, for example:
[Link]/32 is a single subnetted and its base network is [Link]/8. [Link]/8 is summarized for [Link]/32.
Distributed List:
It is different from ACL, prefix list and route map. “It is used for implementation ACL, route map and
prefix list, only in routing protocols”.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 95
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
S2/0 S2/1
S2/0 S2/0
[Link] Loopback Interfaces on R3
[Link] [Link] [Link]
Loopback 0
[Link]/24
R1 R2 [Link] [Link]/24
[Link]/24
[Link]/24
Router R1
Command Description
#ip prefix-list name [ seq number ] { permit | Global configuration Mode command for Prefix-
deny } prefix [ eq length | [ ge length ] [ le list.
length ]]
Conf t
R1(config)#ip prefix-list OE2 deny [Link]/24 le 26
R1(config)#ip prefix-list OE2 permit [Link]/0 le 32
Command Description
Router configuration Mode command to
#distribute-list prefix {name} in
implement Prefix-list.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 96
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Command Description
Exec Mode command to refresh routing table.
#Clear Ip route *
Delete expired entries immediately.
Command Description
Router configuration Mode command for Area
(config-router)#area 1 filter-list prefix {name} in
specific filtration.
Note: If applying “ip prefix-list” on router R2 to deny [Link]/32 than it denies this prefix on router R2
but Router R1 still receive [Link]/32 from R2. Why? Applying Ip prefix list we use Distribute list that
applies between Routing DB and Routing Table it denies/permits path in RT not in DB.
Can be verify by “show ip ospf database“ and “show ip route ospf” in exec mode on Router R2 after
applying distribute list on Router R2. Same as on Router R1.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 97
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
As we know, two regular areas do not communicate directly, backbone area is must between two
regular areas. There is a solution for it i.e. OSP Virtual Link.
1. Virtual Link is always configured between two routers/routing devices. It can be a multilayer
switch (MLS)
2. One Router must be ABR.
3. These two routers must have a common regular area between them.
Now we have to confirm which two routers are suitable for virtual link as we know that virtual link is
created between two routers in which one router must be ABR and a common regular area is must .
Virtual Link is not suitable between R2 and R3 it is suitable between R1 and R2 because conditions are
fulfilled.
Now R2 is Virtually ABR and there are total two links between R1 and R2. Virtual link encapsulated in
Area1.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 98
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: Two times neighbor ship is performed between R1 and R2 because of one physical link and one due
to virtual link.
Router R1
R1(config)#router ospf 1
R1(config-router)#network [Link] [Link] area 0
R1(config-router)#network [Link] [Link] area 1
Router R2
R2(config)#router ospf 1
R2(config-router)#network [Link] [Link] area 1
R2(config-router)#network [Link] [Link] area 1
*Mar 1 00:16:01.931: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Serial2/0 from LOADING to
FULL, Loading Done
R2(config-router)#network [Link] [Link] area 2
R2(config-router)#network [Link] [Link] area 2
Router R3
R3(config)#router ospf 1
R3(config-router)#network [Link] [Link] area 2
R3(config-router)#network [Link] [Link] area 2
R1#sho ip route
C [Link]/8 is directly connected, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0
O [Link]/24 [110/65] via [Link], 00:08:50, Serial2/0
R2#sh ip route
C [Link]/8 is directly connected, Serial2/0
C [Link]/8 is directly connected, Serial2/1
O IA [Link]/24 [110/65] via [Link], 00:07:03, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0
[Link]/32 is subnetted, 1 subnets
C [Link] is directly connected, Loopback0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 99
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R3#show ip route
C [Link]/8 is directly connected, Serial2/0
[Link]/32 is subnetted, 1 subnets
O [Link] [110/65] via [Link], 00:00:07, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0
Note: As we know, Virtual link is depended upon Router ID so first note down the Router ID of those
router where Virtual Link is to be configure.
*See Lecture No. 6 for Router ID
#show ip ospf
#show ip protocols
R1(config)#router ospf 1
R1(config-router)#area 1 virtual-link [Link]
R1(config-router)#
*Mar 1 01:02:37.539: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on OSPF_VL0 from LOADING to
FULL, Loading Done
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 100
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R2(config)#router ospf 1
R2(config-router)#area 1 virtual-link [Link]
R2#
*Mar 1 01:02:36.163: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on OSPF_VL0 from LOADING to
FULL, Loading Done
*Mar 1 01:02:36.827: %SYS-5-CONFIG_I: Configured from console by console
Note: If OSPF Router ID is changed than Virtual Link is down and if physical link on which virtual link is
dependent, is down Virtual link is down. That is why Virtual link is not stable.
Double neighbor ship with R2 one is through virtual link and another with serial link. There is no dead
time for Virtual link b/c its depend on physical link.
Note: In virtual Link, hello packet is unicast and not repeatable/not periodic.
Neighbor ID Pri State Dead Time Address Interface Neighbor ID Pri State Dead Time Address Interface
[Link] 0 FULL/ - 00:00:35 [Link] Serial2/0 [Link] 0 FULL/ - - [Link] OSPF_VL0
[Link] 0 FULL/ - 00:00:39 [Link] Serial2/0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 101
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Neighbor ID Pri State Dead Time Address Interface Neighbor ID Pri State Dead Time Address Interface
[Link] 0 FULL/ - 00:00:32 [Link] Serial2/0 [Link] 0 FULL/ - - [Link] OSPF_VL0
[Link] 0 FULL/ - 00:00:32 [Link] Serial2/1 [Link] 0 FULL/ - 00:00:37 [Link] Serial2/0
[Link] 0 FULL/ - 00:00:37 [Link] Serial2/1
Note: On router 2, double neighbor ship due to virtual link. Before Virtual link, network
[Link] was inter-route (O- IA) now it is intra-route (O) b/c of virtual link.
C [Link]/8 is directly connected, Serial2/0 O IA [Link]/8 [110/128] via [Link], 01:39:38, Serial2/0
[Link]/32 is subnetted, 1 subnets C [Link]/8 is directly connected, Serial2/0
O [Link] [110/65] via [Link], 00:00:07, Serial2/0 O IA [Link]/24 [110/129] via [Link], 01:39:28, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0 O IA [Link]/24 [110/65] via [Link], 01:39:38, Serial2/0
[Link]/32 is subnetted, 1 subnets
O [Link] [110/65] via [Link], 01:39:38, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0
Neighbor ID Pri State Dead Time Address Interface Neighbor ID Pri State Dead Time Address Interface
[Link] 0 FULL/ - 00:00:36 [Link] Serial2/0 [Link] 0 FULL/ - 00:00:31 [Link] Serial2/0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 102
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Solution: Virtual Link between R1 and R2 and then between R2 and R3.
Note: Every router must have 8 routes in its routing table. And try to build each router’s routing table in
your mind this is the best way to stronger yours concepts. For example how many paths are with O, OIA
or O-EA etc.
Router R1
R1(config)#router ospf 1
R1(config-router)#network [Link] [Link] area 0
R1(config-router)#network [Link] [Link] area 1
Router R2
R2(config)#router ospf 1
R2(config-router)#network [Link] [Link] area 1
R2(config-router)#network [Link] [Link] area 1
R2(config-router)#network [Link] [Link] area 2
R2(config-router)#network [Link] [Link] area 2
Router R3
R3(config)#router ospf 1
R3(config-router)#network [Link] [Link] area 2
R3(config-router)#network [Link] [Link] area 2
R3(config-router)#network [Link] [Link] area 3
Router R4
R4(config)#router ospf 1
R4(config-router)#network [Link] [Link] area 3
R4(config-router)#network [Link] [Link] area 3
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 103
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Neighbor ID Pri State Dead Time Address Interface Neighbor ID Pri State Dead Time Address Interface
[Link] 0 FULL/ - 00:00:34 [Link] Serial2/0 [Link] 0 FULL/ - 00:00:37 [Link] Serial2/0
[Link] 0 FULL/ - 00:00:36 [Link] Serial2/1
Router R3 Before Virtual Link Router R4 Before Virtual Link
R3#show ip route R4#show ip route
O [Link]/24 [110/65] via [Link], 00:10:31, Serial2/1 C [Link]/24 is directly connected, FastEthernet0/0
C [Link]/8 is directly connected, Serial2/0 C [Link]/8 is directly connected, Serial2/0
C [Link]/8 is directly connected, Serial2/1
[Link]/32 is subnetted, 1 subnets
O [Link] [110/65] via [Link], 00:11:52, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0
Neighbor ID Pri State Dead Time Address Interface Neighbor ID Pri State Dead Time Address Interface
[Link] 0 FULL/ - 00:00:31 [Link] Serial2/0 [Link] 0 FULL/ - 00:00:34 [Link] Serial2/0
[Link] 0 FULL/ - 00:00:34 [Link] Serial2/1
O IA [Link]/24 [110/193] via [Link], 00:26:08, Serial2/0 O IA [Link]/24 [110/129] via [Link], 00:19:46, Serial2/1
C [Link]/8 is directly connected, Serial2/0 C [Link]/8 is directly connected, Serial2/0
O IA [Link]/8 [110/128] via [Link], 00:26:08, Serial2/0 C [Link]/8 is directly connected, Serial2/1
O IA [Link]/8 [110/192] via [Link], 00:26:08, Serial2/0 O IA [Link]/8 [110/128] via [Link], 00:19:46, Serial2/1
C [Link]/24 is directly connected, FastEthernet0/0 O [Link]/24 [110/65] via [Link], 00:27:54, Serial2/0
O [Link]/24 [110/65] via [Link], 00:30:13, Serial2/0 C [Link]/24 is directly connected, FastEthernet0/0
[Link]/32 is subnetted, 1 subnets [Link]/32 is subnetted, 1 subnets
O IA [Link] [110/65] via [Link], 00:26:08, Serial2/0 C [Link] is directly connected, Loopback0
O IA [Link]/24 [110/129] via [Link], 00:18:13, Serial2/0 O [Link]/24 [110/65] via [Link], 00:19:46, Serial2/1
O [Link]/24 [110/65] via [Link], 00:26:32, Serial2/1 C [Link]/24 is directly connected, FastEthernet0/0
O IA [Link]/8 [110/128] via [Link], 00:17:47, Serial2/0 O IA [Link]/8 [110/192] via [Link], 00:08:22, Serial2/0
C [Link]/8 is directly connected, Serial2/0 O IA [Link]/8 [110/128] via [Link], 00:09:00, Serial2/0
C [Link]/8 is directly connected, Serial2/1 C [Link]/8 is directly connected, Serial2/0
O [Link]/24 [110/129] via [Link], 00:17:47, Serial2/0 O IA [Link]/24 [110/193] via [Link], 00:08:22, Serial2/0
O IA [Link]/24 [110/65] via [Link], 00:17:47, Serial2/0 O IA [Link]/24 [110/129] via [Link], 00:08:22, Serial2/0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 105
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 106
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: Every router must have 8 routes in its routing table. And try to build each router’s routing table
in your mind this is the best way to stronger yours concepts. For example how many paths are with O,
OIA or O-EA etc.
Router R1
R1(config)#router ospf 1
R1(config-router)#network [Link] [Link] area 0
R1(config-router)#network [Link] [Link] area 1
Router R2
R2(config)#router ospf 1
R2(config-router)#network [Link] [Link] area 1
R2(config-router)#network [Link] [Link] area 1
R2(config-router)#network [Link] [Link] area 1
R2(config-router)#network [Link] [Link] area 1
Router R3
R3(config)#router ospf 1
R3(config-router)#network [Link] [Link] area 1
R3(config-router)#network [Link] [Link] area 1
R3(config-router)#network [Link] [Link] area 2
Router R4
R4(config)#router ospf 1
R4(config-router)#network [Link] [Link] area 2
R4(config-router)#network [Link] [Link] area 2
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 107
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
C [Link]/8 is directly connected, Serial2/0 O IA [Link]/24 [110/193] via [Link], 00:06:44, Serial2/0
O [Link]/8 [110/128] via [Link], 00:00:10, Serial2/0 C [Link]/8 is directly connected, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0 O [Link]/8 [110/128] via [Link], 00:06:44, Serial2/0
O [Link]/24 [110/65] via [Link], 00:00:10, Serial2/0 O IA [Link]/8 [110/192] via [Link], 00:06:44, Serial2/0
[Link]/32 is subnetted, 1 subnets C [Link]/24 is directly connected, FastEthernet0/0
O [Link] [110/65] via [Link], 00:00:10, Serial2/0 O [Link]/24 [110/65] via [Link], 00:06:44, Serial2/0
O [Link]/24 [110/129] via [Link], 00:00:10, Serial2/0 [Link]/32 is subnetted, 1 subnets
O [Link] [110/65] via [Link], 00:06:44, Serial2/0
O [Link]/24 [110/129] via [Link], 00:06:46, Serial2/0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 108
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
C [Link]/8 is directly connected, Serial2/0 O IA [Link]/24 [110/129] via [Link], 00:05:38, Serial2/1
C [Link]/8 is directly connected, Serial2/1 C [Link]/8 is directly connected, Serial2/0
O IA [Link]/24 [110/65] via [Link], 00:01:25, Serial2/0 C [Link]/8 is directly connected, Serial2/1
C [Link]/24 is directly connected, FastEthernet0/0 O IA [Link]/8 [110/128] via [Link], 00:05:38, Serial2/1
[Link]/32 is subnetted, 1 subnets O IA [Link]/24 [110/65] via [Link], 00:05:38, Serial2/0
C [Link] is directly connected, Loopback0 C [Link]/24 is directly connected, FastEthernet0/0
O [Link]/24 [110/65] via [Link], 00:01:25, Serial2/1 [Link]/32 is subnetted, 1 subnets
C [Link] is directly connected, Loopback0
O [Link]/24 [110/65] via [Link], 00:05:38, Serial2/1
O [Link]/24 [110/65] via [Link], 00:02:45, Serial2/1 O [Link]/24 [110/65] via [Link], 00:04:19, Serial2/1
O [Link]/8 [110/128] via [Link], 00:02:45, Serial2/0 O [Link]/8 [110/128] via [Link], 00:04:09, Serial2/0
C [Link]/8 is directly connected, Serial2/0 C [Link]/8 is directly connected, Serial2/0
C [Link]/8 is directly connected, Serial2/1 C [Link]/8 is directly connected, Serial2/1
O IA [Link]/24 [110/129] via [Link], 00:02:45, Serial2/0 O [Link]/24 [110/129] via [Link], 00:04:09, Serial2/0
O [Link]/24 [110/65] via [Link], 00:02:45, Serial2/0 O [Link]/24 [110/65] via [Link], 00:04:09, Serial2/0
[Link]/32 is subnetted, 1 subnets [Link]/32 is subnetted, 1 subnets
O [Link] [110/65] via [Link], 00:02:45, Serial2/0 O [Link] [110/65] via [Link], 00:04:09, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0 C [Link]/24 is directly connected, FastEthernet0/0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 109
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 110
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 20
Final Lab
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 111
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
TASK1: Configure Interior Gateway Protocols according to the given Diagram and Tables.
TASK2: Configure and advertise OSPF Router IDs according to the table.
TASK4: Try to configure OSPF area 1 as STUB and note the “Remark”.
TASK5:
TASK6: Perform OSPF route-summarization for R2 static routes given in the table.
TASK7: Perform EIGRP route-summarization for R3 static routes given in the table.
TASK8: Network [Link]/24 is appearing as O-IA in R2 Routing Table, It should appear with D-EX,
and your solution should not impact any other Route in the Network.
TASK9: Perform OSPF and EIGRP Authentication between R1-R2 and R2-R3.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 112
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Solution
(Before Tasks)
Note: Backbone router in figure above is given in exam preconfigured. It represents an AS. Backbone is
not accessible and routing protocol is already running on it that can be any routing protocol RIP v2, OSPF
or EIGRP. One interface of accessible router is connected with backbone and if you successfully run the
required protocol on accessible router than you can see the routes in its routing table from backbone
router.
In our case we have to configure Backbone Router. According to the figure RIP v2 is running on
Backbone router and you can add few static routes on it for redistribution.
Backbone(config)#interface FastEthernet0/0
Backbone(config-if)# no shutdown
Backbone(config-if)#router rip
Backbone(config-router)# version 2
Backbone(config-router)# no auto-summary
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 113
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R1
interface FastEthernet0/0
ip address [Link] [Link]
no sh
no keep
interface Serial2/0
ip address [Link] [Link]
no sh
interface Serial2/1
ip address [Link] [Link]
no sh
Router R2
interface FastEthernet0/0
ip address [Link] [Link]
no shut
no keep
interface Serial2/0
ip address [Link] [Link]
no shut
interface Serial2/1
ip address [Link] [Link]
no shut
Router R3
interface FastEthernet0/0
ip address [Link] [Link]
no shut
no keep
interface Serial2/0
ip address [Link] [Link]
no shut
interface Serial2/1
ip address [Link] [Link]
no shut
Router R4
interface FastEthernet0/0
ip address [Link] [Link]
no shut
no keep
interface Serial2/0
ip address [Link] [Link]
no shut
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 114
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
interface Serial2/1
ip address [Link] [Link]
no shut
Note: Read the tasks given in the exam’s lab, at least one time. You may face tricky tasks.
TASK1: Configure Interior Gateway Protocols according to the given Diagram and Tables.
TASK2: Configure and advertise OSPF Router IDs according to the table.
Note: For task2 OSPF Routers IDs are loopback addresses which are not yet configured and if we don’t
configure the OSPF with loopback addresses than the highest physical address is the OSPF router ID.
That’s why it is necessary to read the tasks before starting the lab.
Router R1
R1(config)#interface loopback 0
R1(config-if)#ip address [Link] [Link]
Router R2
R2(config)#interface loopback 0
R2(config-if)#ip address
R2(config-if)#ip address [Link] [Link]
R2(config-if)#exit
R2(config)#interface loopback 1
R2(config-if)#ip address [Link] [Link]
Router R3
R3(config)#interface loopback 0
R3(config-if)#ip address [Link] [Link]
Router R4
R4(config)#interface loopback 0
R4(config-if)#ip address [Link] [Link]
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 115
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
TASK-1: Configure Interior Gateway Protocols according to the given Diagram and Tables.
TASK-2: Configure and advertise OSPF Router IDs according to the table.
Router R1
R1(config)#router rip
R1(config-router)# version 2
R1(config-router)# network [Link]
R1(config-router)# no auto-summary
Note: RIP and EIGRP support auto-summa. Auto summary is enabled default. Can be disable by the
command “no auto-summary”. And auto summary is not recommended in most cases.
OSPF/IS-IS do not automatically summarize.
Router R1
R1(config)#router ospf 1
R1(config-router)#
R1(config-router)# network [Link] [Link] area 1
R1(config-router)# network [Link] [Link] area 1
R1(config-router)# network [Link] [Link] area 1
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network [Link]
Router R2
R2(config)#router ospf 1
R2(config-router)#network [Link] [Link] area 0
R2(config-router)#network [Link] [Link] area 1
R2(config-router)#network [Link] [Link] area 0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 116
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Command Description
Router(config)# router eigrp Global configuration mode. Enables an EIGRP routing
autonomous-system process in.
Router(config-router)# network Router configuration mode. Associates networks with an
network-number EIGRP routing process.
Note: EIGRP can be configured in two ways, like RIP style and like OSPF style but without Area.
Router R3
R3(config)#router ospf 2
R3(config-router)#network [Link] [Link] area 0
R3(config-router)#network [Link] [Link] area 0
Router R4
R4(config)#router ospf 1
R4(config-router)#network [Link] [Link] area 2
R4(config-router)#network [Link] [Link] area 1
R4(config-router)#network [Link] [Link] area 2
R4(config)#router eigrp 100
R4(config-router)#no auto-summary
R4(config-router)#network [Link] [Link]
R2#conf t
R2(config)#ip route [Link] [Link] Null0
R2(config)#ip route [Link] [Link] Null0
R2(config)#ip route [Link] [Link] Null0
R2(config)#ip route [Link] [Link] Null0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 117
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: Try to build each router’s routing table in your mind this is the best way to stronger yours
concepts. For example how many paths are with O, OIA, D, R or O-EA etc.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 118
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 21
Final Lab (Continue)
Solution:
Area 2 is not connected with Area 0 that is why Virtual link is required.
Note: Better to Configure Virtual Link first if asked for both redistribution and Virtual Link.
Virtual Link is not suitable between R2 and R3. It is suitable between R2 and R4 because conditions are
fulfilled.
1. Virtual Link is always configured between two routers/routing devices. It can be a multilayer
switch (MLS)
2. One Router must be ABR.
3. These two routers must have a common regular area between them.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 119
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
C [Link]/8 is directly connected, Serial2/0 O IA [Link]/24 [110/129] via [Link], 00:12:25, Serial2/0
C [Link]/8 is directly connected, Serial2/1 C [Link]/8 is directly connected, Serial2/0
D [Link]/8 [90/2681856] via [Link], 00:10:07, Serial2/1 C [Link]/8 is directly connected, Serial2/1
O [Link]/8 [110/128] via [Link], 00:07:31, Serial2/0 D [Link]/8 [90/2681856] via [Link], 00:25:50, Serial2/1
[Link]/32 is subnetted, 1 subnets O [Link]/8 [110/128] via [Link], 00:12:25, Serial2/0
C [Link] is directly connected, Loopback1 [Link]/32 is subnetted, 1 subnets
C [Link]/24 is directly connected, FastEthernet0/0 C [Link] is directly connected, Loopback1
[Link]/32 is subnetted, 1 subnets C [Link]/24 is directly connected, FastEthernet0/0
C [Link] is directly connected, Loopback0 [Link]/32 is subnetted, 1 subnets
[Link]/32 is subnetted, 1 subnets C [Link] is directly connected, Loopback0
O [Link] [110/65] via [Link], 00:07:33, Serial2/0 [Link]/32 is subnetted, 1 subnets
S [Link]/24 is directly connected, Null0 O [Link] [110/65] via [Link], 00:12:29, Serial2/0
S [Link]/24 is directly connected, Null0 S [Link]/24 is directly connected, Null0
S [Link]/24 is directly connected, Null0 S [Link]/24 is directly connected, Null0
S [Link]/24 is directly connected, Null0 S [Link]/24 is directly connected, Null0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/129] via [Link], 00:12:32, Serial2/0
S [Link]/24 is directly connected, Null0
Neighbor ID Pri State Dead Time Address Interface Neighbor ID Pri State Dead Time Address Interface
[Link] 0 FULL/ - 00:00:31 [Link] Serial2/0 [Link] 0 FULL/ - - [Link] OSPF_VL0
[Link] 0 FULL/ - 00:00:31 [Link] Serial2/0
Neighbor ID Pri State Dead Time Address Interface Neighbor ID Pri State Dead Time Address Interface
[Link] 0 FULL/ - 00:00:39 [Link] Serial2/1 [Link] 0 FULL/ - - [Link] OSPF_VL0
[Link] 0 FULL/ - 00:00:39 [Link] Serial2/1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 120
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Rule: Redistribution is always accordingly Routing Table it is not dependent on Neighbor Table or
Database Table.
Some people have a concept that if RIP Redistribute in OSPF and there is no need for redistribution in
EIGRP for RIP because RIP’s network from OSPF to EIGRP already reached.
Note: This is a wrong concept we cannot make a routing protocol as a bridge on a single router.
As we know redistribution only concert with routing table OSPF routing table have route with R from RIP
and if OSPF routes redistribute in EIGRP than only OSPF routes will pass in EIGRP routing table because
we are redistribution OSPF routes not RIP.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 121
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R1
R1(config)#router ospf 1
Router R4
Note: Seed metric entered manually in EIGRP. 5 seed metrics are in EIGRP. OSPF automatically add seed
metric. 1- Bandwidth metric, 2- EIGRP delay metric, 3- EIGRP reliability metric, 4- EIGRP Effective
bandwidth metric, 5- EIGRP MTU of the path.
Router R3
Router R2
R2(config)#router ospf 1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 122
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R1
R1#show ip route
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 123
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R4
R4#show ip route
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 124
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R3
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 125
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R2
R2#show ip route
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 126
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: Routing loops must be in redistribution if topology is down or restarted. To avoid routing loops
redistribution must be done with stability. Policy Base routing is used to avoid these loops.
3.3. You are not allowed to advertise Loopback1 of R2 with Network Command.
R1#sh ip route
Note: Now a problem occurs after redistributing connected loopback1 on Router R2, one network is no
more in R1’s routing table. It will discuss in next lecture.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 127
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 22
Final Lab (Continue)
If we look at the routing table of Router R1 there is a big change occur due to topology restart RIP routes
are now with OSPF O E2. Why? After redistribution R1 receives RIP routes from two points R5, R2.
Because OSPF AD value is 110 and RIP=120, that’s why prefers these routes with OSPF external routes
from R2.
O IA [Link]/24 [110/65] via [Link], 00:08:24, Serial2/1 O IA [Link]/24 [110/65] via [Link], 00:00:24, Serial2/1
C [Link]/8 is directly connected, Serial2/0 C [Link]/8 is directly connected, Serial2/0
[Link]/32 is subnetted, 1 subnets [Link]/32 is subnetted, 1 subnets
O E2 [Link] [110/20] via [Link], 00:08:24, Serial2/0 O E2 [Link] [110/20] via [Link], 00:00:24, Serial2/0
O E2 [Link]/8 [110/20] via [Link], 00:08:24, Serial2/0 O E2 [Link]/8 [110/20] via [Link], 00:00:24, Serial2/0
C [Link]/8 is directly connected, Serial2/1 C [Link]/8 is directly connected, Serial2/1
[Link]/32 is subnetted, 1 subnets [Link]/32 is subnetted, 1 subnets
O E2 [Link] [110/20] via [Link], 00:03:51, Serial2/0 O E2 [Link] [110/20] via [Link], 00:00:24, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0 C [Link]/24 is directly connected, FastEthernet0/0
R [Link]/16 [120/1] via [Link], 00:00:27, O E2 [Link]/16 [110/20] via [Link], 00:00:29, Serial2/0
FastEthernet0/0 O IA [Link]/24 [110/65] via [Link], 00:00:29, Serial2/0
O IA [Link]/24 [110/65] via [Link], 00:08:28, Serial2/0 [Link]/32 is subnetted, 1 subnets
[Link]/32 is subnetted, 1 subnets O IA [Link] [110/65] via [Link], 00:00:29, Serial2/0
O IA [Link] [110/65] via [Link], 00:08:28, Serial2/0 O E2 [Link]/24 [110/20] via [Link], 00:00:01, Serial2/0
R [Link]/24 [120/1] via [Link], 00:00:03, O E2 [Link]/16 [110/20] via [Link], 00:00:01, Serial2/0
FastEthernet0/0 O E2 [Link]/24 [110/20] via [Link], 00:00:01, Serial2/0
R [Link]/16 [120/1] via [Link], 00:00:03, O E2 [Link]/8 [110/20] via [Link], 00:00:01, Serial2/0
FastEthernet0/0 O E2 [Link]/16 [110/20] via [Link], 00:00:01, Serial2/0
R [Link]/24 [120/1] via [Link], 00:00:03, O E2 [Link]/24 [110/20] via [Link], 00:00:01, Serial2/0
FastEthernet0/0 [Link]/32 is subnetted, 1 subnets
R [Link]/8 [120/1] via [Link], 00:00:03, C [Link] is directly connected, Loopback0
FastEthernet0/0 O E2 [Link]/24 [110/20] via [Link], 00:00:01, Serial2/0
R [Link]/16 [120/1] via [Link], 00:00:03, O E2 [Link]/24 [110/20] via [Link], 00:00:01, Serial2/0
FastEthernet0/0 O E2 [Link]/24 [110/20] via [Link], 00:00:01, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:08:32, Serial2/0 O E2 [Link]/24 [110/20] via [Link], 00:00:01, Serial2/0
[Link]/32 is subnetted, 1 subnets O E2 [Link]/24 [110/20] via [Link], 00:00:01, Serial2/0
C [Link] is directly connected, Loopback0 O E2 [Link]/24 [110/20] via [Link], 00:00:01, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:08:32, Serial2/0 O E2 [Link]/24 [110/20] via [Link], 00:00:01, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:08:32, Serial2/0 O E2 [Link]/24 [110/20] via [Link], 00:00:01, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:08:32, Serial2/0 O E2 [Link]/24 [110/20] via [Link], 00:00:05, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:08:32, Serial2/0 [Link]/32 is subnetted, 1 subnets
O E2 [Link]/24 [110/20] via [Link], 00:08:32, Serial2/0 O IA [Link] [110/65] via [Link], 00:00:05, Serial2/1
O E2 [Link]/24 [110/20] via [Link], 00:08:32, Serial2/0 O E2 [Link]/24 [110/20] via [Link], 00:00:05, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:08:32, Serial2/0 O E2 [Link]/24 [110/20] via [Link], 00:00:05, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:08:37, Serial2/0 O E2 [Link]/24 [110/20] via [Link], 00:00:05, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:08:37, Serial2/0 O E2 [Link]/8 [110/20] via [Link], 00:00:05, Serial2/0
[Link]/32 is subnetted, 1 subnets O E2 [Link]/8 [110/20] via [Link], 00:00:09, Serial2/0
O IA [Link] [110/65] via [Link], 00:08:37, Serial2/1
O E2 [Link]/24 [110/20] via [Link], 00:08:37, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:08:37, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:08:37, Serial2/0
R [Link]/8 [120/1] via [Link], 00:00:08, FastEthernet0/0
R [Link]/8 [120/1] via [Link], 00:00:11, FastEthernet0/0
One more change. the network O E2 [Link]/8 [110/20] via [Link], 00:00:00, Serial2/0 is no more in
routing table of R1 due to redistributing connected loopback1 on Router R2 In task 3.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 128
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
There are many solution one solution you can change RIP AD value to 109 or there is another solution is
policy base routing. That is route map.
We can tag RIP routes on redistribution while these routes reach from R4 to R3 and R3 to R2 and then
R2 to R1, on R1 we will drop these Tagged redistributed RIP routes with the help of Distributed List.
R1(config)#router ospf 1
R1(config)#router ospf 1
R1(config-router)#distribute-list route-map DROP in
R1(config-router)#end
O IA [Link]/24 [110/65] via [Link], 00:00:24, Serial2/1 O IA [Link]/24 [110/65] via [Link], 00:02:25, Serial2/1
C [Link]/8 is directly connected, Serial2/0 C [Link]/8 is directly connected, Serial2/0
[Link]/32 is subnetted, 1 subnets [Link]/32 is subnetted, 1 subnets
O E2 [Link] [110/20] via [Link], 00:00:24, Serial2/0 O E2 [Link] [110/20] via [Link], 00:00:41, Serial2/0
O E2 [Link]/8 [110/20] via [Link], 00:00:24, Serial2/0 O E2 [Link]/8 [110/20] via [Link], 00:00:41, Serial2/0
C [Link]/8 is directly connected, Serial2/1 C [Link]/8 is directly connected, Serial2/1
[Link]/32 is subnetted, 1 subnets [Link]/32 is subnetted, 1 subnets
O E2 [Link] [110/20] via [Link], 00:00:24, Serial2/0 O E2 [Link] [110/20] via [Link], 00:02:25, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0 C [Link]/24 is directly connected, FastEthernet0/0
O E2 [Link]/16 [110/20] via [Link], 00:00:29, Serial2/0 R [Link]/16 [120/1] via [Link], 00:00:20,
O IA [Link]/24 [110/65] via [Link], 00:00:29, Serial2/0 FastEthernet0/0
[Link]/32 is subnetted, 1 subnets O IA [Link]/24 [110/65] via [Link], 00:02:28, Serial2/0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 129
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
For the solution of missing network O E2 [Link]/8, first we will study the behavior of IPv4
redistribution.
Redistribution
Lo 0
Fa 0
RIP OSPF
A B C
If we redistribute RIP in to OSPF than the IPv4 first redistribute pure RIP route that is Fa0 and then
directly connected on which RIP is enabled with network command i.e. Lo 0.
And if there is IPv6 it only redistribute pure RIP route it does not redistribute connected itself.
In our case:
Because of this command and according to IPv4 redistribution rule only connected networks are
redistributed and further there is a policy for connected network only loopback is redistributed that’s
why network [Link]/8 dropped due to this policy.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 130
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
On Router R2.
R2(config)#router ospf 1
R1#sh ip route
O IA [Link]/24 [110/65] via [Link], 00:00:09, Serial2/1
C [Link]/8 is directly connected, Serial2/0
O E2 [Link]/8 [110/20] via [Link], 00:00:09, Serial2/0
[Link]/32 is subnetted, 1 subnets
O E2 [Link] [110/20] via [Link], 00:00:07, Serial2/0
O E2 [Link]/8 [110/20] via [Link], 00:00:07, Serial2/0
C [Link]/8 is directly connected, Serial2/1
[Link]/32 is subnetted, 1 subnets
O E2 [Link] [110/20] via [Link], 00:00:09, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0
R [Link]/16 [120/1] via [Link], 00:00:11, FastEthernet0/0
O IA [Link]/24 [110/65] via [Link], 00:00:12, Serial2/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/65] via [Link], 00:00:15, Serial2/0
R [Link]/24 [120/1] via [Link], 00:00:14, FastEthernet0/0
R [Link]/16 [120/1] via [Link], 00:00:14, FastEthernet0/0
R [Link]/24 [120/1] via [Link], 00:00:14, FastEthernet0/0
R [Link]/8 [120/1] via [Link], 00:00:14, FastEthernet0/0
R [Link]/16 [120/1] via [Link], 00:00:14, FastEthernet0/0
O E2 [Link]/24 [110/20] via [Link], 00:00:14, Serial2/0
[Link]/32 is subnetted, 1 subnets
C [Link] is directly connected, Loopback0
O E2 [Link]/24 [110/20] via [Link], 00:00:12, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:00:15, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:00:12, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:00:12, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:00:13, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:00:15, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:00:18, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:00:15, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:00:15, Serial2/0
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/65] via [Link], 00:00:18, Serial2/1
O E2 [Link]/24 [110/20] via [Link], 00:00:15, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:00:18, Serial2/0
O E2 [Link]/24 [110/20] via [Link], 00:00:15, Serial2/0
R [Link]/8 [120/1] via [Link], 00:00:17, FastEthernet0/0
R [Link]/8 [120/1] via [Link], 00:00:17, FastEthernet0/0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 131
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 132
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
TASK4: Try to configure OSPF area 1 as STUB and note the “Remark”.
Stub Area: “Such Area where only single exit point”. LSA-5 is not allowed to enter or to be generated in
stub area.
R2(config)#router ospf 1
R2(config-router)#area 1 stub
“Remark”
TASK5:
These static routes are in Router R4 now the question arise where to configure the policy base routing
we cannot configure it on R4 and R3 because EIGRP is configured on these routers and in the task OSPF
metric should be type-1 and type-2 it must be configure on Router R2 because OSPF is running on it.
Router R2
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 133
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R2#conf t
R2(config)#router ospf 1
R2(config-router)#redistribute eigrp 100 subnets route-map PBR
R2(config-router)#end
R1(config)#router rip
R1(config-router)#distribute-list 3 in fa
R1(config-router)#distribute-list 3 in fastEthernet 0/0
R1(config-router)#
R1(config-router)#end
Note: See lecture # 12 how to deny permit whole network of any class.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 134
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R [Link]/16 [120/1] via [Link], 00:00:26, R [Link]/8 [120/1] via [Link], 00:00:06,
FastEthernet0/0 FastEthernet0/0
R [Link]/24 [120/1] via [Link], 00:00:26, R [Link]/8 [120/1] via [Link], 00:00:06, FastEthernet0/0
FastEthernet0/0 R [Link]/8 [120/1] via [Link], 00:00:06, FastEthernet0/0
R [Link]/16 [120/1] via [Link], 00:00:26,
FastEthernet0/0
R [Link]/24 [120/1] via [Link], 00:00:26,
FastEthernet0/0
R [Link]/8 [120/1] via [Link], 00:00:01,
FastEthernet0/0
R [Link]/16 [120/1] via [Link], 00:00:26,
FastEthernet0/0
R [Link]/8 [120/1] via [Link], 00:00:01, FastEthernet0/0
R [Link]/8 [120/1] via [Link], 00:00:01, FastEthernet0/0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 135
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 23
Final Lab (Continue)
TASK6: Perform OSPF route-summarization for R2 static routes given in the table.
R2(config)#router ospf 1
R2(config-router)#summ
R2(config-router)#summary-address [Link] [Link]
R2(config-router)#end
R2#show ip route
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 136
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
TASK7: Perform EIGRP route-summarization for R3 static routes given in the table.
On Router R2
Note: This network [Link] was previously with D EX now only with D reason is, “because summary
is performed internally on R3”
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 137
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
TASK8: Network [Link]/24 is appearing as O-IA in R2 Routing Table, It should appear with D-
EX, and your solution should not impact any other Route in the Network.
Solution:
This network [Link]/24 is appearing as O-IA in R2 because of virtual link. This route is reaching in
R2 from 2 paths, 1st virtual link and secondly through EIGRP R4 R3 R2. The AD value of OSPF 110
and AD value of External EIGRP is 170 that’s why appearing as O-IA.
We can change the AD value of that route with policy base routing on Router R2.
Router R2
R2(config)#access-list 65 per
R2(config)#access-list 65 permit [Link] [Link]
R2(config)#router ospf 1
R2(config-router)#distance 171 [Link] [Link] ?
<1-99> IP Standard access list number
<1300-1999> IP Standard expanded access list number
WORD Standard access-list name
<cr>
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 138
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
TASK9: Perform OSPF and EIGRP Authentication between R1-R2 and R2-R3.
Note: Authentication for RIP v2 and EIGRP is same. RIP v1 has no authentication.
Router R1
R1#conf t
R1(config)#inter serial 2/0
R1(config-if)#ip ospf authentication message-digest
*Mar 1 00:14:35.663: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Serial2/0 from FULL to DOWN,
Neighbor Down: Dead timer expired Hello packet mismatched
R1(config-if)#ip ospf message-digest-key 1 md5 cisco
Router R2
R2(config)#interface serial 2/0
R2(config-if)#ip ospf authentication message-digest
Router R2
R2(config-keychain-key)#key-string cisco
R2(config-keychain-key)#end
R2#
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 139
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R2#conf t
R2(config)#interface serial 2/1
R2(config-if)#ip authentication mode eigrp 100 md5
*Mar 1 00:02:41.515: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor [Link] (Serial2/1) is down:
authentication mode changed
R2(config-if)#ip authentication key-chain eigrp 100 EIGRP
Router R3
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 140
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 24
Border Gateway Protocol (BGP)
Interior Gateway Protocol (IGP): IGPs configured to perform Convergence within an Autonomous
System (AS). RIP, EIGRP OSPF are IGP.
Exterior Gateway Protocol (EGP): It is configured to perform convergence between different AS.
Brief History:
In past Service provider provided access to all their clients to the border router at their premises, client
purchases the card and installed at service provider’s border router himself. And configuration
performed on that router by client’s Administrator. There was a chance of security breach and that’s
why service provider stop giving access to the clients at their premises.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 141
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Burden on the resources of service provider because multiple IP routing policies are running on it. If
OSPF is running on the clients than OSPF process id is different for every client. As we know single
router cannot be a bridge for different routing protocols. Mutual Redistribution is performed for every
network.
In this case routes can be exchanged between different AS. To avoid from it policy base routing is
implement on PTCL router but still there is a burden on service provider equipment. At last service
provider asked to clients to limit their routing protocol at their own premises. Like in figure below.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 142
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Now the question is this how they will perform routing? Service Provider said I have configured BGP on
my border router clients are also advised to configure BGP at their border router.
BGP connects different AS, running only on borders. Only two protocol’s mutual redistribution is
performed on every AS. This BGP is known as External BGP (EBGP).
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 143
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Previously we have discussed route for DATA and VOICE in policy base routing.
Cost is same for this traffic that is 64+1+1=66. Load balancing is also in this scenario.
Now cost is different for data is 64+1+1+1=67. Now there is only one best path in routing table. In this
case data traffic discarded b/c in policy base routing we have configure route-map and for data the next
hope is [Link] but that is not in routing table b/c of cost.
Implementing policy base routing in IGP is not an easier task. To overcome on this problem we can
implement IBGP in our AS for difficult policy base routing. IBGP is configured for complex policy base
routing.
Note: BGP is a metric-less protocol. There are attributes in BGP for selection of best path instead of
metric.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 144
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Disadvantages of BGP
• BGP is difficult to configure as compare to IGP.
• BGP is resource intensive protocol.
If we want to access loopbacks of RIP from OSPF and OSPF’s loopbacks from RIP Mutual redistribution
on each border router is performed RIP to EBGP and EBGP to RIP same for OSPF to EBGP and EBGP to
OSPF.
Note: If we configure IBGP on RIP and OSPF than there is no need for redistribution between IBGP and
EBGP.
Now if we want to send data from A to C and receive from D to B. It is possible with IGP routing policies
like Route-Map but there are two paths for if one path down the data flow and routing information will
be terminated that’s why IBGP is best for routing policy in it if one path down automatically end path is
selected for routing. IBGP uses attribute “preference” for this task.
Note: User Data flow and Routing Update routes are opposite from each other.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 145
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 25
EBGP AD value is 20
4- Routing Updates: BGP routing updates are known as “Updates”. Updates are incremental and
triggered. Updates are Unicast and Unicast towards PEERs “Neighbor ship at the same level is called
Peers.”
5- BGP has no metric but BGP uses attributes for path selection.
7- Tables of BGP:
8- BGP peering can be configured between directly connected and indirectly connected.
Note: Two AS numbers cannot be configured on same router. BGP AS Number = 1 to 65535
11- BGP is a policy base routing protocol. (IGPs are not policy base routing protocols). There is built in
mechanism available in the shape of “Attributes”.
Note: Route-map, ACL, prefix-list and distribute list can be used in BGP.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 146
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
You have two links 1st 8Mb and 2nd 4 Mb backup links, for example if OSPF running on this system OSPF
select best path of 8 Mb (more bandwidth less cost). And in future more users added in the network and
now you want to use 30% or 50% of backup link for users but OSPF uses best path of 8Mb OSPF cannot
help in this scenario. If BGP is running on both AS, you can use backup link 30%, 50% 0r 70% by
configuring BGP.
If a customer having two links from service provider, it is called Multi-homing If a customer has only
single link it is called Single-homing.
Multi-homing is possible only in BGP in OSPF both links should be same for multi-homing.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 147
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
[Link]
EBGP
R1 R4
EBGP
IBGP IBGP
IBGP
R2 R3
AS = 200
Commands Description
Exec Mode command for BGP neighbor database
#show ip bgp summary
table.
#show ip bgp Exec Mode command for BGP database table.
Commands Description
Global configuration Mode command for BGP
#Router bgp <AS#>
configuration
#neighbor <neighbor address> <remote-as> Router configuration mode command for neighbor
<neighbor AS #> ship.
Router R1
R1(config)#router bgp 100
R1(config-router)#no aut
R1(config-router)#no auto-summary
R1(config-router)#neighbor [Link] remote-as 200
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 148
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Neighbor ship is not established yet with [Link] because tcp port no 79 is not active on remote side.
R2#
Router R1
R1#sh ip bgp summary
BGP router identifier [Link], local AS number 100
BGP table version is 1, main routing table version 1
Router R2
R2#sh ip bgp summary
BGP router identifier [Link], local AS number 200
BGP table version is 1, main routing table version 1
Router R1
R1(config)#router bgp 100
Router R2
R2#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
[Link] 4 100 16 15 2 0 0 00:11:47 1 Prefix Received
R2#show ip route
C [Link]/8 is directly connected, Serial2/0
C [Link]/8 is directly connected, Serial2/1
B [Link]/24 [20/0] via [Link], 00:00:29
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 149
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 26
AS = 100
[Link]
EBGP
R1 R4
EBGP
IBGP IBGP
IBGP
R2 R3
AS = 200
*>
Note: Only valid and best prefixes are copied into routing table from BGP database. Remaining remains
in database table.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 150
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Now the question is this in which circumstances, prefixes are valid and best?
R2#show ip route
C [Link]/8 is directly connected, Serial2/0
C [Link]/8 is directly connected, Serial2/1
B [Link]/24 [20/0] via [Link], 00:00:29
Prefix [Link]/24 is in R2’s routing table now our task is, this prefix must be in Router R3. This
possible only in redistribution in any running IGP protocols.
R2 R3
Router R2
R2(config)#router ospf 1
R2(config-router)#network [Link] [Link] area 0
R2#
*Mar 1 00:07:48.679: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Mar 1 00:08:12.279: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Serial2/1 from LOADING to
FULL, g Done
Router R3
R3(config)#router ospf 1
R3(config-router)#network [Link] [Link] area 0
R3#
*Mar 1 00:08:06.211: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Serial2/0 from LOADING to FULL,
Loading Done
*Mar 1 00:08:06.491: %SYS-5-CONFIG_I: Configured from console by console
R2(config)#router ospf 1
R2(config-router)#redistribute bgp 200 subnets
On Router R3
R3#show ip route
C [Link]/8 is directly connected, Serial2/0
C [Link]/8 is directly connected, Serial2/1
O E2 [Link]/24 [110/1] via [Link], 00:00:07, Serial2/0 As LSA 5
C [Link]/24 is directly connected, FastEthernet0/0
Note: For BGP seed metric is 1 in OSPF, preferred BGP by default. We can change this value.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 151
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
OSPF 1
[Link] [Link]
R2 IBGP R3
Router R2
R2(config)#router bgp 200
R2(config-router)#neighbor [Link] remote-as 200
Router R3
R3(config)#router bgp 200
R3(config-router)#no auto-summary
R3(config-router)#neighbor [Link] remote-as 200
R3#
*Mar 1 00:13:44.231: %BGP-5-ADJCHANGE: neighbor [Link] Up
Note: if BGP configured within AS is known as IBGP. Here we have same AS 200.
Now there are two protocols running between R2 and R3, one OSPF and on OSFP that is IBGP. The
advertised network [Link] on R3’s routing table is with IBGP or OSPF? Still with OSPF because the
AD Value or IBGP is 200 and OSPF’s AD value is 110.
Router R3
R3#show ip route
C [Link]/8 is directly connected, Serial2/0
C [Link]/8 is directly connected, Serial2/1
O E2 [Link]/24 [110/1] via [Link], 00:19:43, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0
On Router R3
R3#show bgp
BGP table version is 1, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
The network is valid but not best. Does it because AD value of OSPF and IBGP? No, this is not the
reason. Can be prove by removing redistribution BGP on router R2.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 152
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R2
R2(config)#router ospf 1
R2(config-router)#no redistribute bgp 200
On Router R3
R3#show bgp
BGP table version is 1, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
The network is still valid but not best. Now what is the problem? The problem is “next hope
unreachability”. For R3 the next hope should be [Link] but here next hope is [Link].
This BGP behavior, in this scenario BGP supposed two links for reaching AS 200 from AS 100 as shown in
figure below. We are using path [Link] to [Link] but there are two paths.
This BGP behavior , the network/prefix advertised from AS 100 to AS 200 through EBGP the next hope is
[Link]. and for AS 200 for every router the next hope is [Link]. Like router R3 the next hope is [Link].
1- Recursive lookup.
Consulting routing table again and again to reach destination is known as recursive lookup. And we
know routing is always on the bases of next hope. If next hope is unreachable than you have to acts like
recursive lookup to reach destination.
For R3 the next hope is [Link] for reaching network [Link] but the network [Link] is unknown
for R3. If R3 has [Link] in its routing table it can be reach that prefix.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 153
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R2(config)#router ospf 1
Router R3
R3#show ip route
O [Link]/8 [110/128] via [Link], 00:00:13, Serial2/0
C [Link]/8 is directly connected, Serial2/0
C [Link]/8 is directly connected, Serial2/1
B [Link]/24 [200/0] via [Link], 00:00:07
C [Link]/24 is directly connected, FastEthernet0/0
R3#show bgp
BGP table version is 2, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
The path is best and valid. The reason was “next hope unreachable not due to clash between AD
values”. Now the path is valid and best, It is just because of OSPF. The reachability is due to OSPF. Butt
Still next hope is [Link].
R2(config)#router ospf 1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 154
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R3
R3#show ip route
O [Link]/8 [110/128] via [Link], 00:02:18, Serial2/0
C [Link]/8 is directly connected, Serial2/0
C [Link]/8 is directly connected, Serial2/1
O E2 [Link]/24 [110/1] via [Link], 00:02:18, Serial2/0
C [Link]/24 is directly connected, FastEthernet0/0
R3#show bgp
BGP table version is 4, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
In IBGP vs IGP, IGP wins due to AD value. BGP successfully enter in DB table but not copied in Routing
Table due to rib failure.
Now the question why did not this problem occur in previous? BGP check best first and then validity
after and in previous the problem was with “best >” not with “valid *”, that’s why problem didn’t occur.
Another Solution
Another solution could be this, R2 advertise to its IBGP neighbors/peers that I am your next hope and
router 2 obviously an ABR, has routing information of prefix [Link]. It can also solve the issue.
R2(config)#router ospf 1
OSPF 1
R2(config-router)#no network [Link] [Link] area 0
R2(config-router)# no redistribute bgp 200 subnets
R2 R3
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 155
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
R3#sho bgp
BGP table version is 5, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
OSPF 1
[Link] [Link]
R2 IBGP R3
Router R2
Router R3
R3#show ip route
R3#show bgp
Note: Problem can be solved by next hope-self and by IGP protocol configurations.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 156
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R2
R2(config)#router ospf 1
R2(config-router)#passive-interface serial 2/0
R2(config-router)#network [Link] [Link] area 0
R2(config-router)#network [Link] [Link] area 0
Router R3
R3(config)#router ospf 1
R3(config-router)#do sh ip ali
Address Type IP Address Port
Interface [Link]
Interface [Link]
Interface [Link]
R3(config-router)#network [Link] [Link] area 0
R3(config-router)#network [Link] [Link] area 0
Router R4
R4(config)#router ospf 1
R4(config-router)#passive-interface serial 2/1
R4(config-router)#network [Link] [Link] area 0
*Mar 1 00:15:12.203: %OSPF-5-ADJCHG: Process 1, Nbr [Link] on Serial2/0 from LOADING to
FULL, Loadin g Done
R4(config-router)#network [Link] [Link] area 0
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 157
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R1
R1(config)#router bgp 100
R1(config-router)#no aut
R1(config-router)#no auto-summary
R1(config-router)#neighbor [Link] remote-as 200
R1(config-router)#neighbor [Link] remote-as 200
R1(config-router)#network [Link] Network Advertised
Router R2
R2(config)#router bgp 200
R2(config-router)#neighbor [Link] remote-as 100
R2(config-router)#neighbor [Link] remote-as 200
R2(config-router)#neighbor [Link] remote-as 200
Router R3
R3(config)#router bgp 200
R3(config-router)#no auto-summary
R3(config-router)#neighbor [Link] remote-as 200
R3(config-router)#neighbor [Link] remote-as 200
Router R4
R4(config)#router bgp 200
R4(config-router)#no auto-summary
R4(config-router)#neighbor [Link] remote-as 100
R4(config-router)#neighbor [Link] remote-as 200
R4(config-router)#neighbor [Link] remote-as 200
Router R1
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 158
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R2
R2#show ip bgp summary
BGP router identifier [Link], local AS number 200
BGP table version is 2, main routing table version 2
1 network entries using 117 bytes of memory
2 path entries using 104 bytes of memory
3/1 BGP path/bestpath attribute entries using 372 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 617 total bytes of memory
BGP activity 1/0 prefixes, 2/0 paths, scan interval 60 secs
Router R3
R3#show ip bgp summary
BGP router identifier [Link], local AS number 200
BGP table version is 4, main routing table version 4
1 network entries using 117 bytes of memory
2 path entries using 104 bytes of memory
2/1 BGP path/bestpath attribute entries using 248 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 493 total bytes of memory
BGP activity 1/0 prefixes, 2/0 paths, scan interval 60 secs
Router R4
R4#show ip bgp summary
BGP router identifier [Link], local AS number 200
BGP table version is 2, main routing table version 2
1 network entries using 117 bytes of memory
2 path entries using 104 bytes of memory
3/1 BGP path/bestpath attribute entries using 372 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 617 total bytes of memory
BGP activity 1/0 prefixes, 2/0 paths, scan interval 60 secs
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 159
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 160
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 27
If tie in BGP attributes than the decision is taken on 2nd last attribute “Neighbor Router ID” In BGP “A
neighbor with a small router id is a preferred neighbor”.
BGP Attributes
1:- Wight
The weight is used for a best path selection process.
The weights attribute only impact on running router not on others.
The weight is assigned locally to the router.
A weight can be a number from 0 to 65535.
Commands Description
Global configuration Mode command for BGP
#Router bgp <AS#>
configuration
Router configuration mode command for setting
#neighbor <neighbor address> weight < 0-65535>
up weight attribute.
R3#sh bgp
BGP table version is 4, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* i200.100.50.0 [Link] 0 100 0 100 i
*>i [Link] 0 100 0 100 i
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 161
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Now we want to change the preference the best should be [Link], we can achieve it by configuring BGP
attribute “weight”.
Note: Must apply command “clear ip bgp *” after configuring BGP attribute for impact.
R3#sh ip bgp
BGP table version is 2, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Now again we want to go back on default preferences there are two ways set the rest neighbor’s weight
to 10 another way is to set neighbor [Link] to 0.
R3#sh ip bgp
BGP table version is 2, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 162
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: the only attribute used in CCIE service Provider Lab. And this is the most useable attribute.
Note: The attribute local preference is higher in priority wise than the BGP attribute IBGP/EBGP.
1st Method:
R4#sh bgp
BGP table version is 2, local router ID is [Link]
r RIB-failure, S Stale
R3#sh bgp
BGP table version is 6, local router ID is [Link]
r RIB-failure, S Stale
R2#sh bgp
BGP table version is 5, local router ID is [Link]
r RIB-failure, S Stale
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 163
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
We have configured globally which is not good practice in practical point of view. Later on if another
AS300 is attached with this router than it local preference ll be also 200. We have to configure local
preference for specific neighbor.
2nd Method
Before
R3#sh bgp
BGP table version is 8, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
R4(config)#route-map LP permit 10
R4(config-route-map)#set local
R4(config-route-map)#set local-preference 200
R4(config-route-map)#
R4(config-route-map)#exit
R4(config)#router bgp 200
R4(config-router)#neighb
R4(config-router)#neighbor [Link] route
R4(config-router)#neighbor [Link] route-m
R4(config-router)#neighbor [Link] route-map LP in
R4(config-router)#do clear ip bgp *
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 164
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 28
Border Gateway Protocol (BGP) (continue)
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 165
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 29
Border Gateway Protocol (BGP) (continue)
AS Path Attribute:
AS = 10 AS = 20
X/24
EBGP
A D
EBGP EBGP
OSPF
IBGP
B C
AS = 30
An AS path is a list of all the AS that a specific route passes through to reach one destination.
When the router receives the x/24, it adds the AS number of the exterior neighbor to the AS-Path. As
the route announcement passes from autonomous system to autonomous system, the path grows
longer with each receiver adding the neighbor's AS to the path.
For example Router “C” receives x/24 from “B” and “D”. When D receives “X/24” it adds exterior
neighbor’s AS number and when “C” receives from “D” AS numbers 10 and 20 added with x/24.
Router C prefers router B for x/24 because least AS numbers are attached with this prefix. What if we
want the router C prefers router D instead of router B. We can add virtual Autonomous Systems. By
adding 3 to 4 virtual AS between “A” and “B”, Router “C” starts prefer Router “D”
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 166
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: As-path is configurable. By default AS-path is appended. Virtual AS could be create for selection of
path (prepends).
AS-path prepends: Prepending an AS path makes a shorter AS path look longer and therefore less
preferable to BGP.
Note: AS path impacts on local AS. AS-path prepend can be inbound and outbound. AS path is configured
on border router.
Lab:
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 167
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Each BGP packet contains a header whose primary purpose is to identify the function of the packet in
question. The following descriptions summarize the function of each field in the BGP header illustrated
in Figure.
BGP packets in which the type field in the header identifies the packet to be a BGP open message packet
include the following fields. These fields provide the exchange criteria for two BGP routers to establish a
peer relationship.
Version---Provides the BGP version number so that the recipient can determine whether it is running
the same version as the sender.
Hold-Time---Indicates the maximum number of seconds that can elapse without receipt of a message
before the transmitter is assumed to be nonfunctional.
BGP Identifier---Provides the BGP identifier of the sender (an IP address), which is determined at startup
and is identical for all local interfaces and all BGP peers.
Optional Parameters Length---Indicates the length of the optional parameters field (if present).
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 168
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Optional Parameters---Contains a list of optional parameters (if any). Only one optional parameter type
is currently defined: authentication information.
BGP packets in which the type field in the header identifies the packet to be a BGP update message
packet include the following fields. Upon receiving an update message packet, routers will be able to
add or delete specific entries from their routing tables to ensure accuracy. Update messages consist of
the following packets:
Unfeasible Routes Length--- Indicates the total length of the withdrawn routes field or that the field is
not present.
Withdrawn Routes--- Contains a list of IP address prefixes for routes being withdrawn from service.
Total Path Attribute Length--- Indicates the total length of the path attributes field or that the field is
not present.
Path Attributes--- Describes the characteristics of the advertised path. The following are possible
attributes for a path:
Origin: Mandatory attribute that defines the origin of the path information
AS Path: Mandatory attribute composed of a sequence of autonomous system path segments
Next Hop: Mandatory attribute that defines the IP address of the border router that should be used as
the next hop to destinations listed in the network layer reachability information field
Mult Exit Disc: Optional attribute used to discriminate between multiple exit points to a neighboring
autonomous system
Local Pref: Discretionary attribute used to specify the degree of preference for an advertised route
Atomic Aggregate: Discretionary attribute used to disclose information about route selections
Aggregator: Optional attribute that contains information about aggregate routes
Network Layer Reachability Information--- Contains a list of IP address prefixes for the advertised
routes
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 169
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
BGP packets in which the type field in the header identifies the packet to be a BGP notification message
packet include the following fields. This packet is used to indicate some sort of error condition to the
peers of the originating router.
Error Code---Indicates the type of error that occurred. The following are the error types defined by the
field:
Message Header Error: Indicates a problem with a message header, such as unacceptable message
length, unacceptable marker field value, or unacceptable message type.
Open Message Error: Indicates a problem with an open message, such as unsupported version
number, unacceptable autonomous system number or IP address, or unsupported authentication
code.
Update Message Error: Indicates a problem with an update message, such as a malformed attribute
list, attribute list error, or invalid next-hop attribute.
Hold Time Expired: Indicates that the hold-time has expired, after which time a BGP node will be
considered nonfunctional.
Cease: Closes a BGP connection at the request of a BGP device in the absence of any fatal errors.
Error Subcode---Provides more specific information about the nature of the reported error.
Error Data---Contains data based on the error code and error subcode fields. This field is used to
diagnose the reason for the notification message.
Consists of only the 19-byte BGP message header with no additional data. Maintains the BGP connection
between 2 BGP peers.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 170
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
BGP States
Idle Active
Unreachabilty
Unreachabilty
Open
If Keepalive
Confiem
1- Idel: is the initial state of a BGP connection. The BGP speaker is waiting for a start event, generally
either the establishment of a TCP connection or the re-establishment of a previous connection. Once the
connection is established, BGP moves to the next state.
2- Connect: is the next state. If the TCP connection completes, BGP will move to the OpenSent stage if
the connection does not complete, BGP goes to Active.
3- Active: indicates that the BGP speaker is continuing to create a peer relationship with the remote
router. If this is successful, the BGP state goes to OpenSent. You'll occasionally see a BGP connection
flap between Active and Connect. This indicates an issue with the physical cable itself, or with the
configuration.
4- OpenSent: indicates that the BGP speaker has received an Open message from the peer. BGP will
determine whether the peer is in the same AS (iBGP) or a different AS (eBGP) in this state.
5- OpenConfirm: in this state, the BGP speaker is waiting for a keepalive message. If one is received, the
state moves to Established, and the neighbor relationship is complete. It is in the Established state that
update packets are actually exchanged.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 171
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 30
Border Gateway Protocol (BGP) (continue)
Partial-Mesh IBGP
Routes learnt from One iBGP Peer cannot be advertised to another iBGP Peer. Here in the in above
figure Router B received prefix x form Router A cannot advertised to its IBGP neighbor Router C.
In iBGP, the routes learnt from one iBGP neighbor are not advertised to another iBGP neighbor due to
the BGP Split Horizon Rule. To overcome the issues generated by this rule, one option is to have a full
mesh of iBGP routers, where each iBGP router is peering directly with all other iBGP routers in the AS. As
shown in figure below.
Full-Mesh IBGP
The solution is feasible if you have a small number of iBGP routers, but it will not scale if you need a
large numbers ‘500’ of iBGP speaking routers in the AS. Than you need another solution for it that is a
Route Reflector.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 172
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
2: Route Reflector
A route reflector (RR) is a network routing component. It offers an alternative to the logical full-mesh
requirement of internal border gateway protocol (IBGP). A RR acts as a focal point for IBGP sessions. The
purpose of the RR is concentration. Multiple BGP routers can peer with a central point, the RR - acting as
a route reflector server - rather than peer with every other router in a full mesh. All the other IBGP
routers become route reflector clients.
This approach, similar to OSPF's DR/BDR feature, provides large networks with added IBGP scalability. In
a fully meshed IBGP network of 10 routers, 90 individual statements (spread throughout all routers in
the topology) are needed just to define the remote-AS of each peer: this quickly becomes a headache to
administer. A RR topology could cut these 90 statements down to 18, offering a viable solution for the
larger networks administered by ISPs.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 173
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: A route reflector is a single point of failure; therefore (at least) a second route reflector should be
configured in order to provide redundancy.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 174
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 31
Border Gateway Protocol (BGP) (continue)
Router R4 Router R5
conf t conf t
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 175
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
end end
wr wr
Note: Ping loopback address on every router (OSPF configured) if reply is successful its mean all four
Loopback Addresses are reachable and in routing table.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 176
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Note: Remember if neighbor-ship is on the bases of Loopback addresses than “update source “must be
loopback interface.
Router R2 Router R3
Conf t Conf t
router bgp 20 router bgp 20
neighbor [Link] remote-as 20 neighbor [Link] remote-as 20
neighbor [Link] remote-as 20 neighbor [Link] remote-as 20
neighbor [Link] remote-as 20 neighbor [Link] remote-as 20
neighbor [Link] update-source loopback 0 neighbor [Link] update-source loopback 0
neighbor [Link] update-source loopback 0 neighbor [Link] update-source loopback 0
neighbor [Link] update-source loopback 0 neighbor [Link] update-source loopback 0
neighbor [Link] route-reflector-client neighbor [Link] route-reflector-client
neighbor [Link] route-reflector-client neighbor [Link] route-reflector-client
neighbor [Link] route-reflector-client neighbor [Link] route-reflector-client
Note: In which router the command “router-reflector-client” is configured that router is known as “Route
Reflector Router”.
Router R4 Router R5
Conf t Conf t
router bgp 20 router bgp 20
neighbor [Link] remote-as 20 neighbor [Link] remote-as 20
neighbor [Link] remote-as 20 neighbor [Link] remote-as 20
neighbor [Link] update-source loopback 0 neighbor [Link] update-source loopback 0
neighbor [Link] update-source loopback 0 neighbor [Link] update-source loopback 0
According to the iBGP configurations R2 and R3 must have 3 neighbors and R4, R5 must have 2
neighbors.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 177
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R2
R2#sh ip bgp summary
Router R3
R3#sh ip bgp summary
Router R4
R4#sh ip bgp summary
Router R5
R5#sh ip bgp summary
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 178
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
EBGP configuration on R1
Note: EBGP neighbor-ship always on physical interface. Before configuring EBGP ping R2 and R3
reachable addresses (link addresses must be reachable).
Router R1
R1#sh ip bgp summ
BGP router identifier [Link], local AS number 10
BGP table version is 1, main routing table version 1
Note: For RR client next hop should be RR. Otherwise next hope address will be R1 link addresses.
Router R2 Router R3
Conf t Conf t
router bgp 20 router bgp 20
neighbor [Link] next-hop-self neighbor [Link] next-hop-self
neighbor [Link] next-hop-self neighbor [Link] next-hop-self
neighbor [Link] next-hop-self neighbor [Link] next-hop-self
Conf t
router bgp 10
network [Link] mask [Link]
Router R2 and R3 reflects this prefix to its clients. But the best and valid is Router R2 because its ID is
small.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 179
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R2
R4#sh ip bgp
BGP table version is 2, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Router R3
R5#show ip bgp
BGP table version is 3, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Best should be [Link] sometimes due to some errors GNS3 does not display the real output. But our aim
was to display information from route reflectors that are advertising prefix to its clients.
Router R4
Conf t
router bgp 20
network [Link] mask [Link]
Router R5
Conf t
router bgp 20
network [Link] mask [Link]
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 180
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Router R4
R4#sh ip bgp
BGP table version is 4, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Note: There is no neighbor-ship between R4 and R5. The route is reflecting by the Route reflector.
Router R5
R5#show ip bgp
BGP table version is 6, local router ID is [Link]
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Note: Next-hope-self is only for other Autonomous Systems. IBGP route displays on other iBGP router the
next hop address is advertising router address.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 181
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Lecture # 32
IPv6 Introduction
Internet Protocol version 6 (IPv6) is the latest revision of the Internet Protocol (IP) and the first version
of the protocol to be widely deployed. IPv6 was developed by the Internet Engineering Task Force (IETF)
to deal with the long-anticipated problem of IPv4 address exhaustion.
IPv4
IPv6
128 bits: 4 times the size in bits = 3.4 x 1038 possible addressable devices
= 340,282,366,920,938,463,463,374,607,431,768,211,456
Before introducing IPv6 Address format, we must look into Hexadecimal Number System. Hexadecimal
is positional number system which uses radix (base) of 16. To represent the values in readable format,
this system uses 0-9 symbols to represent values from zero to nine and A-F symbol to represent values
from ten to fifteen. Every digit in Hexadecimal can represent values from 0 to 15.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 182
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
Format:
An IPv6 address is made of 128 bits divided into eight 16-bits blocks. Each block is then converted into 4-
digit Hexadecimal numbers separated by colon symbol.
An example of IPv6:
“ABCD:A569:68AE:5BCD:9FCF:A395:63FF:A1CE”
There are:
• 8 groups of 4 hexadecimal digits.
• Each group represents 16 bits (4 hexa digits * 4 bit)
• Separator is “:”
• Hex digits are not case sensitive, so “ABCD” is same as “abcd” or “ABcd”…
Note: Addresses are assigned to interfaces (network connections), not to the host. Each interface can
have more than one IPv6 address.
Each block is then converted into Hexadecimal and separated by ‘:’ symbol:
2002:0000:0000:000E:0000:0000:0000:0010
Even after converting into Hexadecimal format, IPv6 address remains long. IPv6 provides some rules to
shorten the address. These rules are:
2002:0000:0000:E:0000:0000:0000:0010
Rule2: If two of more blocks contains consecutive zeroes, omit them all and replace with double colon
sign ::, such as (2nd and 3rd block):
2002::E:0000:0000:0000:0010
Consecutive blocks of zeroes can be replaced only once by :: so if there are still blocks of zeroes in the
address they can be shrink down to single zero, such as (5th, 6th and 7th blocks):
2002::E:0:0:0:10
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 183
CCNP by Hasnain Malik (Senior Instructor) Corvit Systems
• The first 64-bits is known as the prefix. The prefix includes the network and subnet address.
Because addresses are allocated based on physical location, the prefix also includes global
routing information. The 64-bit prefix is often referred to as the global routing prefix.
• The last 64-bits is the host ID/ interface ID. This is the unique address assigned to an interface.
Note: There is no concept of Broadcast in IPv6. IPv6 treated as multicast. No classes in IPv6.
Prepared by: Network Engineers Noman Amin & Shafkat Shahzad Page 184