Network Bulls
www.networkbulls.com
Best Institute for CCNA CCNP CCSP CCIP CCIE Training in India
M-44, Old Dlf, Sector-14 Gurgaon, Haryana, India
Call: +91-9654672192
Open Shortest Path First (OSPF) is an open standard routing protocol that’s been implemented
by a wide variety of network vendors, including Cisco. If you have multiple routers
and not all of them are Cisco (what!), then you can’t use EIGRP, can you? So, your remaining
CCNA objective options are basically RIP, RIPv2, and OSPF.
OSPF works by using the Dijkstra algorithm. First, a shortest path tree is constructed, and
then the routing table is populated with the resulting best paths. OSPF converges quickly,
although perhaps not as quickly as EIGRP, and it supports multiple, equal-cost routes to the
same destination. Like EIGRP, it does support both IP and IPv6 routed protocols.
OSPF provides the following features:
Consists of areas and autonomous systems
Minimizes routing update traffic
Allows scalability
Supports VLSM/CIDR
Has unlimited hop count
Allows multi-vendor deployment (open standard)
OSPF is the first link-state routing protocol that most people are introduced to, so it’s useful
to see how it compares to more traditional distance-vector protocols such as RIPv2 and RIPv1.
Table 4.8 gives you a comparison of these three protocols.
TABLE 4 . 8 OSPF and RIP comparison
Characteristic OSPF RIPv2 RIPv1
Type of protocol Link state Distance vector Distance vector
Classless support Yes Yes No
4.12 Configure, verify, and troubleshoot OSPF 253
OSPF has many features beyond the few I’ve listed in Table 4.8, and all of them contribute
to a fast, scalable, and robust protocol that can be actively deployed in thousands of production
networks.
OSPF is supposed to be designed in a hierarchical fashion, which basically means that you
can separate the larger internetwork into smaller internetworks called areas. This is the best
design for OSPF.
The following are reasons for creating OSPF in a hierarchical design:
To decrease routing overhead
To speed up convergence
To confine network instability to single areas of the network
This does not make configuring OSPF easier, but more elaborate and difficult.
Figure 4.13 shows a typical OSPF simple design. Notice how each router connects to the
backbone—called area 0, or the backbone area. OSPF must have an area 0, and all other areas
should connect to this area. (Areas that do not connect directly to area 0 by using virtual links
are beyond the scope of this book.) Routers that connect other areas to the backbone area
within an AS are called Area Border Routers (ABRs). Still, at least one interface of the ABR
must be in area 0.
VLSM support Yes Yes No
Auto-summarization No Yes Yes
Manual summarization Yes No No
Discontiguous support Yes Yes No
Route propagation Multicast on change Periodic multicast Periodic broadcast
Path metric Bandwidth Hops Hops
Hop count limit None 15 15
Convergence Fast Slow Slow
Peer authentication Yes Yes No
Hierarchical network Yes (using areas) No (flat only) No (flat only)
Updates Event triggered Route table updates Route table updates
Route computation Dijkstra Bellman-Ford Bellman-Ford
TABLE 4 . 8 OSPF and RIP comparison (continued)
Characteristic OSPF RIPv2 RIPv1
254 Chapter 4 Configure, verify, and troubleshoot basic router operation
FIGURE 4 . 1 3 OSPF design example
OSPF runs inside an autonomous system, but it can also connect multiple autonomous systems.
The router that connects these ASs is called an Autonomous System Boundary Router (ASBR).
Ideally, you would create other areas of networks to help keep route updates to a minimum
and to keep problems from propagating throughout the network. But that’s beyond the scope
of this chapter. Just make note of it.
Configuring OSPF Areas
After identifying the OSPF process, you need to identify the interfaces that you want to activate
OSPF communications on as well as the area in which each resides. This will also configure the networks
you’re going to advertise to others. OSPF uses wildcards in the configuration—which are
also used in access-list configurations.
Here’s an OSPF basic configuration example for you:
Lab_A#config t
Lab_A(config)#router ospf 1
Lab_A(config-router)#network 10.0.0.0 0.255.255.255
area ?
<0-4294967295> OSPF area ID as a decimal value
A.B.C.D OSPF area ID in IP address format
Lab_A(config-router)#network 10.0.0.0 0.255.255.255
area 0
The areas can be any number from 0 to 4.2 billion. Don’t get these numbers
confused with the Process ID, which is from 1 to 65,535.
Remember, the OSPF Process ID number is irrelevant. It can be the same on every router
on the network, or it can be different—doesn’t matter. It’s locally significant and just enables
the OSPF routing on the router.
Autonomous system
Backbone router
Area 0
Area 1 Area 2
Autonomous system
border router (ASBR)
Area border
router (ABR)
4.12 Configure, verify, and troubleshoot OSPF 255
There are several ways to verify proper OSPF configuration and operation, and in the following
sections I’ll show you the OSPF show commands you need to know in order to do this.
We’re going to start by taking a quick look at the routing table of the Corp router:
So, let’s issue a show ip route command on the Corp router:
10.0.0.0/24 is subnetted, 12 subnets
O 10.1.11.0 [110/65] via 10.1.5.2, 00:01:31, Serial0/2/0
O 10.1.10.0 [110/65] via 10.1.5.2, 00:01:31, Serial0/2/0
O 10.1.9.0 [110/74] via 10.1.4.2, 00:01:31, Serial0/1/0
O 10.1.8.0 [110/65] via 10.1.4.2, 00:01:31, Serial0/1/0
O 10.1.12.0 [110/66] via 10.1.5.2, 00:01:31, Serial0/2/0
C 10.1.3.0 is directly connected, Serial0/0/1
C 10.1.2.0 is directly connected, Serial0/0/0
C 10.1.1.0 is directly connected, FastEthernet0/1
O 10.1.7.0 [110/74] via 10.1.3.2, 00:01:32, Serial0/0/1
[110/74] via 10.1.2.2, 00:01:32, Serial0/0/0
O 10.1.6.0 [110/74] via 10.1.3.2, 00:01:32, Serial0/0/1
[110/74] via 10.1.2.2, 00:01:32, Serial0/0/0
C 10.1.5.0 is directly connected, Serial0/2/0
C 10.1.4.0 is directly connected, Serial0/1/0
The Corp router shows the found routes for all 12 of our networks, with the O representing
OSPF internal routes (the Cs are obviously our directly connected networks). It also found the
dual routes to networks 10.1.6.0 and 10.1.7.0. I removed the bandwidth and delay commands
from under the interface, so the defaults are being used to determine the metric. But remember,
OSPF only uses bandwidth to determine the best path to a network.
Important note: OSPF can load-balance only across links of equal costs. It
can’t load-balance across unequal-cost links as EIGRP can.
It’s time to show you all the OSPF verification commands that you need to know.
The show ip ospf Command
The show ip ospf command is used to display OSPF information for one or all OSPF processes
running on the router. Information contained therein includes the Router ID, area information,
SPF statistics, and LSA timer information. Let’s check out the output from the Corp router:
Corp#sh ip ospf
Routing Process "ospf 132" with ID 10.1.5.1
Start time: 04:32:04.116, Time elapsed: 01:27:10.156
Supports only single TOS(TOS0) routes
256 Chapter 4 Configure, verify, and troubleshoot basic router operation
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Incremental-SPF disabled
Minimum LSA interval 5 secs
Minimum LSA arrival 1000 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 0. Checksum Sum 0x000000
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
Area BACKBONE(0)
Number of interfaces in this area is 5
Area has no authentication
SPF algorithm last executed 00:14:52.220 ago
SPF algorithm executed 14 times
Area ranges are
Number of LSA 6. Checksum Sum 0x03C06F
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Notice the Router ID (RID) of 10.1.5.1, which is the highest IP address configured on
the router.
The show ip ospf database Command
Using the show ip ospf database command will give you information about the number
of routers in the internetwork (AS) plus the neighboring router’s ID (this is the topology database
I mentioned earlier). Unlike the show ip eigrp topology command, this command
shows the “OSPF routers,” not each and every link in the AS as EIGRP does.
4.12 Configure, verify, and troubleshoot OSPF 257
The output is broken down by area. Here’s a sample output, again from Corp:
Corp#sh ip ospf database
OSPF Router with ID (10.1.5.1) (Process ID 132)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
10.1.5.1 10.1.5.1 72 0x80000002 0x00F2CA 9
10.1.7.1 10.1.7.1 83 0x80000004 0x009197 6
10.1.9.1 10.1.9.1 73 0x80000001 0x00DA1C 4
10.1.11.1 10.1.11.1 67 0x80000005 0x00666A 4
10.1.12.1 10.1.12.1 67 0x80000004 0x007631 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
10.1.11.2 10.1.12.1 68 0x80000001 0x00A337
You can see all five routers and the RID of each router (the highest IP address on each
router). The router output shows the link ID—remember that an interface is also a link—and
the RID of the router on that link under the ADV router, or advertising router.
The show ip ospf interface Command
The show ip ospf interface command displays all interface-related OSPF information.
Data is displayed about OSPF information for all interfaces or for specified interfaces. (I’ll
bold some of the important things.)
Corp#sh ip ospf interface f0/1
FastEthernet0/1 is up, line protocol is up
Internet Address 10.1.1.1/24, Area 0
Process ID 132, Router ID 10.1.5.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 10.1.5.1, Interface address 10.1.1.1
No backup designated router on this network
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:01
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 0
258 Chapter 4 Configure, verify, and troubleshoot basic router operation
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
The following information is displayed by this command:
Interface IP address
Area assignment
Process ID
Router ID
Network type
Cost
Priority
DR/BDR election information (if applicable)
Hello and Dead timer intervals
Adjacent neighbor information
The reason I used the show ip ospf interface f0/1 command is that I knew that there
would be a designated router elected on the FastEthernet broadcast multi-access network.
We’ll get into DR and DBR elections in detail in a minute.
The show ip ospf neighbor Command
The show ip ospf neighbor command is super-useful because it summarizes the pertinent
OSPF information regarding neighbors and the adjacency state. If a DR or BDR exists, that
information will also be displayed. Here’s a sample:
Corp#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
10.1.11.1 0 FULL/ - 00:00:37 10.1.5.2 Serial0/2/0
10.1.9.1 0 FULL/ - 00:00:34 10.1.4.2 Serial0/1/0
10.1.7.1 0 FULL/ - 00:00:38 10.1.3.2 Serial0/0/1
10.1.7.1 0 FULL/ - 00:00:34 10.1.2.2 Serial0/0/0
This is a super-important command to understand because it’s extremely useful in production
networks. Let’s take a look at the R3 and 871W routers outputs:
R3#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
10.1.5.1 0 FULL/ - 00:00:39 10.1.5.1 Serial0/0/1
10.1.11.2 1 FULL/BDR 00:00:31 10.1.11.2 FastEthernet0/1
871W#sh ip ospf nei
Neihbor ID Pri State Dead Time Address Interface
10.1.11.1 1 FULL/DR 00:00:30 10.1.11.1 Vlan1
4.12 Configure, verify, and troubleshoot OSPF 259
Since there’s an Ethernet link (broadcast multi-access) on the Corp router, there’s going to
be an election to determine who will be the designated router and who will be the nondesignated
router. You can see that the 871W became the designated router, and it won because it
had the highest IP address on the network. You can change this, but that’s the default.
The reason that the Corp connections to R1, R2, and R3 don’t have a DR or BDR listed
in the output is that by default, elections don’t happen on point-to-point links. But you can see
that the Corp router is fully adjacent to all three routers (and on both connections to R1) from
its output.
Debugging OSPF
Debugging is a great tool for any protocol, so let’s take a look in Table 4.9 at a few debugging
commands for troubleshooting OSPF.
I’ll start by showing you the output from the Corp router I got using the debug ip ospf
packet command:
Corp#debug ip ospf packet
OSPF packet debugging is on
*Mar 23 01:20:42.199: OSPF: rcv. v:2 t:1 l:48 rid:172.16.10.3
aid:0.0.0.0 chk:8075 aut:0 auk: from Serial0/1/0
Corp#
*Mar 23 01:20:45.507: OSPF: rcv. v:2 t:1 l:48 rid:172.16.10.2
aid:0.0.0.0 chk:8076 aut:0 auk: from Serial0/0/0
*Mar 23 01:20:45.531: OSPF: rcv. v:2 t:1 l:48 rid:172.16.10.2
aid:0.0.0.0 chk:8076 aut:0 auk: from Serial0/0/1
*Mar 23 01:20:45.531: OSPF: rcv. v:2 t:1 l:48 rid:172.16.10.4
aid:0.0.0.0 chk:8074 aut:0 auk: from Serial0/2/0
*Mar 23 01:20:52.199: OSPF: rcv. v:2 t:1 l:48 rid:172.16.10.3
aid:0.0.0.0 chk:8075 aut:0 auk: from Serial0/1/0
*Mar 23 01:20:55.507: OSPF: rcv. v:2 t:1 l:48 rid:172.16.10.2
TABLE 4 . 9 Debugging Commands for Troubleshooting OSPF
Command Description/Function
debug ip ospf packet Shows Hello packets being sent and received on your router.
debug ip ospf hello Shows Hello packets being sent and received on your router. Shows
more detail than the debug ip ospf packet output.
debug ip ospf adj Shows DR and DBR elections on a broadcast and nonbroadcast
multi-access network.
260 Chapter 4 Configure, verify, and troubleshoot basic router operation
aid:0.0.0.0 chk:8076 aut:0 auk: from Serial0/0/0
*Mar 23 01:20:55.527: OSPF: rcv. v:2 t:1 l:48 rid:172.16.10.2
aid:0.0.0.0 chk:8076 aut:0 auk: from Serial0/0/1
*Mar 23 01:20:55.531: OSPF: rcv. v:2 t:1 l:48 rid:172.16.10.4
aid:0.0.0.0 chk:8074 aut:0 auk: from Serial0/2/0
In the preceding output, you can see that our router is both sending and receiving Hello
packets every 10 seconds from neighbor (adjacent) routers. The next command will provide
us with the same information, but with more detail. For example, you can see the multicast
address used (224.0.0.5) and the area:
Corp#debug ip ospf hello
*Mar 23 01:18:41.103: OSPF: Send hello to 224.0.0.5 area 0 on
Serial0/1/0 from 10.1.4.1
*Mar 23 01:18:41.607: OSPF: Send hello to 224.0.0.5 area 0 on
FastEthernet0/1 from 10.1.1.1
*Mar 23 01:18:41.607: OSPF: Send hello to 224.0.0.5 area 0 on
Serial0/0/0 from 10.1.2.1
*Mar 23 01:18:41.611: OSPF: Send hello to 224.0.0.5 area 0 on
Serial0/2/0 from 10.1.5.1
*Mar 23 01:18:41.611: OSPF: Send hello to 224.0.0.5 area 0 on
Serial0/0/1 from 10.1.3.1
*Mar 23 01:18:42.199: OSPF: Rcv hello from 172.16.10.3 area 0 from
Serial0/1/0 10.1.4.2
*Mar 23 01:18:42.199: OSPF: End of hello processing
*Mar 23 01:18:45.519: OSPF: Rcv hello from 172.16.10.2 area 0 from
Serial0/0/0 10.1.2.2
*Mar 23 01:18:45.519: OSPF: End of hello processing
*Mar 23 01:18:45.543: OSPF: Rcv hello from 172.16.10.2 area 0 from
Serial0/0/1 10.1.3.2
*Mar 23 01:18:45.543: OSPF: End of hello processing
*Mar 23 01:18:45.543: OSPF: Rcv hello from 172.16.10.4 area 0 from
Serial0/2/0 10.1.5.2
*Mar 23 01:18:45.543: OSPF: End of hello processing
The last debug command I’m going show you is the debug ip ospf adj command, which
will show you elections as they occur on broadcast and nonbroadcast multi-access networks:
Corp#debug ip ospf adj
OSPF adjacency events debugging is on
*Mar 23 01:24:34.823: OSPF: Interface FastEthernet0/1 going Down
*Mar 23 01:24:34.823: OSPF: 172.16.10.1 address 10.1.1.1 on
FastEthernet0/1 is dead, state DOWN
4.13 Configure, verify, and troubleshoot EIGRP 261
*Mar 23 01:24:34.823: OSPF: Neighbor change Event on interface
FastEthernet0/1
*Mar 23 01:24:34.823: OSPF: DR/BDR election on FastEthernet0/1
*Mar 23 01:24:34.823: OSPF: Elect BDR 0.0.0.0
*Mar 23 01:24:34.823: OSPF: Elect DR 0.0.0.0
*Mar 23 01:24:34.823: OSPF: Elect BDR 0.0.0.0
*Mar 23 01:24:34.823: OSPF: Elect DR 0.0.0.0
*Mar 23 01:24:34.823: DR: none BDR: none
*Mar 23 01:24:34.823: OSPF: Flush network LSA immediately
*Mar 23 01:24:34.823: OSPF: Remember old DR 172.16.10.1 (id)
*Mar 23 01:24:35.323: OSPF: We are not DR to build Net Lsa for
interface FastEthernet0/1
*Mar 23 01:24:35.323: OSPF: Build router LSA for area 0, router ID
172.16.10.1, seq 0x80000006
*Mar 23 01:24:35.347: OSPF: Rcv LS UPD from 172.16.10.2 on Serial0/0/1
length 148 LSA count 1
*Mar 23 01:24:40.703: OSPF: Interface FastEthernet0/1 going Up
*Mar 23 01:24:41.203: OSPF: Build router LSA for area 0, router ID
172.16.10.1, seq 0x80000007
*Mar 23 01:24:41.231: OSPF: Rcv LS UPD from 172.16.10.2 on Serial0/0/1
length 160 LSA count 1
Exam Objectives
Be able to configure a single-area OSPF. A minimal single-area configuration involves only
two commands: router ospf process-id and network x.x.x.x y.y.y.y area Z.
Be able to verify the operation of OSPF. There are many show commands that provide useful
details on OSPF, and it is useful to be completely familiar with the output of each: show ip
ospf, show ip ospf database, show ip ospf interface, show ip ospf neighbor, and
show ip protocols.
No comments:
Post a Comment