今回はOSPFのStub Areaについて解説します。
座学
Stub Area
下図の様に、OSPFに再配送されたルート情報は、全てのAreaに広報されます。ここで、Area 2に存在するR3の視点から見ると、OSPFに再配送された180.1.1.0/24と180.2.2.0/24にはABRであるR2を経由することで到達可能です。
Stub Areaと呼ばれる機能を使用することで、ABRはStub Areaに対しては再配送されたルート情報が格納されたLSA Type 5やASBRのRouter IDを格納したLSA Type 4は広報せず、代わりに、Sutb Areaに対してはデフォルトルートを格納したLSA Type 3を広報します。Stub AreaはArea 0のBackbone Area以外で使用可能です。
下図の様に、R2はArea 2に対して180.1.1.0/24と180.2.2.0/24を格納したLSA Type 5は広報せず、デフォルトルートを格納したLSA Type 3が広報されます。R3はLSA Type 3経由で学習したデフォルトルートを使用することで、180.1.1.0/24を180.2.2.0/24に到達可能です。
E bit
Stub Areaでは外部ルートであるLSA Type 5は未サポートなので、Stub Areaに所属するルータが送信するHelloパケットのE(External) bitには0がセットされます。ルータ間でOptionのE bitの値が異なる場合、ネイバーは確立できません(こちらの記事で解説しています。)。
実機での動作確認
検証内容
R1のg2、R2のg2でOSPF Area 0を有効にします。
R2のg3、R3のg2でOSPF Area 2を有効にします。
Network TypeにはPoint-to-Pointを使用します。
R1でOSPFに対してConnected Routeである180.1.1.0/24を再配送します。
Area 2でStub Areaを有効化した際の状態を確認します。
初期設定
interface GigabitEthernet2
ip address 10.1.1.1 255.255.255.0
ip ospf network point-to-point
!
interface GigabitEthernet3
ip address 180.1.1.1 255.255.255.0
!
router ospf 1
router-id 1.1.1.1
redistribute connected subnets
network 10.1.1.0 0.0.0.255 area 0
interface GigabitEthernet2
ip address 10.1.1.2 255.255.255.0
ip ospf network point-to-point
!
interface GigabitEthernet3
ip address 20.1.1.2 255.255.255.0
ip ospf network point-to-point
!
router ospf 1
router-id 2.2.2.2
network 10.1.1.0 0.0.0.255 area 0
network 20.1.1.0 0.0.0.255 area 2
interface GigabitEthernet2
ip address 20.1.1.3 255.255.255.0
ip ospf network point-to-point
!
router ospf 1
router-id 3.3.3.3
network 20.1.1.0 0.0.0.255 area 2
Stub Area設定前
OSPFプロセスの状態確認
R2において、Stub Areaが無効なことが確認できます。
R2#show ip ospf
Routing Process "ospf 1" with ID 2.2.2.2
Start time: 2w0d, Time elapsed: 00:42:55.591
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Supports NSSA (compatible with RFC 3101)
Supports Database Exchange Summary List Optimization (RFC 5243)
Event-log enabled, Maximum number of events: 1000, Mode: cyclic
It is an area border router
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 50 msecs
Minimum hold time between two consecutive SPFs 200 msecs
Maximum wait time between two consecutive SPFs 5000 msecs
Incremental-SPF disabled
Initial LSA throttle delay 50 msecs
Minimum hold time for LSA throttle 200 msecs
Maximum wait time for LSA throttle 5000 msecs
Minimum LSA arrival 100 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
EXCHANGE/LOADING adjacency limit: initial 300, process maximum 300
Number of external LSA 1. Checksum Sum 0x008560
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 2. 2 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
IETF NSF helper support enabled
Cisco NSF helper support enabled
Reference bandwidth unit is 100 mbps
Area BACKBONE(0)
Number of interfaces in this area is 1
Area has no authentication
SPF algorithm last executed 00:05:42.738 ago
SPF algorithm executed 4 times
Area ranges are
Number of LSA 3. Checksum Sum 0x01956C
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Area 2
Number of interfaces in this area is 1
Area has no authentication
SPF algorithm last executed 00:16:09.432 ago
SPF algorithm executed 5 times
Area ranges are
Number of LSA 4. Checksum Sum 0x024AAD
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Helloパケットの確認
R2が送信したHelloパケットのE bitに1がセットされていることが確認できます。
OSPFネイバーの状態確認
R2が送信したHelloパケットのE bitに1がセットされていることが確認できます。
R3#show ip ospf neighbor 2.2.2.2 detail
Neighbor 2.2.2.2, interface address 20.1.1.2, interface-id 7
In the area 2 via interface GigabitEthernet2
Neighbor priority is 0, State is FULL, 6 state changes
DR is 0.0.0.0 BDR is 0.0.0.0
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:37
Neighbor is up for 00:41:41
Index 1/1/1, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
LSDBの状態確認
R2はArea 2に対して10.1.1.0/24を格納したLSA Type 3、180.1.1.0/24を格納したLSA Type 5、ASBRであるR1のRouter IDを格納したLSA Type 4を広報していることが確認できます。
R3#show ip ospf database
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 521 0x80000005 0x00EBE7 2
3.3.3.3 3.3.3.3 476 0x80000005 0x008847 2
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
10.1.1.0 2.2.2.2 521 0x80000002 0x00BB6B
Summary ASB Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 2.2.2.2 325 0x80000001 0x001B14
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
180.1.1.0 1.1.1.1 314 0x80000001 0x008560 0
SPFの計算結果の確認
R3は10.1.1.0/24と180.1.1.0/24を認識していることが確認できます。
R3#show ip ospf rib
OSPF Router with ID (3.3.3.3) (Process ID 1)
Base Topology (MTID 0)
OSPF local RIB
Codes: * - Best, > - Installed in global RIB
*> 10.1.1.0/24, Inter, cost 2, area 2
via 20.1.1.2, GigabitEthernet2
* 20.1.1.0/24, Intra, cost 1, area 2, Connected
via 20.1.1.3, GigabitEthernet2
*> 180.1.1.0/24, Ext2, cost 20, fwd cost 2, tag 0
via 20.1.1.2, GigabitEthernet2
ルーティングテーブルの確認
R3のルーティングテーブルに10.1.1.0/24と180.1.1.0/24が投入されていることが確認できます。
R3#show ip route ospf
10.0.0.0/24 is subnetted, 1 subnets
O IA 10.1.1.0 [110/2] via 20.1.1.2, 00:41:57, GigabitEthernet2
180.1.0.0/24 is subnetted, 1 subnets
O E2 180.1.1.0 [110/20] via 20.1.1.2, 00:06:29, GigabitEthernet2
疎通確認
R3の20.1.1.3からR1の10.1.1.1と180.1.1.1へのPingが成功することが確認できます。
R3#ping 10.1.1.1 source 20.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 20.1.1.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R3#ping 180.1.1.1 source 20.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 180.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 20.1.1.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Stub Area設定後(default-costコマンド無し)
Area 2でStub Areaを有効にします。
追加した設定
Stub Areaはarea <area-id> stubコマンドで有効化可能です。
今回はR2とR3において、Area 2でStub Areaを有効化します。
router ospf 1
area 2 stub
OSPFプロセスの状態確認
R2において、Area 2でStub Areaが有効なことが確認できます。
R2#show ip ospf
Routing Process "ospf 1" with ID 2.2.2.2
Start time: 2w0d, Time elapsed: 00:53:10.071
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Supports NSSA (compatible with RFC 3101)
Supports Database Exchange Summary List Optimization (RFC 5243)
Event-log enabled, Maximum number of events: 1000, Mode: cyclic
It is an area border router
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 50 msecs
Minimum hold time between two consecutive SPFs 200 msecs
Maximum wait time between two consecutive SPFs 5000 msecs
Incremental-SPF disabled
Initial LSA throttle delay 50 msecs
Minimum hold time for LSA throttle 200 msecs
Maximum wait time for LSA throttle 5000 msecs
Minimum LSA arrival 100 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
EXCHANGE/LOADING adjacency limit: initial 300, process maximum 300
Number of external LSA 1. Checksum Sum 0x008560
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 2. 1 normal 1 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
IETF NSF helper support enabled
Cisco NSF helper support enabled
Reference bandwidth unit is 100 mbps
Area BACKBONE(0)
Number of interfaces in this area is 1
Area has no authentication
SPF algorithm last executed 00:05:55.908 ago
SPF algorithm executed 9 times
Area ranges are
Number of LSA 3. Checksum Sum 0x01956C
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Area 2
Number of interfaces in this area is 1
It is a stub area
Generates stub default route with cost 1
Area has no authentication
SPF algorithm last executed 00:05:54.451 ago
SPF algorithm executed 16 times
Area ranges are
Number of LSA 4. Checksum Sum 0x02CF1D
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Helloパケットの確認
R2が送信したHelloパケットのE bitに0がセットされていることが確認できます。
OSPFネイバーの状態確認
R2が送信したHelloパケットのE bitに0がセットされていることが確認できます。
R3#show ip ospf neighbor 2.2.2.2 detail
Neighbor 2.2.2.2, interface address 20.1.1.2, interface-id 7
In the area 2 via interface GigabitEthernet2
Neighbor priority is 0, State is FULL, 6 state changes
DR is 0.0.0.0 BDR is 0.0.0.0
Options is 0x12 in Hello (L-bit) <-- E-bitが表示されていない
Options is 0x52 in DBD (L-bit, O-bit) <-- E-bitが表示されていない
LLS Options is 0x1 (LR)
Dead timer due in 00:00:37
Neighbor is up for 00:41:41
Index 1/1/1, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
LSDBの状態確認
R2はArea 2に対して180.1.1.0/24を格納したLSA Type 5、ASBRであるR1のRouter IDを格納したLSA Type 4を広報せず、代わりに、0.0.0.0/0を格納したLSA Type 3を広報していることが確認できます。
R3#show ip ospf database
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 209 0x8000000D 0x00F9D3 2
3.3.3.3 3.3.3.3 38 0x80000010 0x009036 2
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 210 0x80000001 0x0075C0
10.1.1.0 2.2.2.2 210 0x80000007 0x00CF54
以下はStub AreaによってR2がArea 2に広報した0.0.0.0/0を格納したLSA Type 3になります。デフォルトでCostには1が格納されます。
R3#show ip ospf database summary 0.0.0.0 adv-router 2.2.2.2
OSPF Router with ID (3.3.3.3) (Process ID 1)
Summary Net Link States (Area 2)
LS age: 236
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 0.0.0.0 (summary Network Number)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x75C0
Length: 28
Network Mask: /0
MTID: 0 Metric: 1
SPFの計算結果の確認
R3は10.1.1.0/24と0.0.0.0/0を認識していることが確認できます。
R3#show ip ospf rib
OSPF Router with ID (3.3.3.3) (Process ID 1)
Base Topology (MTID 0)
OSPF local RIB
Codes: * - Best, > - Installed in global RIB
*> 10.1.1.0/24, Inter, cost 2, area 2
via 20.1.1.2, GigabitEthernet2
* 20.1.1.0/24, Intra, cost 1, area 2, Connected
via 20.1.1.3, GigabitEthernet2
*> 0.0.0.0/0, Inter, cost 2, area 2
via 20.1.1.2, GigabitEthernet2
ルーティングテーブルの確認
R3のルーティングテーブルに10.1.1.0/24と0.0.0.0/0が投入されていることが確認できます。
R3#show ip route ospf
O*IA 0.0.0.0/0 [110/2] via 20.1.1.2, 00:04:43, GigabitEthernet2
10.0.0.0/24 is subnetted, 1 subnets
O IA 10.1.1.0 [110/2] via 20.1.1.2, 00:04:43, GigabitEthernet2
疎通確認
R3の20.1.1.3からR1の10.1.1.1と180.1.1.1へのPingが成功することが確認できます。
R3#ping 10.1.1.1 source 20.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 20.1.1.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R3#ping 180.1.1.1 source 20.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 180.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 20.1.1.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
補足
Stub Areaのルータで再配送を試みた際の様子
R3(config-router)#redistribute connected
*May 28 08:36:29.064: %OSPF-4-ASBR_WITHOUT_VALID_AREA: Router is currently an ASBR while having only one area which is a stub area
Area 0でStub Areaの有効化を試みた際の様子
R1(config-router)#area 0 stub
% OSPF: Backbone can not be configured as stub area
Stub Areaが有効なルータがE bitに1がセットされたHelloパケットを受信した際の様子
R1#debug ip ospf hello
*May 3 06:04:51.755: OSPF-1 HELLO Gi2: Rcv hello from 2.2.2.2 area 1 20.1.1.2
*May 3 06:04:51.755: OSPF-1 HELLO Gi2: Hello from 20.1.1.2 with mismatched Stub/Transit area option bit
Stub Area設定後(default-costコマンド有り)
Area 2でStub Areaを有効にします。また、R2が生成する0.0.0.0/0を格納したLSA Type 3のCostを50に変更します。
追加した設定
Stub AreaのABRが生成する0.0.0.0/0を格納したLSA Type 3のCostはarea <area-id> default-cost <cost>コマンドで指定可能です。
今回はR2が生成する0.0.0.0/0を格納したLSA Type 3のCostを50に変更します。
router ospf 1
area 2 stub
area 2 default-cost 50
router ospf 1
area 2 stub
OSPFプロセスの状態確認
R2において、Stub AreaでCost 50のデフォルトルートを生成していることが確認できます。
R2#show ip ospf
Routing Process "ospf 1" with ID 2.2.2.2
Start time: 2w0d, Time elapsed: 00:53:10.071
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Supports NSSA (compatible with RFC 3101)
Supports Database Exchange Summary List Optimization (RFC 5243)
Event-log enabled, Maximum number of events: 1000, Mode: cyclic
It is an area border router
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 50 msecs
Minimum hold time between two consecutive SPFs 200 msecs
Maximum wait time between two consecutive SPFs 5000 msecs
Incremental-SPF disabled
Initial LSA throttle delay 50 msecs
Minimum hold time for LSA throttle 200 msecs
Maximum wait time for LSA throttle 5000 msecs
Minimum LSA arrival 100 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
EXCHANGE/LOADING adjacency limit: initial 300, process maximum 300
Number of external LSA 1. Checksum Sum 0x008560
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 2. 1 normal 1 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
IETF NSF helper support enabled
Cisco NSF helper support enabled
Reference bandwidth unit is 100 mbps
Area BACKBONE(0)
Number of interfaces in this area is 1
Area has no authentication
SPF algorithm last executed 00:05:55.908 ago
SPF algorithm executed 9 times
Area ranges are
Number of LSA 3. Checksum Sum 0x01956C
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Area 2
Number of interfaces in this area is 1
It is a stub area
Generates stub default route with cost 50
Area has no authentication
SPF algorithm last executed 00:05:54.451 ago
SPF algorithm executed 16 times
Area ranges are
Number of LSA 4. Checksum Sum 0x02CF1D
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
LSDBの状態確認
R2が生成した0.0.0.0/0を格納したLSA Type 3のCostが50に変化したことが格納されます。
R3#show ip ospf database summary 0.0.0.0 adv-router 2.2.2.2
OSPF Router with ID (3.3.3.3) (Process ID 1)
Summary Net Link States (Area 2)
LS age: 236
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 0.0.0.0 (summary Network Number)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x75C0
Length: 28
Network Mask: /0
MTID: 0 Metric: 50
SPFの計算結果の確認
R3が認識している0.0.0.0/0のCostが51に変化したことが確認できます。
R3#show ip ospf rib
OSPF Router with ID (3.3.3.3) (Process ID 1)
Base Topology (MTID 0)
OSPF local RIB
Codes: * - Best, > - Installed in global RIB
*> 10.1.1.0/24, Inter, cost 2, area 2
via 20.1.1.2, GigabitEthernet2
* 20.1.1.0/24, Intra, cost 1, area 2, Connected
via 20.1.1.3, GigabitEthernet2
*> 0.0.0.0/0, Inter, cost 51, area 2
via 20.1.1.2, GigabitEthernet2
ルーティングテーブルの確認
R3のルーティングテーブル内の0.0.0.0/0のメトリックが51に変化したことが確認できます。
R3#show ip route ospf
O*IA 0.0.0.0/0 [110/2] via 20.1.1.2, 00:04:43, GigabitEthernet2
10.0.0.0/24 is subnetted, 1 subnets
O IA 10.1.1.0 [110/51] via 20.1.1.2, 00:04:43, GigabitEthernet2
コメント