Configuring OSPF in Multiple Areas

Một phần của tài liệu CCNP practical studies routing (Trang 95 - 104)

Turn your attention to a far more complex OSPF scenario and apply some of the advanced features in OSPF.

This scenario uses four routers: R1 and R2 from scenario 3-1 and two new routers named R6 and R3. Figure 3-2 displays the routers in this scenario.

Figure 3-2. OSPF Topology and IP Addressing

In this scenario, you add two new routers, R3 and R6, and create an additional two new areas: Area 0 and Area 2. That makes a total of three areas: the backbone Area 0 between R3 and R6, Area 2 covering the link between R6 and R2, and Area 1 covering the Ethernets between R1 and R2.

Routers R2 and R6 in this case are referred to area border routers (ABRs) because more than one area is configured on each router. OSPF includes a number of different router types. Table 3-3 displays all the possible routers types.

Table 3-3. OSPF Router Types

Router type Description

Internal router This router is within a specific area only. Internal router functions include maintaining the OSPF database and forwarding data to other networks. All interfaces on internal routers are in the same area.

Area border router

(ABR) ABRs are responsible for connecting two or more areas. ABRs contain the full topological database of each area they are connected to and send this information to other areas.

Autonomous system border router

(ASBR)

ASBRs connect to the outside world or perform some form of redistribution into OSPF.

Backbone router Backbone routers are connected to area 0, also know as area 0.0.0.0. Backbone routers can be internal routers and ASBRs.

In Figure 3-2, R1 is an internal router; R2 is an ABR; R6 is a backbone router and ABR, and R3 is a backbone router.

Router R1 requires no configuration change, but you need to modify R2 and enable OSPF on R3 and R6. Example 3-10 displays the modifications required on R2.

Remember that you have a link to R6, so you need to set IP addressing and clocking as you did in the Chapter 2, “Routing Principles.” Example 3-5 uses Cisco serial back- to-back V.35 cables.

Example 3-10 Configuration of R2 as ABR

R2(config)#router ospf 2

R2(config-router)#network 141.108.10.0 0.0.0.3 area 2

Now, enable OSPF on R3 and R6. Notice the IP addressing in Figure 3-2 has a

mixture of the Class B networks 131.108.0.0 and 141.108.0.0 with different subnets.

Hence, this scenario uses VLSM extensively to illustrate the capability of OSPF to handle VLSM.

To enable OSPF on R6, start the OSPF process with the process ID 6 and enable the interfaces to advertise the networks as displayed by Example 3-11.

Example 3-11 Enable OSPF on R6 with Process ID 6

r6(config)#router ospf 6

r6(config-router)# network 141.108.9.0 0.0.0.127 area 0 r6(config-router)# network 141.108.9.128 0.0.0.127 area 0 r6(config-router)# network 141.108.10.0 0.0.0.3 area 2 r6(config-router)# network 141.108.10.4 0.0.0.3 area 0 r6(config-router)# network 141.108.12.0 0.0.0.255 area 0 r6(config-router)# network 141.108.12.26 0.0.0.255 area 0

Similarly, Example 3-12 displays the OSPF configuration required on R3.

Example 3-12 Enable OSPF on R3

R3(config)#router ospf 3

R3(config-router)#network 141.108.10.4 0.0.0.3 area 0 R3(config-router)#network 141.108.1.0 0.0.0.127 area 0 R3(config-router)#network 141.108.1.128 0.0.0.127 area 0 R3(config-router)#network 141.108.2.0 0.0.0.31 area 0 R3(config-router)#network 131.108.33.0 0.0.0.255 area 0

Now that OSPF is configured on all four routers, examine the routing table on the backbone network to ensure that all networks are routable. Example 3-13 displays the IP routing table on R6.

Example 3-13 IP Routing Table on R6

r6#show ip route

141.108.0.0/16 is variably subnetted, 7 subnets, 3 masks

O 141.108.1.128/25 [110/65] via 141.108.10.5, 00:00:32, Serial0 C 141.108.9.128/25 is directly connected, Loopback1

O 141.108.1.0/25 [110/65] via 141.108.10.5, 00:00:32, Serial0 C 141.108.9.0/25 is directly connected, Loopback0

C 141.108.10.0/30 is directly connected, Serial1 C 141.108.12.0/24 is directly connected, Loopback2 C 141.108.10.4/30 is directly connected, Serial0

131.108.0.0/24 is subnetted, 2 subnets

O 131.108.33.0 [110/74] via 141.108.10.5, 00:00:32, Serial0 C 131.108.26.0 is directly connected, Ethernet0

r6#

Example 3-13 displays the remote networks on Router R3, but not the networks from R1 or R2. For example, the Ethernet network 131.108.1.0/24 in area 1 is not

routable from R6. Examine R3's routing table. Example 3-14 displays R3's IP routing table.

Example 3-14 R3's IP Routing Table

R3>show ip route

141.108.0.0/16 is variably subnetted, 8 subnets, 4 masks C 141.108.1.128/25 is directly connected, Loopback1

O 141.108.9.128/25 [110/65] via 141.108.10.6, 00:23:42, Serial1 C 141.108.1.0/25 is directly connected, Loopback0

C 141.108.2.0/27 is directly connected, Loopback2

O 141.108.9.0/25 [110/65] via 141.108.10.6, 00:23:42, Serial1 O IA 141.108.10.0/30 [110/128] via 141.108.10.6, 00:23:42, Serial1 O 141.108.12.0/24 [110/65] via 141.108.10.6, 00:23:42, Serial1 C 141.108.10.4/30 is directly connected, Serial1

131.108.0.0/24 is subnetted, 1 subnets

C 131.108.33.0 is directly connected, Ethernet0

Once more, Example 3-14 doesn't display the networks in area 1 on Routers R1 and R2. Example 3-15 displays R2's IP routing table.

Example 3-15 R2's IP Routing Table

R2>show ip route

141.108.0.0/16 is variably subnetted, 7 subnets, 3 masks O IA 141.108.1.128/25 [110/846] via 141.108.10.2, 00:08:05, Serial1/0

O IA 141.108.9.128/25 [110/782] via 141.108.10.2, 00:26:20, Serial1/0

O IA 141.108.1.0/25 [110/846] via 141.108.10.2, 00:08:15, Serial1/0 O IA 141.108.9.0/25 [110/782] via 141.108.10.2, 00:26:20, Serial1/0 C 141.108.10.0/30 is directly connected, Serial1/0

O IA 141.108.12.0/24 [110/782] via 141.108.10.2, 00:26:20, Serial1/0 O IA 141.108.10.4/30 [110/845] via 141.108.10.2, 00:26:20, Serial1/0 131.108.0.0/16 is variably subnetted, 8 subnets, 3 masks

O 131.108.4.129/32 [110/11] via 131.108.1.1, 00:46:09, Ethernet0/0

C 131.108.5.32/27 is directly connected, Loopback0

O IA 131.108.33.0/24 [110/855] via 141.108.10.2, 00:09:06, Serial1/0 C 131.108.6.1/32 is directly connected, Loopback1

O 131.108.4.1/32 [110/11] via 131.108.1.1, 00:46:09, Ethernet0/0 O 131.108.5.1/32 [110/11] via 131.108.1.1, 00:46:09, Ethernet0/0 C 131.108.6.2/32 is directly connected, Loopback2

C 131.108.1.0/24 is directly connected, Ethernet0/0 R2>

Notice, however, that R2 has access to the remote networks in area 0 or on the backbone, but not vice versa, because Router R2 is connected to area 2.

Area 2 is not partitioned from the backbone. In fact, area 2 is directly connected to the backbone through Router R6.

Area 1 is not directly connected to the backbone. Therefore, Router R1 is missing IP networks.

The golden rule in any OSPF network is that all areas must be contiguous or all areas must be connected to the backbone. Scenario 3-2 includes three areas. If an area cannot be assigned to the backbone or is partitioned from the backbone, a virtual link is required. When designing a network, you use a virtual link to attach areas that do not have a physical connection to the backbone or in cases in which the backbone is partitioned, as in the example shown in Figure 3-2.

Figure 3-3 displays the areas and the requirement for a virtual link.

Figure 3-3. Area Assignments and the Virtual Link Requirement

The virtual link in this scenario is required from R2 to R6. The virtual link allows information about area 1 to be sent to the backbone. Another solution to this problem is to change the area 1 assignment to area 2 or to connect a physical link from area 1 to the backbone. In this scenario, configure a virtual link between R2 and R6.

To create a virtual link, you use the following command:

[no] area area-id virtual-link router-id [hello-interval seconds]

[retransmit-interval seconds] [transmit-delay seconds]

[dead-interval seconds] [[authentication-key key] | [message-digest-key keyid md5 key]]

As you can see, this command has many options. The following is a simplification:

area area-id virtual-link router-id

The area-id is the transit network between the two partitioned areas, in this case area 2. You can find the router-id by using the show ip ospf database command, which displays the complete OSPF database. Example 3-16 shows you how to

discover the router IDs on R2 and R6. Note that the extensive amount of information typically supplied by the show ip ospf database command is not all displayed in Example 3-16.

Example 3-16 show ip ospf database Command on R2 and R6

R2>show ip ospf database

OSPF Router with ID (131.108.6.2) (Process ID 2) r6>show ip ospf database

OSPF Router with ID (141.108.12.1) (Process ID 6)

You now have the information required to configure a virtual link between R3 and R6. Examples 3-17 and 3-18 display the configuration performed on Routers R2 and R6.

Example 3-17 Configuring a Virtual Link on R2

R2(config)#router ospf 2

R2(config-router)#area 2 virtual-link 141.108.12.1

Example 3-18 Configuring a Virtual Link on R6

R6(config)#router ospf 6

r6(config-router)#area 2 virtual-link 131.108.6.2

Use the show ip ospf virtual-links command on R2, demonstrated in Example 3- 19, to ensure that the virtual link is active.

Example 3-19 show ip ospf virtual-links

R2#show ip ospf virtual-links

Virtual Link OSPF_VL0 to router 141.108.12.1 is up Run as demand circuit

DoNotAge LSA allowed.

Transit area 2, via interface Serial1/0, Cost of using 781 Transmit Delay is 1 sec, State POINT_TO_POINT,

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:07

Adjacency State FULL (Hello suppressed)

Example 3-19 displays an active link to the remote OSPF router with the ID

141.108.12.1. Now, view the routing tables on R3 to determine whether the area 1 networks have been inserted into the IP routing table, as demonstrated in Example 3-20.

Example 3-20 show ip route on R3

R3#show ip route

141.108.0.0/16 is variably subnetted, 8 subnets, 4 masks C 141.108.1.128/25 is directly connected, Loopback1

O 141.108.9.128/25 [110/65] via 141.108.10.6, 00:01:43, Serial1 C 141.108.1.0/25 is directly connected, Loopback0

C 141.108.2.0/27 is directly connected, Loopback2

O 141.108.9.0/25 [110/65] via 141.108.10.6, 00:01:43, Serial1 O IA 141.108.10.0/30 [110/128] via 141.108.10.6, 00:01:43, Serial1 O 141.108.12.0/24 [110/65] via 141.108.10.6, 00:01:43, Serial1 C 141.108.10.4/30 is directly connected, Serial1

131.108.0.0/16 is variably subnetted, 9 subnets, 3 masks

O IA 131.108.4.129/32 [110/139] via 141.108.10.6, 00:01:43, Serial1 O IA 131.108.5.32/27 [110/1128] via 141.108.10.6, 00:01:43, Serial1 C 131.108.33.0/24 is directly connected, Ethernet0

O IA 131.108.6.1/32 [110/129] via 141.108.10.6, 00:01:43, Serial1 O IA 131.108.4.1/32 [110/139] via 141.108.10.6, 00:01:43, Serial1 O IA 131.108.6.2/32 [110/129] via 141.108.10.6, 00:01:43, Serial1 O IA 131.108.5.1/32 [110/139] via 141.108.10.6, 00:01:43, Serial1 O IA 131.108.1.0/24 [110/138] via 141.108.10.6, 00:01:43, Serial1 O 131.108.26.0/24 [110/74] via 141.108.10.6, 00:01:44, Serial1 Router R3 discovers the remote networks from the partitioned area 1 through the virtual link between the routers R2 and R6 as demonstrated by the IP routing table in Example 3-20.

Examples 3-21,3-22, and 3-23 show the three configurations of routers R2, R3, and R6, respectively. R1's configuration is unchanged from scenario 3-1.

Example 3-21 Full Configuration on R2

Current configuration:

!

version 12.0

service timestamps debug uptime service timestamps log uptime no service password-encryption

!

hostname R2

!

enable password cisco

!

no ip domain-lookup

!

interface Loopback0

ip address 131.108.5.33 255.255.255.224

ip ospf network point-to-point ip ospf cost 1000

!

interface Loopback1

ip address 131.108.6.1 255.255.255.255

!

interface Loopback2

ip address 131.108.6.2 255.255.255.255

!

interface Ethernet0/0

ip address 131.108.1.2 255.255.255.0

!

interface TokenRing0/0 shutdown

!

interface Serial1/0

ip address 141.108.10.1 255.255.255.252

!

interface Serial1/1 shutdown

!

interface Serial1/2 shutdown

!

interface Serial1/3 shutdown

!

router ospf 2

area 2 virtual-link 141.108.12.1 network 131.108.1.0 0.0.0.255 area 1 network 131.108.5.32 0.0.0.31 area 1 network 131.108.6.1 0.0.0.0 area 1 network 131.108.6.2 0.0.0.0 area 1 network 141.108.10.0 0.0.0.3 area 2

!

line con 0 line aux 0 line vty 0 4 login

! end

Example 3-22 displays R3's full configuration.

Example 3-22 Full Configuration on R3

version 12.0

!

hostname R3

!

enable password cisco

!

interface Loopback0

ip address 141.108.1.1 255.255.255.128 ip ospf network point-to-point

!

interface Loopback1

ip address 141.108.1.129 255.255.255.128 ip ospf network point-to-point

!

interface Loopback2

ip address 141.108.2.1 255.255.255.224 ip ospf network point-to-point

!

interface Ethernet0

ip address 131.108.33.1 255.255.255.0

!

interface Ethernet1 shutdown

!

interface Serial0 shutdown

!

interface Serial1

ip address 141.108.10.5 255.255.255.252

!

router ospf 3

network 131.108.33.0 0.0.0.255 area 0 network 141.108.1.0 0.0.0.127 area 0 network 141.108.1.128 0.0.0.127 area 0 network 141.108.2.0 0.0.0.31 area 0 network 141.108.10.4 0.0.0.3 area 0 line con 0

line aux 0 line vty 0 4

! end

Example 3-23 displays R6's full configuration.

Example 3-23 Full Configuration on R6

!

version 12.0

!

hostname r6

!

enable password cisco

!

interface Loopback0

ip address 141.108.9.1 255.255.255.128 ip ospf network point-to-point

!

interface Loopback1

ip address 141.108.9.129 255.255.255.128 ip ospf network point-to-point

!

interface Loopback2

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

!

interface Ethernet0

ip address 131.108.26.1 255.255.255.0 media-type 10BaseT

!

interface Ethernet1 shutdown

!

interface Serial0

ip address 141.108.10.6 255.255.255.252 clockrate 125000

!

interface Serial1

ip address 141.108.10.2 255.255.255.252 clockrate 125000

!

interface Serial2 shutdown

!

interface Serial3 shutdown

!

interface TokenRing0 shutdown

!

interface TokenRing1 shutdown

!

router ospf 6

area 2 virtual-link 131.108.6.2 network 141.108.9.0 0.0.0.127 area 0 network 141.108.9.128 0.0.0.127 area 0 network 141.108.10.0 0.0.0.3 area 2 network 141.108.10.4 0.0.0.3 area 0 network 131.108.26.0 0.0.0.255 area 0

!

line con 0 line aux 0 line vty 0 4 end

Now, you move on to learn about some common OSPF commands you can use to ensure that remote networks are reachable.

Một phần của tài liệu CCNP practical studies routing (Trang 95 - 104)

Tải bản đầy đủ (PDF)

(498 trang)