OSPF のエリア0はバックボーンエリアと呼ばれます。小さなネットワークでは、すべてのルータをエリア0に入れるシングルエリアの構成で十分なことも多いですが、ルータや経路が増えると、LSDB の大きさや SPF 計算の負荷を抑えるために、エリアを分けたマルチエリアの構成にします。エリアを複数にするときは、エリア0以外のエリアは必ずエリア0に直接つながっている必要があります。この記事では、マルチエリアの設定と、経路の見え方を確かめます。
networkコマンドでインターフェースごとにエリアを割り当てる設定show ip ospf neighbor detailでネイバーのエリアを確かめる方法- エリア内経路(O)とエリア間経路(O IA)の違い
検証構成
R1–R2 間をエリア12、R2–R3 間をバックボーンのエリア0、R3–R4 間をエリア34にします。R2 と R3 は、エリア0とほかのエリアにまたがる ABR です。各ルータのループバック(1.1.1.1〜4.4.4.4)も、それぞれのエリアに入れます。
マルチエリアの設定
network コマンドでエリアを割り当てる
OSPF を有効にするインターフェースと、そのインターフェースが入るエリアを network コマンドで指定します。R2 と R3 は、インターフェースごとに違うエリアを指定します。
R1(config)# router ospf 1 R1(config-router)# network 192.168.12.0 0.0.0.255 area 12 R1(config-router)# network 1.1.1.1 0.0.0.0 area 12 R2(config)# router ospf 1 R2(config-router)# network 192.168.12.0 0.0.0.255 area 12 R2(config-router)# network 2.2.2.2 0.0.0.0 area 0 R2(config-router)# network 192.168.23.0 0.0.0.255 area 0 R3(config)# router ospf 1 R3(config-router)# network 192.168.23.0 0.0.0.255 area 0 R3(config-router)# network 3.3.3.3 0.0.0.0 area 0 R3(config-router)# network 192.168.34.0 0.0.0.255 area 34 R4(config)# router ospf 1 R4(config-router)# network 192.168.34.0 0.0.0.255 area 34 R4(config-router)# network 4.4.4.4 0.0.0.0 area 34
状態の確認
ネイバーを確認する
R1
R1# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/DR 00:00:35 192.168.12.2 FastEthernet0/0.12
R2
R2# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 3.3.3.3 1 FULL/DR 00:00:38 192.168.23.3 FastEthernet0/0.23 1.1.1.1 1 FULL/BDR 00:00:38 192.168.12.1 FastEthernet0/0.12
R3
R3# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/BDR 00:00:33 192.168.23.2 FastEthernet0/0.23 4.4.4.4 1 FULL/DR 00:00:36 192.168.34.4 FastEthernet0/0.34
R4
R4# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 3.3.3.3 1 FULL/BDR 00:00:39 192.168.34.3 FastEthernet0/0.34
たとえば R2 は、R1 と R3 をネイバーにしています。ただし、この出力からはネイバーがどのエリアかはわかりません。
ネイバーのエリアを確認する
エリアを確かめるときは、show ip ospf neighbor detail を使います。R3(3.3.3.3)とはエリア0で、R1(1.1.1.1)とはエリア12でネイバーになっています。
R2# show ip ospf neighbor detail
Neighbor 3.3.3.3, interface address 192.168.23.3
In the area 0 via interface FastEthernet0/0.23
Neighbor priority is 1, State is FULL, 6 state changes
DR is 192.168.23.3 BDR is 192.168.23.2
Options is 0x12 in Hello (E-bit, L-bit)
Options is 0x52 in DBD (E-bit, L-bit, O-bit)
LLS Options is 0x1 (LR)
Dead timer due in 00:00:30
Neighbor is up for 00:01:53
Index 1/2, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
Neighbor 1.1.1.1, interface address 192.168.12.1
In the area 12 via interface FastEthernet0/0.12
Neighbor priority is 1, State is FULL, 6 state changes
DR is 192.168.12.2 BDR is 192.168.12.1
Options is 0x12 in Hello (E-bit, L-bit)
Options is 0x52 in DBD (E-bit, L-bit, O-bit)
LLS Options is 0x1 (LR)
Dead timer due in 00:00:32
Neighbor is up for 00:09:28
Index 1/1, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
ルーティングテーブルを確認する
R2 のルーティングテーブルでは、R2 がつながっているエリア(エリア12とエリア0)の経路は O(エリア内経路)、つながっていないエリア34の経路は O IA(エリア間経路)になります。
R2
R2# show ip route ospf
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/2] via 192.168.12.1, 00:18:39, FastEthernet0/0.12
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.23.3, 00:10:57, FastEthernet0/0.23
4.0.0.0/32 is subnetted, 1 subnets
O IA 4.4.4.4 [110/3] via 192.168.23.3, 00:10:57, FastEthernet0/0.23
O IA 192.168.34.0/24 [110/2] via 192.168.23.3, 00:10:57, FastEthernet0/0.23
R1 はエリア12だけにつながっているので、エリア0とエリア34の経路はすべて O IA になります。
R1
R1# show ip route ospf
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/2] via 192.168.12.2, 00:18:39, FastEthernet0/0.12
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/3] via 192.168.12.2, 00:10:57, FastEthernet0/0.12
4.0.0.0/32 is subnetted, 1 subnets
O IA 4.4.4.4 [110/4] via 192.168.12.2, 00:10:57, FastEthernet0/0.12
O IA 192.168.23.0/24 [110/2] via 192.168.12.2, 00:12:02, FastEthernet0/0.12
O IA 192.168.34.0/24 [110/3] via 192.168.12.2, 00:10:57, FastEthernet0/0.12
| 表示 | 意味 |
|---|---|
| O | エリア内経路。自分がつながっているエリアの中の経路(LSA タイプ1・2から計算) |
| O IA | エリア間経路。ほかのエリアの経路を、ABR が LSA タイプ3にして広告したもの |
| [110/4] | R1 から 4.4.4.4 までのコスト。リンク3区間(1+1+1)とループバック(1)の合計 |
エリア34の 4.4.4.4 は、まずエリア34の中でルータ LSA(タイプ1)として伝わり、ABR の R3 がタイプ3にしてエリア0へ、さらに ABR の R2 がタイプ3にしてエリア12へ広告します。エリア間の経路は、必ずエリア0を通って伝わります。
疎通を確認する
R1 のループバックから R4 のループバックへ ping すると、疎通できます。
R1# ping 4.4.4.4 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/56/68 ms
まとめ
| 項目 | 内容 |
|---|---|
| 設定 | network コマンドで、インターフェースごとにエリアを指定する |
| ABR | エリア0とほかのエリアにまたがるルータ(ここでは R2 と R3) |
| エリアの確認 | show ip ospf neighbor detail の「In the area」 |
| 経路の表示 | つながっているエリアの経路は O、ほかのエリアの経路は O IA |
エリア0に直接つながれないエリアがあるときは、仮想リンク でエリア0につなぎます。
コメント