OSPF Configuration


OSPF Configuration

This breadth covers the amount OSPF agreement commands, forth with the OSPF configuration

topics not already covered ahead in the chapter. (If you happened to skip the beforehand genitalia of

this chapter, planning to analysis OSPF configuration, accomplish abiding to go aback and attending at the earlier

examples in the chapter. These examples awning OSPF chubby breadth configuration, OSPF network

types, additional OSPF acquaintance and antecedence commands.)

Example 9-8 shows agreement for the routers in Figure 9-6, with the afterward architecture goals in

mind:

■ Proving that OSPF PIDs do not accept to bout on abstracted routers

■ Application the arrangement command to bout interfaces, thereby triggering acquaintance discovery

inside arrangement 10.0.0.0

■ Configuring S1’s RID as 7.7.7.7

OSPF Agreement 277

■ Ambience priorities on the courage LAN to favor S1 and S2 to become the DR/BDR

■ Configuring a basal asleep breach of 1 second, with accost multiplier of 4, acquiescent a

250-ms accost breach on the courage LAN

Example 9-8 OSPF Agreement Basics and OSPF Costs

! R1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! R1 has been configured for a (minimal) 1-second asleep interval, and 1/4-second

! (250 ms) accost breach based on 4 Hellos per 1-second asleep interval.

interface FastEthernet0/0

ip abode 10.1.1.1 255.255.255.0

ip ospf dead-interval basal hello-multiplier 4

! R1 uses the aforementioned butt breadth agreement as in Archetype 9-7, with network

! commands analogous based on the aboriginal two octets. Note that the arrangement commands

! abode anniversary interface into the actual area.

router ospf 1

area 3 nssa no-summary

area 4 butt no-summary

area 5 stub

network 10.1.0.0 0.0.255.255 breadth 0

network 10.3.0.0 0.0.255.255 breadth 3

network 10.4.0.0 0.0.255.255 breadth 4

network 10.5.0.0 0.0.255.255 breadth 5

! R2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! The R2 agreement additionally uses the Fast Accost feature, contrarily it

! would not bout accost and asleep intervals with R1.

interface FastEthernet0/0

ip abode 10.1.1.2 255.255.255.0

ip ospf dead-interval basal hello-multiplier 4

! Below, R2 uses a altered PID than R1, but the PID is alone acclimated locally.

! R1 and R2 will become neighbors. Also, all routers in a chubby breadth charge be

! configured to be that blazon of chubby area; R2 does that for breadth 5 below.

router ospf 2

area 5 stub

network 10.1.0.0 0.0.255.255 breadth 0

network 10.5.25.2 0.0.0.0 breadth 5

! R3 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!Note that R3’s breadth 2 nssa no-summary command charge bout the settings

! on R1. Likewise, below, R4’s butt settings charge bout R1’s settings for breadth 4.

.

router ospf 1

area 3 nssa no-summary

network 10.0.0.0 0.255.255.255 breadth 3

! R4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

router ospf 1

area 4 butt no-summary

network 10.0.0.0 0.255.255.255 breadth 4

continues

278 Affiliate 9: OSPF

Note that R3 and R4 do not charge the no-summary advantage on the breadth command; this parameter

is alone bare at the ABR, in this case R1. The ambit are apparent actuality to accent the variations

of chubby areas.

OSPF Costs and Allowance the OSPF Process

Example 9-9 highlights a few capacity about allowance (restarting) the OSPF process, and looks at

changes to OSPF costs. This archetype shows the afterward sequence:

1. R3’s OSPF action is cleared, causing all neighbors to abort and restart.

2. R3’s log-adjacency-changes detail agreement command (under router ospf) causes more

detailed acquaintance accompaniment change letters to appear.

3. R5 has acquainted its amount settings with the ip ospf amount 50 interface subcommand beneath S0.2 in

order to adopt R2 over R1 for extensive the core.

4. R2 is configured to use a new advertence bandwidth, alteration its amount adding per interface.

! S1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! S1 matches accost and asleep intervals on the LAN. Also, it sets its OSPF

! antecedence to 255, the best value, acquisitive to become the DR.

interface Vlan1

ip abode 10.1.1.3 255.255.255.0

ip ospf dead-interval basal hello-multiplier 4

ip ospf antecedence 255

! Below, S1 sets its RID manually, removing any assurance on an interface address.

router ospf 1

router-id 7.7.7.7

network 10.1.0.0 0.0.255.255 breadth 0

! S2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! Below, S2 additionally matches timers, and sets its antecedence to 1 beneath than S1, hoping

! to be the BDR.

interface Vlan1

ip abode 10.1.1.4 255.255.255.0

ip ospf dead-interval basal hello-multiplier 4

ip ospf antecedence 254

!

router ospf 1

network 10.0.0.0 0.255.255.255 breadth 0

Example 9-9 Alteration RIDs, Allowance OSPF, and Amount Settings

R3# bright ip ospf process

Reset ALL OSPF processes? [no]: y

! Above, all OSPF processes are austere on R3. R3 has the log-adjacency-changes

! detail command configured, so that a bulletin is generated at anniversary state

! change, as apparent beneath for acquaintance R33 (RID 192.168.1.1). (Messages for

! added routers are omitted.)

Example 9-8 OSPF Agreement Basics and OSPF Costs (Continued)

OSPF Agreement 279

00:02:46: %OSPF-5-ADJCHG: Action 1, Nbr 192.168.1.1 on Ethernet0/0 from FULL to DOWN,

Neighbor Down: Interface bottomward or detached

00:02:53: %OSPF-5-ADJCHG: Action 1, Nbr 192.168.1.1 on Ethernet0/0 from DOWN to INIT,

Received Hello

00:02:53: %OSPF-5-ADJCHG: Action 1, Nbr 192.168.1.1 on Ethernet0/0 from INIT to 2WAY,

2-Way Received

00:02:53: %OSPF-5-ADJCHG: Action 1, Nbr 192.168.1.1 on Ethernet0/0 from 2WAY to EXSTART,

AdjOK?

00:02:53: %OSPF-5-ADJCHG: Action 1, Nbr 192.168.1.1 on Ethernet0/0 from EXSTART

to EXCHANGE, Negotiation Done

00:02:53: %OSPF-5-ADJCHG: Action 1, Nbr 192.168.1.1 on Ethernet0/0 from EXCHANGE

to LOADING, Exchange Done

00:02:53: %OSPF-5-ADJCHG: Action 1, Nbr 192.168.1.1 on Ethernet0/0 from LOADING to FULL,

Loading Done

! Next R5 has costs of 50 and 64, respectively, on interfaces s0.2 and s0.1.

R5# appearance ip ospf int brief

Interface PID Breadth IP Address/Mask Amount Accompaniment Nbrs F/C

Se0.2 1 5 10.5.25.5/24 50 P2P 1/1

Se0.1 1 5 10.5.15.5/24 64 P2P 1/1

Et0 1 5 10.5.1.5/24 10 DR 0/0

! Below, S0.1’s amount was based on bandwidth of 64, application blueprint 108 / bandwidth,

! with bandwidth in bits/second.

R5# sh int s 0.1

Serial0.1 is up, band agreement is up

Hardware is HD64570

Internet abode is 10.5.15.5/24

MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,

reliability 255/255, txload 1/255, rxload 1/255

Encapsulation FRAME-RELAY

Last allowance of "show interface" counters never

! Next, R2’s interface costs are shown, including the minimum amount 1 on fa0/0.

R2# sho ip ospf int brief

Interface PID Breadth IP Address/Mask Amount Accompaniment Nbrs F/C

Fa0/0 2 0 10.1.1.2/24 1 BDR 3/3

Se0/0.5 2 5 10.5.25.2/24 64 P2P 1/1

! Below, R2 changes its advertence bandwidth from the absence of 100 Mbps to

! 10,000 Mbps. That in about-face changes R2’s affected amount ethics to be 100 times

! beyond than before. Note that IOS allows this ambience to alter on the routers,

! but recommends adjoin it.

R2# conf t

Enter agreement commands, one per line. End with CNTL/Z.

R2(config)# router ospf 2

R2(config-router)# auto-cost reference-bandwidth 10000

% OSPF: Advertence bandwidth is changed.

Please ensure advertence bandwidth is constant beyond all routers.

R2# appearance ip ospf int brief

Interface PID Breadth IP Address/Mask Amount Accompaniment Nbrs F/C

Fa0/0 2 0 10.1.1.2/24 100 BDR 3/3

Se0/0.5 2 5 10.5.25.2/24 6476 P2P 1/1

Example 9-9 Alteration RIDs, Allowance OSPF, and Amount Settings (Continued)

280 Affiliate 9: OSPF

While Examples 9-8 and 9-9 appearance some details, the afterward account summarizes how IOS chooses

OSPF interface costs:

1. Set the amount per acquaintance application the acquaintance acquaintance amount amount command. (This is valid

only on OSPF arrangement types that acquiesce acquaintance commands.)

2. Set the amount per interface application the ip ospf amount amount interface subcommand.

3. Acquiesce amount to absence based on interface bandwidth and the OSPF Advertence Bandwidth (Ref-

BW) (default 108). The blueprint is Ref-BW / bandwidth (bps).

4. Absence based on bandwidth, but change Ref-BW application the command ospf auto-cost

reference-bandwidth amount command aural the OSPF process.

The alone hardly catchy allotment of the amount adding algebraic is to accumulate the units straight, because the

IOS interface bandwidth is kept in kbps, and the auto-cost reference-bandwidth command’s

units are Mbps. For instance, on R5 in Archetype 9-9, the amount is affected as 100 Mbps disconnected by

1544 kbps, breadth 1544 kbps is according to 1.544 Mbps. The aftereffect is angled bottomward to the nearest

integer, 64 in this case. On R2’s fa0/0, the bandwidth is 100,000 kbps, or 100 Mbps, authoritative the

calculation crop a amount of 1. After alteration the advertence bandwidth to 10,000, which means

10,000 Mbps, R2’s affected costs were 100 times larger.

Alternatives to the OSPF Arrangement Command

As of Cisco IOS Software Release 12.3(11)T, OSPF agreement can absolutely omit the

network command, instead relying on the ip ospf process-id breadth area-id interface subcommand.

This new command enables OSPF on the interface and selects the area. For instance, on R3 in

Example 9-8, the arrangement 10.3.0.0 0.0.255.255 breadth 3 command could accept been deleted and

replaced with the ip ospf 1 breadth 3 command beneath S0/0.1 and e0/0.

The arrangement and ip ospf breadth commands accept some accessory differences back accessory IP

addresses are used. With the arrangement command, OSPF advertises butt networks for any

secondary IP subnets that are akin by the command. (“Secondary subnet” is abracadabra that refers

to the subnet in which a accessory IP abode resides.) The ip ospf breadth interface subcommand

causes any and all accessory subnets on the interface to be advertised as butt networks—unless

the alternative secondaries none constant is included at the end of the command.

NOTE Back allotment the best routes to ability a subnet, OSPF additionally considers whether a route

is an intra-area route, inter-area route, E1 route, or E2 route. OSPF prefers intra-area over all

the rest, again interarea, again E1, and assuredly E2 routes. Beneath accustomed circumstances, routes to a

single subnet should all be the aforementioned type; however, it is accessible to accept assorted avenue paths to

reach a distinct subnet in the OSPF SPF tree, but with some of these routes actuality a altered type.

Example 10-7 in Affiliate 10 demonstrates this.