Cisco CMLを使用したバックボーンエリア(Area0)不在のOSPF動作の検証
あるプロジェクトでバックボーンエリア(Area0)が存在せず動作しているOSPFNWを見たことがあるため、今回は興味本位でバックボーンエリア(Area0)が存在しない場合のOSPF動作検証を行ってみる。(備忘録)
検証用NWトポロジー
コンフィグ(抜粋)
RT-1
interface Loopback0
description === R1 Test Loopback ===
ip address 1.1.1.1 255.255.255.255
ip ospf 1 area 1
!
interface Ethernet0/0
description === to R2 (Area 1) ===
ip address 10.0.12.5 255.255.255.252
ip ospf network point-to-point
ip ospf 1 area 1
!
router ospf 1
router-id 1.1.1.1
RT-2
interface Loopback0
description === R2 Test Loopback ===
ip address 2.2.2.2 255.255.255.255
ip ospf 1 area 1
!
interface Ethernet0/0
description === to R1 (Area 1) ===
ip address 10.0.12.6 255.255.255.252
ip ospf network point-to-point
ip ospf 1 area 1
!
interface Ethernet0/1
description === to R3 (Area 2) ===
ip address 10.0.23.5 255.255.255.252
ip ospf network point-to-point
ip ospf 1 area 2
!
router ospf 1
router-id 2.2.2.2
RT-3
interface Loopback0
description === R3 Test Loopback ===
ip address 3.3.3.3 255.255.255.255
ip ospf 1 area 2
!
interface Ethernet0/0
description === to R2 (Area 2) ===
ip address 10.0.23.6 255.255.255.252
ip ospf network point-to-point
ip ospf 1 area 2
!
router ospf 1
router-id 3.3.3.3
確認したいこと
1,各ルータで#show ip ospf neighborコマンドを実行してネイバーの状態を確認する。
2,RT-1のループバック0(1.1.1.1)からRT-2(2.2.2.2)とRT-3(3.3.3.3)のループバック0へpingを送信して疎通状態を確認する。
3,各ルータで#show ip ospf databaseコマンドを実行してOSPF LSAを確認する。
検証結果
1,各ルータで#show ip ospf neighborコマンドを実行してネイバーの状態を確認する。
RT-1
RT-1#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 0 FULL/ - 00:00:36 10.0.12.6 Ethernet0/0
// RT-2とネイバーを確立済み
RT-2
RT-2#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 0 FULL/ - 00:00:31 10.0.12.5 Ethernet0/0
3.3.3.3 0 FULL/ - 00:00:36 10.0.23.6 Ethernet0/1
//RT-1とRT-3両方とネイバー確立済み
RT-3
RT-3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 0 FULL/ - 00:00:39 10.0.23.5 Ethernet0/0
//RT-2とネイバー確立済み
コマンド出力結果から同一エリアのルータ同士はすべてFULLステータスでネイバー関係を結ぶことができていることがわかる。
2,RT-1のループバック0(1.1.1.1)からRT-2とRT-3のループバック0へpingを送信して疎通状態を確認する。
RT-1#ping 2.2.2.2 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, 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 = 1/1/1 ms
// RT1のループバック0からRT-2のループバック0まで疎通OK
RT-1#ping 3.3.3.3 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
.....
Success rate is 0 percent (0/5)
// RT1のループバック0からRT-3のループバック0まで疎通NG
【結果】
RT-1ループバック0からRT-3のループバック0にPING疎通できないことがわかる。
3,各ルータで#show ip ospf databaseコマンドを実行してOSPF LSAを確認する。
RT-1
RT-1#sh ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 12 0x8000000A 0x00743C 3
2.2.2.2 2.2.2.2 308 0x80000009 0x001494 3
RT-1#
RT-2
RT-2#sho ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 1735 0x80000009 0x00763B 3
2.2.2.2 2.2.2.2 36 0x80000009 0x001494 3
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 1068 0x80000004 0x007237 2
3.3.3.3 3.3.3.3 767 0x80000004 0x001292 2
RT-2#
RT-3
RT-3#sho 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 1401 0x80000004 0x007237 2
3.3.3.3 3.3.3.3 1098 0x80000004 0x001292 2
RT-3#
【結果】
コマンド結果からABRであるRT-2でLSA Type-3(summary)が生成されていないことがわかる。
LSA交換の状態はこう
[R1] [R2] [R3]
│ │ │
│── Hello ──────────→│ ← Hello ────────── │
│←── FULL ───────────│ ─── FULL ────────→ │
│ │ │
│ │ ← Type-1 LSA → │
│ ← Type-1 LSA → │ │
│ │ │
│ │ × Type-3 生成せず │
│ × Type-3 受信せず │ │ × Type-3 受信せず
まとめ
バックボーンエリア(Area0)不在のOSPF構成ではABRでLSA Type-3が生成されずエリアをまたぐ通信が破綻することが分かった。
余談)この状態から無理やり通信を成立させる方法を考えてみる。
RT-2のOSPFへ自身のコネクトルートを再配送することで通信を成立させる。
コマンド
RT-2(config)# router ospf 1
RT-2(config-router)# redistribute connected subnets metric-type 1
上記コマンドを入れたがコネクトIFがすでにOSPFに参加しているため再配送されないことが分かった。
R2 の connected IF
Eth0/0: 10.0.12.4/30 → ip ospf 1 area 1 ← OSPF に参加済み
Eth0/1: 10.0.23.4/30 → ip ospf 1 area 2 ← OSPF に参加済み
Lo0: 2.2.2.2/32 → ip ospf 1 area 1 ← OSPF に参加済み
代替案としてR2にRT-2とRT-3のループバック0向けのスタテックルートを書き、そのスタテックルートをOSPFへ注入(再配送)することで解決した。
イメージ
[R1] ←static route←[R2]→static route→ [R3]
│ Area 1 │ redistribute static │ Area 2
│ │ │
│ │ → Type-5 LSA │
│ │ 全エリアへflood │
│ │ │
│ ← E1 経路 ─────────│ ──── E1 経路 ──────────→ │
コマンド
R2(config)# ip route 3.3.3.3 255.255.255.255 10.0.23.6
R2(config)# ip route 1.1.1.1 255.255.255.255 10.0.12.5
R2(config)# router ospf 1
R2(config-router)# redistribute static subnets metric-type 1
【結果】
RT-2
RT-2#sho ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 159 0x80000005 0x00842F 3
2.2.2.2 2.2.2.2 278 0x80000007 0x001E8A 3
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 278 0x80000006 0x007431 2
3.3.3.3 3.3.3.3 191 0x80000005 0x00C4C1 3
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
1.1.1.1 2.2.2.2 278 0x80000001 0x00F91B 0
3.3.3.3 2.2.2.2 278 0x80000001 0x009D6F 0
RT-2#
//type-5が出現
RT-1> show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 1826 0x80000004 0x00862E 3
2.2.2.2 2.2.2.2 52 0x80000006 0x002089 3
RT-1>
RT-1>
RT-1> show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 1908 0x80000004 0x00862E 3
2.2.2.2 2.2.2.2 6 0x80000007 0x001E8A 3
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
1.1.1.1 2.2.2.2 6 0x80000001 0x00F91B 0
3.3.3.3 2.2.2.2 6 0x80000001 0x009D6F 0
RT-1>
//type-5が出現
RT-1
RT-1#sh ip route
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, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
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
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/11] via 10.0.12.6, 01:11:31, Ethernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O E1 3.3.3.3 [110/30] via 10.0.12.6, 00:06:03, Ethernet0/0
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.12.4/30 is directly connected, Ethernet0/0
L 10.0.12.5/32 is directly connected, Ethernet0/0
//E1で3.3.3.3を学習
RT-1#ping 3.3.3.3 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, 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 = 1/1/1 ms
RT-1#
//疎通OK
エリア0を設定せずに再配送で通信させる方法は極力やらない方がよいだろう
