You are on page 1of 22

Implementing OSPF

Single-Area OSPF Implementation

© 2007 Cisco Systems, Inc. All rights reserved.

ICND2 v1.0—4-1

OSPF Overview
 Creates a neighbor relationship by exchanging hello packets  Propagates LSAs rather than routing table updates – Link: Router interface

– State: Description of an interface and its relationship to neighboring routers
 Floods LSAs to all OSPF routers in the area, not just directly connected routers

 Pieces together all the LSAs generated by the OSPF routers to create the OSPF link-state database
 Uses the SPF algorithm to calculate the shortest path to each destination and places it in the routing table

© 2007 Cisco Systems, Inc. All rights reserved.

ICND2 v1.0—4-2

0—4-3 .OSPF Hierarchy Example  Minimizes routing table entries  Localizes the impact of a topology change within an area © 2007 Cisco Systems. Inc. ICND2 v1. All rights reserved.

Inc.0—4-4 . All rights reserved. ICND2 v1.Neighbor Adjacencies: The Hello Packet © 2007 Cisco Systems.

0—4-5 .SPF Algorithm 10 10 1 1 1  Places each router at the root of a tree and calculates the shortest path to each destination based on the cumulative cost  Cost = Reference Bandwidth / Interface Bandwidth (b/s) © 2007 Cisco Systems. ICND2 v1. Inc. All rights reserved.

Configuring Single-Area OSPF RouterX(config)# router ospf process-id  Defines OSPF as the IP routing protocol RouterX(config-router)# network address wildcard-mask area area-id  Assigns networks to a specific OSPF area © 2007 Cisco Systems. ICND2 v1. Inc.0—4-6 . All rights reserved.

Configuring Loopback Interfaces Router ID:  Number by which the router is known to OSPF  Default: The highest IP address on an active interface at the moment of OSPF process startup  Can be overridden by a loopback interface: Highest IP address of any active loopback interface  Can be set manually using the router-id command © 2007 Cisco Systems. ICND2 v1. All rights reserved. Inc.0—4-7 .

240 to network 10.110. N2 .132.0 [110/10] via 10.254.0 [170/10] via 10. O . Ethernet2 10.RIP derived.119.67. 0:02:22.254. Ethernet2 E2 10.BGP derived.140. 0:00:59.130.IGRP derived.128. B . Ethernet2 10. Inc.119.0 O O O O O .EGP derived.Verifying the OSPF Configuration RouterX# show ip protocols  Verifies that OSPF is configured RouterX# show ip route  Displays all the routes learned by the router RouterX# show ip route Codes: I .OSPF external type 2 route. 0:02:22.0 [110/5] via 10.OSPF derived.254.6. 10.244.254. 0:00:59.0 [110/5] via 10.0.OSPF NSSA external type 2 route Gateway of last resort is 10.10.6.119. Ethernet2 IA 10. 0:01:00.0. N1 .OSPF NSSA external type 1 route. Ethernet2 . . E .0—4-8 © 2007 Cisco Systems. E2 .254.0 [110/5] via 10.0. R .connected. ICND2 v1.244.68.6.119.static.119. S .119. All rights reserved.254. C .0. .

timers. ICND2 v1. All rights reserved.0. and statistics RouterX# show ip ospf Routing Process "ospf 50" with ID 10.028 ago SPF algorithm executed 7 times <output omitted> © 2007 Cisco Systems.2 <output omitted> Number of areas in this router is 1. Inc.0—4-9 .) RouterX# show ip ospf  Displays the OSPF router ID. 1 normal 0 stub 0 nssa Number of areas transit capable is 0 External flood list length 0 Area BACKBONE(0) Area BACKBONE(0) Area has no authentication SPF algorithm last executed 00:01:25.64.Verifying the OSPF Configuration (Cont.

254. Retransmit 5 Hello due in 0:00:05 Neighbor Count is 8. All rights reserved. Dead 60.254. Adjacent neighbor count is 2 Adjacent with neighbor 192.168.10 Backup Designated router id 192. Inc.254.255.28 (Backup Designated Router) Adjacent with neighbor 192. Network Type BROADCAST. line protocol is up Internet Address 192.168. Interface address 192.168. Router ID 192.1.0.254.0—4-10 .10.168. Interface addr 192.254.10 (Designated Router) © 2007 Cisco Systems.99. State OTHER. Wait 40.168.254.Verifying the OSPF Configuration (Cont.168. Cost: 10 Transmit Delay is 1 sec. Mask 255.168.0.254.168.255. Area 0.0 AS 201.28 Timer intervals configured. ICND2 v1.0.202.28. Priority 1 Designated Router id 192.) RouterX# show ip ospf interface  Displays the area ID and adjacency information RouterX# show ip ospf interface ethernet 0 Ethernet 0 is up. Hello 10.

80.48.37 172.) RouterX# show ip ospf neighbor  Displays the OSPF neighbor information on a per-interface basis RouterX# show ip ospf neighbor ID 10.48.200 172.16.16.137 Pri 1 1 1 5 State Dead Time FULL/DR 0:00:31 FULL/DROTHER 0:00:33 FULL/DROTHER 0:00:33 FULL/DR 0:00:33 Address 192. Inc.199.199.48.199.168.16.Verifying the OSPF Configuration (Cont.48. All rights reserved.1 172.199.137 172.189 Interface FastEthernet0/0 FastEthernet0/1 FastEthernet0/1 FastEthernet0/1 © 2007 Cisco Systems.16.200 10.0—4-11 .1 172.16.48. ICND2 v1.

0 via interface Fddi0 Neighbor priority is 5.189 In the area 0.0. interface address 192.0. ICND2 v1.16.137.199.199.0 via interface Ethernet0 Neighbor priority is 1. Inc.199.0. interface address 172. All rights reserved. State is FULL Options 2 Dead timer due in 0:00:32 Link State retransmission due in 0:00:03 © 2007 Cisco Systems.168.199.199.0—4-12 .137 Neighbor 10.137.199.) RouterX# show ip ospf neighbor 10. State is FULL Options 2 Dead timer due in 0:00:32 Link State retransmission due in 0:00:04 Neighbor 10.37 In the area 0.Verifying the OSPF Configuration (Cont.48.80.0.

255.255.0. Inc.0 configured 255.0. v:2 t:1 l:48 rid:200.0 dead interval received 40 configured 30 OSPF: rcv.0. v:2 t:1 l:48 rid:200.0—4-13 .OSPF debug Commands RouterX# debug ip ospf events OSPF:hello with invalid timers on interface Ethernet0 hello interval received 10 configured 10 net mask received 255.0 chk:0 aut:2 keyid:1 seq:0x0 © 2007 Cisco Systems. All rights reserved. ICND2 v1.255.0 chk:6AB2 aut:0 auk: RouterX# debug ip ospf packet OSPF: rcv.116 aid:0.0.255.0.0.117 aid:0.0.0.

Load Balancing with OSPF OSPF load balancing:  Paths must be equal cost  By default.0—4-14 . Inc. All rights reserved. ICND2 v1. up to a maximum of 16 paths can be configured: – (config-router)# maximum-paths <value>  To ensure paths are equal cost for load balancing. up to four equal-cost paths can be placed into the routing table  With a configuration change. you can change the cost of a particular link: – (config-if)# ip ospf cost <value> © 2007 Cisco Systems.

ICND2 v1. All rights reserved.Load Balancing with OSPF © 2007 Cisco Systems. Inc.0—4-15 .

0—4-16 . Inc. each participating neighbor must have the same key configured.  The router authenticates the source of each routing update packet that it receives.  Configure a ―key‖ (password). ICND2 v1. © 2007 Cisco Systems.OSPF Authentication  OSPF supports two types of authentication: – Plaintext (or simple) password authentication – MD5 authentication  The router generates and checks every OSPF packet. All rights reserved.

All rights reserved.0) OR RouterX(config-router)# area area-id authentication [message-digest]  Specifies the authentication type for an area © 2007 Cisco Systems. ICND2 v1.0—4-17 .Configuring OSPF Plaintext Password Authentication RouterX(config-if)# ip ospf authentication-key password  Assigns a password to use with neighboring routers RouterX(config-if)# ip ospf authentication [message-digest | null]  Specifies the authentication type for an interface (as of Cisco IOS Release 12. Inc.

ICND2 v1.0—4-18 .Plaintext Password Authentication Configuration Example © 2007 Cisco Systems. Inc. All rights reserved.

168. timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5).2/32 [110/782] via 192.168. 00:01:17.1.2.2.2.1.2 Type escape sequence to abort. round-trip min/avg/max = 28/29/32 ms © 2007 Cisco Systems.1.2 0 FULL/ Dead Time 00:00:32 Address 192.2. 100-byte ICMP Echos to 10.2.1.102.168. All rights reserved.2.102 Interface Serial0/0/1 RouterX#show ip route <output omitted> Gateway of last resort is not set 10.0. ICND2 v1.0—4-19 . 1 subnets C 192. Serial0/0/1 RouterX#ping 10.1. Sending 5. Serial0/0/1 C 10.0/8 is variably subnetted. 2 masks O 10.2.96 is directly connected.0/27 is subnetted.2. Inc.0/24 is directly connected.Verifying Plaintext Password Authentication RouterX#show ip ospf neighbor Neighbor ID Pri State 10.0.2.1.168. Loopback0 192. 2 subnets.

ICND2 v1.0—4-20 . Inc.Visual Objective 4-1: Implementing OSPF © 2007 Cisco Systems. All rights reserved.

Summary  OSPF is a classless.  There are two types of OSPF authentication: Plaintext and MD5. © 2007 Cisco Systems.  OSPF will load-balance across up to four equal-cost metric paths by default. ICND2 v1.0—4-21 .  The show ip ospf neighbor command displays OSPF neighbor information on a per-interface basis.  The SPF algorithm uses a cost metric to determine the best path.  The commands debug ip ospf events and debug ip ospf packets can be used to troubleshoot OSPF problems. All rights reserved. Inc.  The router ospf process-id command is used to enable OSPF on the router.  OSPF exchanges hello packets to establish neighbor adjacencies between routers.  Use a loopback interface to keep the OSPF router ID consistent. Lower costs indicate a better path. link-state routing protocol that uses an area hierarchy for fast convergence.

ICND2 v1. All rights reserved.© 2007 Cisco Systems.0—4-22 . Inc.

# %#       .89907309 .

 &.

#      .89907309 .

   .4$89028 3.  8. 79870807.0/ .

0.70.3828843/:03    0-47    39071.3828843/:03     8..907097. .0907309  0-47574798 $9.943 439 #4:907 845485130-47    0-47    39071...0.70.//7088    390.. 79870807. .39071./9207/:03   3$9.4$89028 3.908& 59438 0..39071.0/ .907097.   .908& 59438 0.0//  0-47574798 $9.//7088    390..'071390 $!431:7./9207/:03   3$9.

.0/ .431:70/ $!7..   ...97/  .3/8 #4:907/0-:548510.0398 $!0493.0.: #4:907/0-:548515.0/   . .09 $!7.0/ .0907309 043907..0..4$89028 3. 79870807./ .431:70/ 3092.431:70/   /0./920784339071. .:9 .0.$!/0-:422.0/ .97/  ...870./3907.70.70../ .:90/806   8.

4895.3 . 79870807./.431:7.98.../-.3 !.431 1 54851.2:2415..39 $! $!4.30 :594.3 4:.98..7006:.3-0 .-0 9.2:2 5..98.3090..   .:0  8.4$89028 3.79./-..982:89-006:.:.489 /01.3-05.943.3.5.73 ...2..431:70/ .4891474..489.48941.:9 :59414:706:.3.3.431 74:907 2.0/ ..0/39490 74:939.:0 %4038:705. ...4.98.

   .0/ .39 $!  8.4$89028 3.3./.4.. 79870807.

:9039.943 $!8:55479894950841...0908.431:70/  8.908.08 431:70. 0  5..099.3/.09  %074:907.:9039.07 $!5..200.3909 478250 5...4$89028 3.$!:9039..0/ .8847/ 0.0410.0.:9039.80.79.74:93:5/..5.9330-47 2:89.943 .9970..943 !.   .:9039.0..9089084:7. 79870807.8847/.5.90 5.943 %074:9070307.

0/ .431 1  54851.943950147.943950147.70..:9039. / .339071. 79870807.:9039.8847/ 8838..3909!.3.0 /0893:( $50.9432088.:9039.10890.431:73 $!!..4  $#00..4$89028 3.431 74:907  .8418..943 05.70.8847/ :9039.:9039.943 #4:907 ..80 # #4:907 .8847/94:80930-47374:9078 #4:907 .:9039..431 1  54851.   .10890.  8.0 /089( $50.5.0 .70.9432088..

8847/:9039.!.943.943 431:7. 79870807.250  8.3909!.0/ ..4$89028 3.   .

'0713!...3909!.943 #4:907845485130-47 0-47!7$9./%20//708839071.8847/ :9039.0     &.900.

      $07. .

.

90.897084798349809  . #4:90784574:90 4:95:942990/ .41.

.7.-8:-30990/ 8:-3098 2.8.88    .

 .

        $07.(. ..

.

    .

4330.8/70.90/ 445-.9.    ..

4330.9.88:-30990/ 8:-3098    8/70. .90/ $07.

.

..908 507.039 . #4:90753    %5008.43/8  $:.4894    9204:9880.-479 $03/3  -90!.094.50806:03.0887.

 74:3/ 97523.

...

.2.

.

   . 79870807.0/ .28  8.4$89028 3.

'8:. 79870807.4$89028 3.0 25020393 $!  8.   .0/ . -0.9.

39071.-0 $!4390 74:907 &80. 1471.   .9 %074:9074851574.09894089..70.3-0 :80/94974:-08449 $!574-028 $!4..94/090723090-0895.4892097..:9039.4792:808.0-.90.3.48983/.308045.43889039  %0845485130-47 ..9074:9357494.0.088 / ./ -.4$89028 3.7094950841 $!.0/ .422..3.89.5..0 $!0.-099075.0398..3//0-:548515.7488:59414:706:. .43./...07..$:22.422.3/8/0-:548510.9 407 .3/  8.-830-47.88088 3 89.0703.3/ 8:80/9403.9:808.:9  %070.09400590 $!74:907....4892097.422.943!. 79870807..7 $!8.445-.08-09003 74:9078 %0$!.3909.3//85.8 $!30-4731472.88 %0.49.7.507 39071.943 43..03.098 .98-/01.

0/ . 8.4$89028 3.   . 79870807.