【OSPF】マルチエリア設定

 エリア0はバックボーンエリアと呼ばれ、OSPFを使用する際は、通常、このバックボーンエリアに全てのルータを属させる(シングルエリア)構成が実務上では一般的です。 ただし、設計上や拡張性などの理由によりマルチエリア構成にすることもよくあります。
 複数エリアある場合、バックボーンエリア以外のエリアは必ず、バックボーンエリア(Area0)に直接面している必要があります。ここでは、マルチエリア構成の設定を見ていきます。

スポンサーリンク

マルチエリアの設定

 OSPFを有効にするインタフェースと所属するエリアをnetworkコマンドで設定します。

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
スポンサーリンク

状態確認

 では、OSPFのネイバー状態を確認します。

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# 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# 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# 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 で確認できます。

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のルーティングテーブルを確認します。 自身が持つエリアのルート(エリア内ルート)は、O 、自エリア外のルート(エリア間ルート)はO IA で表されます。

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のルーティングテーブルを確認すると、Area0、Area34の経路がエリア間ルートとしてO IA で表されます。

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

 R1からR4への疎通もできました。

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

コメント