DynagenでCCIEを目指す
20100425 OSPF virtual-link Area0またぎ
最終更新:
it_certification
-
view
目的
- virtual-linkによって、物理的に離れたarea 0同士を接続する方法を確認します。
構成
- 設定概要
- OSPFによってルーティングします。
- 構成図

- netファイル
ghostios = True sparsemem = True model = 3620 [localhost] [[3620]] image = C:\Program Files\Dynamips\images\c3620-j1s3-mz.123-18.bin ram = 256 [[ROUTER R1]] e0/1 = R2 e0/1 [[ROUTER R2]] e0/0 = R3 e0/0 [[ROUTER R3]]
- 初期設定 R1
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R1 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface Ethernet0/0 no ip address shutdown half-duplex ! interface Ethernet0/1 ip address 192.168.1.1 255.255.255.0 full-duplex ! interface Ethernet0/2 no ip address shutdown half-duplex ! interface Ethernet0/3 no ip address shutdown half-duplex ! router ospf 1 log-adjacency-changes network 192.168.1.0 0.0.0.255 area 0 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- 初期設定 R2
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R2 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface Ethernet0/0 ip address 192.168.2.2 255.255.255.0 full-duplex ! interface Ethernet0/1 ip address 192.168.1.2 255.255.255.0 full-duplex ! interface Ethernet0/2 no ip address shutdown half-duplex ! interface Ethernet0/3 no ip address shutdown half-duplex ! router ospf 1 log-adjacency-changes network 192.168.1.0 0.0.0.255 area 0 network 192.168.2.0 0.0.0.255 area 1 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- 初期設定 R3
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R3 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 3.3.3.3 255.255.255.255 ! interface Ethernet0/0 ip address 192.168.2.3 255.255.255.0 full-duplex ! interface Ethernet0/1 ip address 192.168.3.3 255.255.255.0 full-duplex no keepalive ! interface Ethernet0/2 no ip address shutdown half-duplex ! interface Ethernet0/3 no ip address shutdown half-duplex ! router ospf 1 log-adjacency-changes network 192.168.2.0 0.0.0.255 area 1 network 192.168.3.0 0.0.0.255 area 0 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
検証1 事前設定の確認
- ルーティングテーブルの確認
ルーティングテーブルを確認します。area 0が分断されているので、R1は192.168.3.0/24への経路を知りません。
R1#show ip route - 略 - 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 C 192.168.1.0/24 is directly connected, Ethernet0/1 O IA 192.168.2.0/24 [110/20] via 192.168.1.2, 00:14:45, Ethernet0/1 R2#show ip route - 略 - 2.0.0.0/32 is subnetted, 1 subnets C 2.2.2.2 is directly connected, Loopback0 C 192.168.1.0/24 is directly connected, Ethernet0/1 C 192.168.2.0/24 is directly connected, Ethernet0/0 R3#show ip route - 略 - 3.0.0.0/32 is subnetted, 1 subnets C 3.3.3.3 is directly connected, Loopback0 O IA 192.168.1.0/24 [110/20] via 192.168.2.2, 00:12:50, Ethernet0/0 C 192.168.2.0/24 is directly connected, Ethernet0/0 C 192.168.3.0/24 is directly connected, Ethernet0/1
検証2 virtual-linkの設定
- virtual-linkの設定
R2とR3の間をvirtual-linkで接続します。R2に以下の設定を投入します。
R2(config)#router ospf 1 R2(config-router)#area 1 virtual-link 3.3.3.3
R2のみvirtual-linkが設定されている(R3は未設定)状態であると、以下のようなメッセージがR3に出力されます。
*Mar 1 00:43:42.855: %OSPF-4-ERRRCV: Received invalid packet: mismatch area ID, from backbone area must be virtual-link but not found from 192.168.2.2, Ethernet0/0 *Mar 1 00:43:52.779: %OSPF-4-ERRRCV: Received invalid packet: mismatch area ID, from backbone area must be virtual-link but not found from 192.168.2.2, Ethernet0/0
R3に以下の設定を投入します。
R3(config-router)#area 1 R3(config-router)#area 1 virtual-link 2.2.2.2
- メッセージの確認
virtual-linkを介してneighborが確立されるとコンソール上に以下のメッセージが表示されます。R2に表示されるメッセージは以下の通りです。
*Mar 1 00:44:33.247: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on OSPF_VL0 from LOADING to FULL, Loading Done
R3に表示されるメッセージは以下の通りです。
*Mar 1 00:44:32.947: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on OSPF_VL0 from LOADING to FULL, Loading Done
- ルーティングテーブルの確認
R1のルーティングテーブルを確認すると、192.168.3.0/24が加わった事が確認できます。
R1#show ip route - 略 - 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 C 192.168.1.0/24 is directly connected, Ethernet0/1 O IA 192.168.2.0/24 [110/20] via 192.168.1.2, 00:00:09, Ethernet0/1 O 192.168.3.0/24 [110/30] via 192.168.1.2, 00:00:09, Ethernet0/1 <- virtual-linkを介して伝わったルート
補足 検証失敗例
以下のようなトポロジでは検証が難しいと思います。

R4とR5が互いに経路を交換できているため、virtual-linkの検証に失敗してしまいました。
R4#show ip route - 略 - 4.0.0.0/32 is subnetted, 1 subnets C 4.4.4.4 is directly connected, Loopback0 C 192.168.1.0/24 is directly connected, Ethernet0/1 C 192.168.2.0/24 is directly connected, Ethernet0/0 O IA 192.168.3.0/24 [110/20] via 192.168.2.5, 00:00:09, Ethernet0/0 R5#show ip route - 略 - 5.0.0.0/32 is subnetted, 1 subnets C 5.5.5.5 is directly connected, Loopback0 O IA 192.168.1.0/24 [110/20] via 192.168.2.4, 00:02:15, Ethernet0/0 C 192.168.2.0/24 is directly connected, Ethernet0/0 C 192.168.3.0/24 is directly connected, Ethernet0/1