OSPF Configuration Example

Figure 2-17 demonstrates a two-router topology. Figure 2-17 displays three OSPF areas with Area 2 partitioned from the backbone, necessitating a virtual link.

Figure 2-17 Typical Cisco IOS OSPF topology

Virtual Link Required

Figure 2-17 Typical Cisco IOS OSPF topology

Virtual Link Required

R1's Loopbacks in Area 0 Loopback0 131.108.2.1/24 Loopback1 131.108.3.1/24 Loopback2 131.108.4.1/24 Loopback3 131.108.5.1/24 Loopback4 131.108.6.1/24 Loopback5 131.108.7.1/24

R2's Loopbacks in Area 1 Loopback0 131.108.9.1/24 Loopback1 131.108.10.1/24 Loopback2 131.108.11.1/24 Loopback3 131.108.12.1/24 Loopback4 131.108.13.1/24 Loopback5 131.108.14.1/24 Loopback6 131.108.15.1/24

Example 2-18 displays the full working configuration of R1.

Example 2-18 R1's OSPF Configuration

hostname R1 enable password cisco interface Loopback0 ip address 131.108.2.1 255.255.255.0

ip ospf network point-to-point

ip address 131.108.3.1 255.255.255.0

ip ospf network point-to-point

interface Loopback2 ip address 131.108.4.1 255.255.255.0

ip ospf network point-to-point

Example 2-18 R1's OSPF Configuration (Continued)

interface Loopback3

ip address 131.108.3.1

255.255.255.0

ip ospf network point-

to-point

interface Loopback4

ip address 131.108.6.1

255.255.255.0

ip ospf network point-

to-point

interface Loopback5

ip address 131.108.7.1

255.255.255.0

ip ospf network point-

to-point

interface Ethernet0/0

ip address 131.108.1.1

!

255.255.255.0

interface Serial0/0

bandwidth 256

ip address 131.108.255

.1 255.255.255

252

encapsulation frame-relay

ip ospf network point-

to-point

interface Serial0/1

bandwidth 256

ip address 131.108.255

.5 255.255.255

252

encapsulation frame-relay

ip ospf network point-

to-point

router ospf 1

router-id 131.108.7.1

area 1 virtual-link 131

.108.15.1

network 131.108.0.0 0.

0.7.255 area 0

network 131.108.255.0

0.0.0.3 area 0

i

0.0.0.3 area 0

end

By default, loopback interfaces are stub hosts in OSPF and are advertised as 32-bit hosts. The IOS command ip ospf network point-to-point advertises the loopback networks as /24 networks (in this case, you use /24 subnet mask). The Frame Relay connection is configured as point-to-point to ensure that no manual OSPF neighbor configuration is required to form OSPF neighbors. The virtual link is configured across the transit area, 1, to R2 router ID of 131.108.14.1.

Example 2-19 displays R2's full working configuration.

Example 2-19 R2's OSPF Configurations hostname R2

enable password cisco interface Loopback0 ip address 131.108.9.1 255.255.255.0 ip ospf network point-to-point

interface Loopback1

ip address 131.108.10.1 255.255.255.0 ip ospf network point-to-point

interface Loopback2 ip address 131.108.11.1 255.255.255.0 ip ospf network point-to-point

interface Loopback3 ip address 131.108.12.1 255.255.255.0 ip ospf network point-to-point

interface Loopback4 ip address 131.108.13.1 255.255.255.0 ip ospf network point-to-point

interface Loopback5 ip address 131.108.14.1 255.255.255.0 ip ospf network point-to-point

interface Loopback6 ip address 131.108.15.1 255.255.255.0 ip ospf network point-to-point

interface Ethernet0/0 ip address 131.108.8.1 255.255.255.0 half-duplex

interface Serial0/0 ip address 131.108.255.2 255.255.255.252 encapsulation frame-relay ip ospf network point-to-point interface Serial0/1 ip address 131.108.255.6 255.255.255.252 encapsulation frame-relay ip ospf network point-to-point

router ospf 1 router-id 131.108.15.1 area 1 virtual-link 131.108.7.1 network 131.108.8.0 0.0.0.255 area 2 network 131.108.9.0 0.0.0.255 area 1

Example 2-19 R2's OSPF Configurations (Continued)

network 131 network 131 network 131 network 131 network 131 network 131 network 131 network 131 end

.10.0 0 .11.0 0 .12.0 0 .13.0 0 .14.0 0 .15.0 0 .255.0 .255.4

) .255 area 1 ) .255 area 1 ) .255 area 1 ) .255 area 1 ) .255 area 1 ) .255 area 1 .0.3 area 0 .0.3 area 0

Example 2-20 displays the IP OSPF routing table on R1. Example 2-20 show ip route ospf on R1

R1#show

ip route ospf

131

.108.

0.0/16 is variably

subnetted,

17 subnets, 2 masks

O

131.1

08.15.0/24

[110/391

via

131.

08.255

6,

00

00

41,

Serial0/1

[110/391

via

131.

08.255

2,

00

00

41,

Serial0/0

O

131.1

08.14.0/24

[110/391

via

131.

08.255

6,

00

00

41,

Serial0/1

[110/391

via

131.

08.255

2,

00

00

41,

Serial0/0

O

131.1

08.13.0/24

[110/391

via

131.

08.255

6,

00

00

41,

Serial0/1

[110/391

via

131.

08.255

2,

00

00

41,

Serial0/0

O

131.1

08.12.0/24

[110/391

via

131.

08.255

6,

00

00

41,

Serial0/1

[110/391

via

131.

08.255

2,

00

00

41,

Serial0/0

O

131.1

08.11.0/24

[110/391

via

131.

08.255

6,

00

00

41,

Serial0/1

[110/391

via

131.

08.255

2,

00

00

41,

Serial0/0

O

131.1

08.10.0/24

[110/391

via

131.

08.255

6,

00

00

41,

Serial0/1

[110/391

via

131.

08.255

2,

00

00

41,

Serial0/0

O

131.1

08.9.0/24

[110/391

via

131.

08.255

6,

00

00

41,

Serial0/1

[110/391

via

131.

08.255

2,

00

00

42,

Serial0/0

O IA

131.1

08.8.0/24

[110/400

via

131.

08.255

6,

00

00

42,

Serial0/1

[110/400

via

131.

08.255

2,

00

00

42,

Serial0/0

R1's routing table has the remote OSPF networks labeled as O IA because the network 131.108.8.0/24 is part of an area not directly attached to R1. Also, R1 is automatically load balancing across the two paths because the cost metric is the same (391). The administrative distance is 110 (the default).

NOTE The election of the designated router in networks such as Frame Relay is important, and you must ensure the hub or core network router is the elected DR so that the hub router disseminates information to all spoke routers. To ensure the hub is the DR, you can disable the DR election process on edge routers with the IOS command, ip ospf priority 0.

0 0

Post a comment