OSPFは、area0(バックボーンエリア)とその他のareaに分かれている(標準エリア)の2種類に分かれています。
標準エリアは、必ずバックボーンエリアに隣接する必要がある。というルールが
あります。しかし、隣接できない構成になった場合のために、仮想的にarea0と接続させる機能がVirtual-linkです。
Virtual-linkでOSPFパケットが通過するエリアをトランジットエリアと言います。
下記構成だと、area1です。
ちなみに、隣接していない場合、経路情報を受け渡しできないです。
下記構成で、Virtual-link実装していきます。
現状、Virtual-linkを実装していない状態なので、area0は、area1の経路情報しか学習しておらず、area2は、OSPFで経路学習していない状態です。
【R3ルーティングテーブル】
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O IA 10.0.1.0/24 [110/2] via 10.1.3.2, 00:31:31, GigabitEthernet0/0
O IA 10.0.12.0/24 [110/2] via 10.1.23.2, 00:31:48, GigabitEthernet0/1
C 10.1.3.0/24 is directly connected, GigabitEthernet0/0
L 10.1.3.3/32 is directly connected, GigabitEthernet0/0
C 10.1.23.0/24 is directly connected, GigabitEthernet0/1
L 10.1.23.3/32 is directly connected, GigabitEthernet0/1
【R1ルーティングテーブル】
Gateway of last resort is not set
192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.20.0/24 is directly connected, GigabitEthernet0/2
L 192.168.20.2/32 is directly connected, GigabitEthernet0/2
192.168.100.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.100.0/24 is directly connected, Vlan1
L 192.168.100.1/32 is directly connected, Vlan1
【Virtual-link設定】
コマンドは、area <area-id(トランジット)> virtual-link <対向のrouter-id>
R1
Router-id
10.0.12.1
R1(config)#router ospf 1
R1(config-router)#area 1 virtual-link 10.1.3.2
R1(config-router)#area 1 virtual-link 10.1.23.2
R4
10.1.3.2
R4(config)#router ospf 1
R4(config-router)#area 1 virtual-link 10.0.12.1
R2
10.1.23.2
R2(config)#router ospf 1
R2(config-router)#area 1 virtual-link 10.0.12.1
【Virtual-linkコマンド】
①は、Virtual-linkの状態です。UPになってます。
②は、トランジットエリアです。上記の通りarea1ですね。
R1#sh ip ospf virtual-links
Virtual Link OSPF_VL1 to router 10.1.23.2 is up ①
Run as demand circuit
DoNotAge LSA allowed.
Transit area 1, via interface GigabitEthernet0/0 ②
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:06
Adjacency State FULL (Hello suppressed)
Index 1/2/5, 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
Virtual Link OSPF_VL0 to router 10.1.3.2 is up ①
Run as demand circuit
DoNotAge LSA allowed.
Transit area 1, via interface GigabitEthernet0/1 ②
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:05
Adjacency State FULL (Hello suppressed)
Index 1/1/4, 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
【ログ出力】
virtual-linkで確率できていない場合とできた場合のログは下記の通りです。
NG
*Jul 24 06:11:17.437: %OSPF-4-ERRRCV: Received invalid packet: mismatched area ID from backbone area from 10.0.12.2, GigabitEthernet0/0uter ospf 1
OK
*Jul 24 06:11:21.775: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.23.2 on OSPF_VL1 from LOADING to FULL, Loading Done
【R1ルーティングテーブル】
OSPFで学習できてますね。
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O 10.1.3.0/24 [110/2] via 10.0.1.2, 00:13:21, GigabitEthernet0/1
O 10.1.23.0/24 [110/2] via 10.0.12.2, 00:13:21, GigabitEthernet0/0
O 192.168.100.0/24 [110/2] via 192.168.20.2, 00:13:51, GigabitEthernet0/2
【R3ルーティングテーブル】
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O IA 10.0.1.0/24 [110/2] via 10.1.3.2, 00:41:23, GigabitEthernet0/0
O IA 10.0.12.0/24 [110/2] via 10.1.23.2, 00:41:40, GigabitEthernet0/1
C 10.1.3.0/24 is directly connected, GigabitEthernet0/0
L 10.1.3.3/32 is directly connected, GigabitEthernet0/0
C 10.1.23.0/24 is directly connected, GigabitEthernet0/1
L 10.1.23.3/32 is directly connected, GigabitEthernet0/1
O IA 192.168.20.0/24 [110/3] via 10.1.23.2, 00:00:16, GigabitEthernet0/1
[110/3] via 10.1.3.2, 00:02:16, GigabitEthernet0/0
O IA 192.168.100.0/24 [110/4] via 10.1.23.2, 00:00:16, GigabitEthernet0/1
[110/4] via 10.1.3.2, 00:02:16, GigabitEthernet0/0