OSPF External and NSSA-External Path Selection

NOTE

OSPFは同じ経路が異なるLSAタイプで複数ある時は O > IA > E1 > E2 > N1 > N2 の順位で優先する。同じLSAタイプで複数ある時についてを確認する。

 

 

VERIFICATION

IA vs IA

O+IAのコストの小さいほうを優先
[R1]—–(1)—–[R2]—–(1)—–[R4](1)
[R1]—–(1)—–[R3]—–(1)—–[R5](1)

R4にLoopback192にarea 24、R5にLoopback192にarea 35をcost 1で設定。

R4(config)#int lo 192
R4(config-if)#ip os 1 a 24
R4(config-if)#ip os cost 1
R4(config-if)#

R5(config)#int lo 192
R5(config-if)#ip os 1 a 35
R5(config-if)#ip os cost 1
R5(config-if)#

O+IAコストの合計が同じなので引き分け、マルチパスになる。

R1#sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/2] via 10.1.2.2, 00:29:45, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:29:50, FastEthernet1/0
O IA     10.0.0.4/32 [110/3] via 10.1.2.2, 00:29:45, FastEthernet0/0
O IA     10.0.0.5/32 [110/3] via 10.1.3.3, 00:29:50, FastEthernet1/0
O IA     10.2.4.0/24 [110/2] via 10.1.2.2, 00:29:45, FastEthernet0/0
O IA     10.3.5.0/24 [110/2] via 10.1.3.3, 00:29:50, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O IA     192.168.99.99 [110/3] via 10.1.3.3, 00:03:56, FastEthernet1/0
                       [110/3] via 10.1.2.2, 00:04:13, FastEthernet0/0

エリア内のコストを変更。同じIA同士なのでO+IAの小さなR3経由の勝ち。
[R1]—–(5)—–[R2]—–(1)—–[R4](1)
[R1]—–(1)—–[R3]—–(1)—–[R5](1)

R1(config)#int fa0/0
R1(config-if)#ip os cost 5
R1(config-if)#
R1(config-if)#do sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/6] via 10.1.2.2, 00:00:15, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:32:21, FastEthernet1/0
O IA     10.0.0.4/32 [110/7] via 10.1.2.2, 00:00:15, FastEthernet0/0
O IA     10.0.0.5/32 [110/3] via 10.1.3.3, 00:32:21, FastEthernet1/0
O IA     10.2.4.0/24 [110/6] via 10.1.2.2, 00:00:15, FastEthernet0/0
O IA     10.3.5.0/24 [110/2] via 10.1.3.3, 00:32:21, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O IA     192.168.99.99 [110/3] via 10.1.3.3, 00:06:27, FastEthernet1/0

エリア外のコストを変更。IA同士はO+IAなので引き分け。
[R1]—–(5)—–[R2]—–(1)—–[R4](1)
[R1]—–(1)—–[R3]—–(5)—–[R5](1)

R3(config-if)#int fa1/0
R3(config-if)#ip os cost 5
R3(config-if)#

R1#sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/6] via 10.1.2.2, 00:06:08, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:38:14, FastEthernet1/0
O IA     10.0.0.4/32 [110/7] via 10.1.2.2, 00:06:08, FastEthernet0/0
O IA     10.0.0.5/32 [110/7] via 10.1.3.3, 00:00:51, FastEthernet1/0
O IA     10.2.4.0/24 [110/6] via 10.1.2.2, 00:06:08, FastEthernet0/0
O IA     10.3.5.0/24 [110/6] via 10.1.3.3, 00:00:51, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O IA     192.168.99.99 [110/7] via 10.1.3.3, 00:00:51, FastEthernet1/0
                       [110/7] via 10.1.2.2, 00:00:51, FastEthernet0/0

エリア外のコストを変更。O+IAの合計が小さいR3経由の勝ち。
[R1]—–(5)—–[R2]—–(2)—–[R4](1)
[R1]—–(1)—–[R3]—–(5)—–[R5](1)

R2(config)#int fa1/0
R2(config-if)#ip os cost 2
R2(config-if)#

R1#sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/6] via 10.1.2.2, 00:08:31, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:40:37, FastEthernet1/0
O IA     10.0.0.4/32 [110/8] via 10.1.2.2, 00:00:25, FastEthernet0/0
O IA     10.0.0.5/32 [110/7] via 10.1.3.3, 00:03:14, FastEthernet1/0
O IA     10.2.4.0/24 [110/7] via 10.1.2.2, 00:00:25, FastEthernet0/0
O IA     10.3.5.0/24 [110/6] via 10.1.3.3, 00:03:14, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O IA     192.168.99.99 [110/7] via 10.1.3.3, 00:03:14, FastEthernet1/0

 

E1 vs E1 (N1 vs N1)

O+IA+E1(N1)コストの小さいほうを優先

一度全て戻す。

R1#sh ip os int b | inc Fa
Fa1/0        1     0               10.1.3.1/24        1     BDR   1/1
Fa0/0        1     0               10.1.2.1/24        1     BDR   1/1

R2#sh ip os int b | inc Fa
Fa0/0        1     0               10.1.2.2/24        1     DR    1/1
Fa1/0        1     24              10.2.4.2/24        1     BDR   1/1

R3#sh ip os int b | inc Fa
Fa0/0        1     0               10.1.3.3/24        1     DR    1/1
Fa1/0        1     35              10.3.5.3/24        1     BDR   1/1

R4#sh ip os int b | inc Fa
Fa0/0        1     24              10.2.4.4/24        1     DR    1/1

R5#sh ip os int b | inc Fa
Fa0/0        1     35              10.3.5.5/24        1     DR    1/1

R4とR5でLoopback192を外部経路として再配送、タイプ1のコストはデフォルト。E1同士はO+IA+E1の小さいほうなので引き分け。
[R1]—–(1)—–[R2]—–(1)—–[R4](Type1 20)
[R1]—–(1)—–[R3]—–(1)—–[R5](Type1 20)

R4(config)#route-map CON-INTO-OSPF permit 10
R4(config-route-map)#match int lo 192
R4(config-route-map)#
R4(config-route-map)#router os 1
R4(config-router)#redist con route-map CON-INTO-OSPF sub metric-type 1
R4(config-router)#

R5(config)#route-map CON-INTO-OSPF permit 10
R5(config-route-map)#match int lo 192
R5(config-route-map)#
R5(config-route-map)#router os 1
R5(config-router)#redist con route-map CON-INTO-OSPF sub metric-type 1
R5(config-router)#

R1#sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/2] via 10.1.2.2, 00:09:33, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:09:38, FastEthernet1/0
O IA     10.0.0.4/32 [110/3] via 10.1.2.2, 00:09:31, FastEthernet0/0
O IA     10.0.0.5/32 [110/3] via 10.1.3.3, 00:09:28, FastEthernet1/0
O IA     10.2.4.0/24 [110/2] via 10.1.2.2, 00:09:33, FastEthernet0/0
O IA     10.3.5.0/24 [110/2] via 10.1.3.3, 00:09:38, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O E1     192.168.99.99 [110/22] via 10.1.3.3, 00:02:21, FastEthernet1/0
                       [110/22] via 10.1.2.2, 00:02:45, FastEthernet0/0

外部ドメインコストを変更、OSPFドメインコストは同じなので、外部ドメインコストの小さいR2経由の勝ち。
[R1]—–(1)—–[R2]—–(1)—–[R4](Type1 10)
[R1]—–(1)—–[R3]—–(1)—–[R5](Type1 20)

R4(config-router)#redist con route-map CON-INTO-OSPF sub metric-type 1
R4(config-router)#
R4(config-router)#$route-map CON-INTO-OSPF sub metric-type 1 metric 10
R4(config-router)#

R1#sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/2] via 10.1.2.2, 00:13:25, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:13:30, FastEthernet1/0
O IA     10.0.0.4/32 [110/3] via 10.1.2.2, 00:13:23, FastEthernet0/0
O IA     10.0.0.5/32 [110/3] via 10.1.3.3, 00:13:20, FastEthernet1/0
O IA     10.2.4.0/24 [110/2] via 10.1.2.2, 00:13:25, FastEthernet0/0
O IA     10.3.5.0/24 [110/2] via 10.1.3.3, 00:13:30, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O E1     192.168.99.99 [110/12] via 10.1.2.2, 00:01:11, FastEthernet0/0

エリア間コストを変更、O+IA+E1の合計値が同じなので引き分け。
[R1]—–(1)—–[R2]—–(11)—–[R4](Type1 10)
[R1]—–(1)—–[R3]—–( 1)—–[R5](Type1 20)

R2(config)#int fa1/0
R2(config-if)#ip os cost 11
R2(config-if)#

R1#sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/2] via 10.1.2.2, 00:16:28, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:16:33, FastEthernet1/0
O IA     10.0.0.4/32 [110/13] via 10.1.2.2, 00:00:54, FastEthernet0/0
O IA     10.0.0.5/32 [110/3] via 10.1.3.3, 00:01:24, FastEthernet1/0
O IA     10.2.4.0/24 [110/12] via 10.1.2.2, 00:00:54, FastEthernet0/0
O IA     10.3.5.0/24 [110/2] via 10.1.3.3, 00:01:24, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O E1     192.168.99.99 [110/22] via 10.1.3.3, 00:00:49, FastEthernet1/0
                       [110/22] via 10.1.2.2, 00:00:49, FastEthernet0/0

エリア間コストを戻し、エリア内コストを変更。O+IA+E1の合計値が同じなので引き分け。
[R1]—–(11)—–[R2]—–(1)—–[R4](Type1 10)
[R1]—–( 1)—–[R3]—–(1)—–[R5](Type1 20)

R2(config)#int fa1/0
R2(config-if)#ip os cost 11
R2(config-if)#ip os cost 1
R2(config-if)#

R1(config)#int fa0/0
R1(config-if)#ip os cost 11
R1(config-if)#
R1(config-if)#do sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/12] via 10.1.2.2, 00:00:31, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:19:32, FastEthernet1/0
O IA     10.0.0.4/32 [110/13] via 10.1.2.2, 00:00:31, FastEthernet0/0
O IA     10.0.0.5/32 [110/3] via 10.1.3.3, 00:04:23, FastEthernet1/0
O IA     10.2.4.0/24 [110/12] via 10.1.2.2, 00:00:31, FastEthernet0/0
O IA     10.3.5.0/24 [110/2] via 10.1.3.3, 00:04:23, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O E1     192.168.99.99 [110/22] via 10.1.3.3, 00:00:31, FastEthernet1/0
                       [110/22] via 10.1.2.2, 00:00:31, FastEthernet0/0

 

E2 vs E2 (N2 vs N2)

2つの外部ドメインコストが異なる場合

OSPFドメインコストに関係なく、外部ドメインコストの小さいほうを優先する。外部ドメインコストが同じ場合、OSPFドメインコスト(O+IA)の小さいほうを優先する。
[R1]—–(1)—–[R2]—–(1)—–[R4](Type2 20)
[R1]—–(1)—–[R3]—–(1)—–[R5](Type2 20)

一度全て戻す。

R1#sh ip os int b | inc Fa
Fa1/0        1     0               10.1.3.1/24        1     BDR   1/1
Fa0/0        1     0               10.1.2.1/24        1     BDR   1/1

R2#sh ip os int b | inc Fa
Fa0/0        1     0               10.1.2.2/24        1     DR    1/1
Fa1/0        1     24              10.2.4.2/24        1     BDR   1/1

R3#sh ip os int b | inc Fa
Fa0/0        1     0               10.1.3.3/24        1     DR    1/1
Fa1/0        1     35              10.3.5.3/24        1     BDR   1/1

R4#sh ip os int b | inc Fa
Fa0/0        1     24              10.2.4.4/24        1     DR    1/1
R4#sh run | sec ospf
 ip ospf 1 area 24
 ip ospf 1 area 24
router ospf 1
 router-id 10.0.0.4

R5#sh ip os int b | inc Fa
Fa0/0        1     35              10.3.5.5/24        1     DR    1/1
R5#sh run | sec ospf
 ip ospf 1 area 35
 ip ospf 1 area 35
router ospf 1
 router-id 10.0.0.5

R4とR5でLoopback192を外部経路として再配送、タイプ2のコストはデフォルト。E2同士はOSPFドメインコストに関係なく、外部ドメインコストを比較する。同じ場合はOSPFドメインコストを比較するので引き分け。
[R1]—–(1)—–[R2]—–(1)—–[R4](Type2 20)
[R1]—–(1)—–[R3]—–(1)—–[R5](Type2 20)

R4(config)#route-map CON-INTO-OSPF permit 10
R4(config-route-map)#match int lo 192
R4(config-route-map)#router os 1
R4(config-router)#redist con route-map CON-INTO-OSPF sub metric-type 2
R4(config-router)#

R5(config)#route-map CON-INTO-OSPF permit 10
R5(config-route-map)#match int lo 192
R5(config-route-map)#router os 1
R5(config-router)#redist con route-map CON-INTO-OSPF sub metric-type 2
R5(config-router)

R1#sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/2] via 10.1.2.2, 00:08:21, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:08:16, FastEthernet1/0
O IA     10.0.0.4/32 [110/3] via 10.1.2.2, 00:08:21, FastEthernet0/0
O IA     10.0.0.5/32 [110/3] via 10.1.3.3, 00:08:14, FastEthernet1/0
O IA     10.2.4.0/24 [110/2] via 10.1.2.2, 00:08:21, FastEthernet0/0
O IA     10.3.5.0/24 [110/2] via 10.1.3.3, 00:08:16, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O E2     192.168.99.99 [110/20] via 10.1.3.3, 00:00:44, FastEthernet1/0
                       [110/20] via 10.1.2.2, 00:01:01, FastEthernet0/0

外部ドメインコストを変更、外部ドメインコストの小さいR2経由の勝ち。
[R1]—–(1)—–[R2]—–(1)—–[R4](Type2 10)
[R1]—–(1)—–[R3]—–(1)—–[R5](Type2 20)

R4(config-router)#redist con route-map CON-INTO-OSPF sub metric-type 2
R4(config-router)#
R4(config-router)#$route-map CON-INTO-OSPF sub metric-type 2 metric 10
R4(config-router)#

R1#sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/2] via 10.1.2.2, 00:11:58, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:11:53, FastEthernet1/0
O IA     10.0.0.4/32 [110/3] via 10.1.2.2, 00:11:58, FastEthernet0/0
O IA     10.0.0.5/32 [110/3] via 10.1.3.3, 00:11:51, FastEthernet1/0
O IA     10.2.4.0/24 [110/2] via 10.1.2.2, 00:11:58, FastEthernet0/0
O IA     10.3.5.0/24 [110/2] via 10.1.3.3, 00:11:53, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O E2     192.168.99.99 [110/10] via 10.1.2.2, 00:00:34, FastEthernet0/0

エリア間コストを変更、OSPFドメインに関係なく、外部ドメインコストの小さいR2経由の勝ち。
[R1]—–(1)—–[R2]—–(50)—–[R4](Type2 10)
[R1]—–(1)—–[R3]—–( 1)—–[R5](Type2 20)

R2(config)#int fa1/0
R2(config-if)#ip os cost 50
R2(config-if)#

R1#sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/2] via 10.1.2.2, 00:13:56, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:13:51, FastEthernet1/0
O IA     10.0.0.4/32 [110/52] via 10.1.2.2, 00:00:23, FastEthernet0/0
O IA     10.0.0.5/32 [110/3] via 10.1.3.3, 00:13:49, FastEthernet1/0
O IA     10.2.4.0/24 [110/51] via 10.1.2.2, 00:00:23, FastEthernet0/0
O IA     10.3.5.0/24 [110/2] via 10.1.3.3, 00:13:51, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O E2     192.168.99.99 [110/10] via 10.1.2.2, 00:02:32, FastEthernet0/0

エリア間コストを戻し、エリア内コストを変更。OSPFドメインに関係なく、外部ドメインコストの小さいR2経由の勝ち。
[R1]—–(50)—–[R2]—–(1)—–[R4](Type2 10)
[R1]—–( 1)—–[R3]—–(1)—–[R5](Type2 20)

R2(config)#int fa1/0
R2(config-if)#ip os cost 50
R2(config-if)#
R2(config-if)#ip os cost 1
R2(config-if)#

R1(config)#int fa0/0
R1(config-if)#ip os cost 50
R1(config-if)#
R1(config-if)#do sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/51] via 10.1.2.2, 00:00:02, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:16:21, FastEthernet1/0
O IA     10.0.0.4/32 [110/52] via 10.1.2.2, 00:00:02, FastEthernet0/0
O IA     10.0.0.5/32 [110/3] via 10.1.3.3, 00:16:19, FastEthernet1/0
O IA     10.2.4.0/24 [110/51] via 10.1.2.2, 00:00:02, FastEthernet0/0
O IA     10.3.5.0/24 [110/2] via 10.1.3.3, 00:16:21, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O E2     192.168.99.99 [110/10] via 10.1.2.2, 00:05:02, FastEthernet0/0

エリア内コスト、外部ドメインコストを戻す。
[R1]—–(1)—–[R2]—–(1)—–[R4](Type2 20)
[R1]—–(1)—–[R3]—–(1)—–[R5](Type2 20)

R4(config-router)#$route-map CON-INTO-OSPF sub metric-type 2 metric 10
R4(config-router)#
R4(config-router)#$route-map CON-INTO-OSPF sub metric-type 2 metric 20
R4(config-router)#

R1(config-if)#int fa0/0
R1(config-if)#ip os cost 1
R1(config-if)#
R1(config-if)#do sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/2] via 10.1.2.2, 00:01:36, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:20:27, FastEthernet1/0
O IA     10.0.0.4/32 [110/3] via 10.1.2.2, 00:01:36, FastEthernet0/0
O IA     10.0.0.5/32 [110/3] via 10.1.3.3, 00:20:25, FastEthernet1/0
O IA     10.2.4.0/24 [110/2] via 10.1.2.2, 00:01:36, FastEthernet0/0
O IA     10.3.5.0/24 [110/2] via 10.1.3.3, 00:20:27, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O E2     192.168.99.99 [110/20] via 10.1.3.3, 00:01:14, FastEthernet1/0
                       [110/20] via 10.1.2.2, 00:01:14, FastEthernet0/0

 

2つの外部ドメインコストが同じ場合

エリア間コストを変更、外部ドメインコストが同じなので、OSPFドメイン(O+IA)の小さいR3経由の勝ち。
[R1]—–(1)—–[R2]—–(50)—–[R4](Type2 20)
[R1]—–(1)—–[R3]—–( 1)—–[R5](Type2 20)

R2(config)#int fa1/0
R2(config-if)#ip os cost 50
R2(config-if)#

R1#sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/2] via 10.1.2.2, 00:05:13, FastEthernet0/0
O        10.0.0.3/32 [110/2] via 10.1.3.3, 00:24:04, FastEthernet1/0
O IA     10.0.0.4/32 [110/52] via 10.1.2.2, 00:01:27, FastEthernet0/0
O IA     10.0.0.5/32 [110/3] via 10.1.3.3, 00:24:02, FastEthernet1/0
O IA     10.2.4.0/24 [110/51] via 10.1.2.2, 00:01:27, FastEthernet0/0
O IA     10.3.5.0/24 [110/2] via 10.1.3.3, 00:24:04, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O E2     192.168.99.99 [110/20] via 10.1.3.3, 00:04:51, FastEthernet1/0

OSPFは外部ドメインコストが同じ場合、より早くOSPFドメインを出ていける経路(Forwarding Address までのコストが小さいほう)が勝つ。しかし、Forwarding Addressが0.0.0.0でセットされている場合はAdvertising Routerまでのコストを比較する。

R1#sh ip os data ex 192.168.99.99

            OSPF Router with ID (10.0.0.1) (Process ID 1)

                Type-5 AS External Link States

  LS age: 445
  Options: (No TOS-capability, DC, Upward)
  LS Type: AS External Link
  Link State ID: 192.168.99.99 (External Network Number )
  Advertising Router: 10.0.0.4
  LS Seq Number: 80000003
  Checksum: 0x98C7
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        MTID: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 0

  Routing Bit Set on this LSA in topology Base with MTID 0
  LS age: 1155
  Options: (No TOS-capability, DC, Upward)
  LS Type: AS External Link
  Link State ID: 192.168.99.99 (External Network Number )
  Advertising Router: 10.0.0.5
  LS Seq Number: 80000001
  Checksum: 0x96CA
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        MTID: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 0

Advertising Router(10.0.0.4 と 10.0.0.5)までのコストを確認。コストはこうなっているので、10.0.0.5が近いと分かる。
[R1]—–(1)—–[R2]—–(50)—–[R4](Type2 20)
[R1]—–(1)—–[R3]—–( 1)—–[R5](Type2 20)

R1#sh ip os border | b Internal
Internal Router Routing Table
Codes: i - Intra-area route, I - Inter-area route

i 10.0.0.3 [1] via 10.1.3.3, FastEthernet1/0, ABR, Area 0, SPF 5
i 10.0.0.2 [1] via 10.1.2.2, FastEthernet0/0, ABR, Area 0, SPF 5
I 10.0.0.5 [2] via 10.1.3.3, FastEthernet1/0, ASBR, Area 0, SPF 5
I 10.0.0.4 [51] via 10.1.2.2, FastEthernet0/0, ASBR, Area 0, SPF 5

エリア間コストをそのままでエリア内コストを変更、OSPFドメイン内外のコストが同じなので引き分け。
[R1]—–( 1)—–[R2]—–(50)—–[R4](Type2 20)
[R1]—–(50)—–[R3]—–( 1)—–[R5](Type2 20)

R1(config)#int fa1/0
R1(config-if)#ip os cost 50
R1(config-if)#
R1(config-if)#do sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/2] via 10.1.2.2, 00:21:11, FastEthernet0/0
O        10.0.0.3/32 [110/51] via 10.1.3.3, 00:00:51, FastEthernet1/0
O IA     10.0.0.4/32 [110/52] via 10.1.2.2, 00:17:25, FastEthernet0/0
O IA     10.0.0.5/32 [110/52] via 10.1.3.3, 00:00:51, FastEthernet1/0
O IA     10.2.4.0/24 [110/51] via 10.1.2.2, 00:17:25, FastEthernet0/0
O IA     10.3.5.0/24 [110/51] via 10.1.3.3, 00:00:51, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O E2     192.168.99.99 [110/20] via 10.1.3.3, 00:20:49, FastEthernet1/0
                       [110/20] via 10.1.2.2, 00:00:51, FastEthernet0/0
R1(config-if)#
R1(config-if)#do sh ip os border | b Internal
Internal Router Routing Table
Codes: i - Intra-area route, I - Inter-area route

i 10.0.0.3 [50] via 10.1.3.3, FastEthernet1/0, ABR, Area 0, SPF 6
i 10.0.0.2 [1] via 10.1.2.2, FastEthernet0/0, ABR, Area 0, SPF 6
I 10.0.0.5 [51] via 10.1.3.3, FastEthernet1/0, ASBR, Area 0, SPF 6
I 10.0.0.4 [51] via 10.1.2.2, FastEthernet0/0, ASBR, Area 0, SPF 6
R1(config-if)#

エリア間コストを戻し、エリア内コストはそのまま。エリア内の近いR2経由の勝ち。
[R1]—–( 1)—–[R2]—–(1)—–[R4](Type2 20)
[R1]—–(50)—–[R3]—–(1)—–[R5](Type2 20)

R2(config)#int fa1/0
R2(config-if)#ip os cost 50
R2(config-if)#
R2(config-if)#ip os cost 1
R2(config-if)#

R1#sh ip ro os | b Gate
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O        10.0.0.2/32 [110/2] via 10.1.2.2, 00:26:32, FastEthernet0/0
O        10.0.0.3/32 [110/51] via 10.1.3.3, 00:06:12, FastEthernet1/0
O IA     10.0.0.4/32 [110/3] via 10.1.2.2, 00:00:38, FastEthernet0/0
O IA     10.0.0.5/32 [110/52] via 10.1.3.3, 00:06:12, FastEthernet1/0
O IA     10.2.4.0/24 [110/2] via 10.1.2.2, 00:00:38, FastEthernet0/0
O IA     10.3.5.0/24 [110/51] via 10.1.3.3, 00:06:12, FastEthernet1/0
      192.168.99.0/32 is subnetted, 1 subnets
O E2     192.168.99.99 [110/20] via 10.1.2.2, 00:06:12, FastEthernet0/0
R1#
R1#sh ip os border | b Internal
Internal Router Routing Table
Codes: i - Intra-area route, I - Inter-area route

i 10.0.0.3 [50] via 10.1.3.3, FastEthernet1/0, ABR, Area 0, SPF 6
i 10.0.0.2 [1] via 10.1.2.2, FastEthernet0/0, ABR, Area 0, SPF 6
I 10.0.0.5 [51] via 10.1.3.3, FastEthernet1/0, ASBR, Area 0, SPF 6
I 10.0.0.4 [2] via 10.1.2.2, FastEthernet0/0, ASBR, Area 0, SPF 6

 

DIAGRAM

 

 

 

CONFIGURATION

hostname R1
!
interface Loopback0
 ip address 10.0.0.1 255.255.255.255
 ip ospf 1 area 0
!
interface FastEthernet0/0
 ip address 10.1.2.1 255.255.255.0
 ip ospf 1 area 0
 no shutdown
!
interface FastEthernet1/0
 ip address 10.1.3.1 255.255.255.0
 ip ospf 1 area 0
 no shutdown
!
router ospf 1
 router-id 10.0.0.1
!
end
hostname R2
!
interface Loopback0
 ip address 10.0.0.2 255.255.255.255
 ip ospf 1 area 0
!
interface Loopback192
 ip address 192.168.99.99 255.255.255.255
!
interface FastEthernet0/0
 ip address 10.1.2.2 255.255.255.0
 ip ospf 1 area 0
 no shutdown
!
interface FastEthernet1/0
 ip address 10.2.4.2 255.255.255.0
 ip ospf 1 area 24
 no shutdown
!
router ospf 1
 router-id 10.0.0.2
!
end
hostname R3
!
interface Loopback0
 ip address 10.0.0.3 255.255.255.255
 ip ospf 1 area 0
!
interface Loopback192
 ip address 192.168.99.99 255.255.255.255
!
interface FastEthernet0/0
 ip address 10.1.3.3 255.255.255.0
 ip ospf 1 area 0
 no shutdown
!
interface FastEthernet1/0
 ip address 10.3.5.3 255.255.255.0
 ip ospf 1 area 35
 no shutdown
!
router ospf 1
 router-id 10.0.0.3
!
end
hostname R4
!
interface Loopback0
 ip address 10.0.0.4 255.255.255.255
 ip ospf 1 area 24
!
interface Loopback192
 ip address 192.168.99.99 255.255.255.255
!
interface FastEthernet0/0
 ip address 10.2.4.4 255.255.255.0
 ip ospf 1 area 24
 no shutdown
!
interface FastEthernet1/0
 no ip address
 shutdown
!
router ospf 1
 router-id 10.0.0.4
!
end
hostname R5
!
interface Loopback0
 ip address 10.0.0.5 255.255.255.255
 ip ospf 1 area 35
!
interface Loopback192
 ip address 192.168.99.99 255.255.255.255
!
interface FastEthernet0/0
 ip address 10.3.5.5 255.255.255.0
 ip ospf 1 area 35
 no shutdown
!
interface FastEthernet1/0
 no ip address
 shutdown
!
router ospf 1
 router-id 10.0.0.5
!
end

 

REFERENCE

 

 

コメント