Meaning a virtual link
It refers to a region connected to the backbone through a non-backbone area link (OSPF protocol is only connected to the backbone region, in order to obtain the routing information)
Virtual link object
A region connected to the backbone through a region of non-backbone area;
A segment connected to the backbone through a non-backbone area region.
Virtual link configuration commands
Router(config-router)#area area-id vritual-link router-id //“area-id”为需要跨越的区域ID;“router-id”为其邻居的路由ID
Establishment of experimental topology and preparation
Experimental topology is as follows:
Preparatory
Open GNS3
1, out of four routes from the icon bar, two PC;
2, a network cable is connected and turned on.
The official start of the experiment
Step: configure the routing device according to the port topology
R1
R1#conf t //进入全局模式
R1(config)#int f 0/1 //进入f0/1接口
R1(config-if)#ip add 192.168.10.1 255.255.255.0 //设置IP与子网掩码
R1(config-if)#no shut
R1(config-if)# int f 0/0
R1(config-if)#ip add 10.10.10.10 255.0.0.0
R1(config-if)#no shut
R1(config-if)#ex
R1(config)#int lo 0 //进入loopback网卡
R1(config-if)#ip add 1.1.1.1 255.255.255.255 //指定Router ID
R1(config-if)#no shut
R1(config-if)#ex
R1(config)#router ospf 1 //建立OSPF协议1号进程
R1(config-router)#router-id 1.1.1.1
R1(config-router)#net 192.168.10.0 0.0.0.255 area 2 //宣告自身网段
R1(config-router)#net 10.0.0.0 0.255.255.255 area 2 //宣告自身网段
R1(config-router)#ex
R2
R2#conf t
R2(config)#int f 0/1
R2(config-if)#ip add 10.10.10.20 255.0.0.0
R2(config-if)#no shut
R2(config-if)#int f 0/0
R2(config-if)#ip add 20.20.20.20 255.0.0.0
R2(config-if)#no shut
R2(config-if)#int lo 0
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#no shut
R2(config-if)#ex
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#net 10.0.0.0 0.255.255.255 area 2
R2(config-router)#net 20.0.0.0 0.255.255.255 area 1
R2(config-router)#ex
R3
R3#conf t
R3(config)#int f0/0
R3(config-if)#ip add 20.20.20.30 255.0.0.0
R3(config-if)#no shut
R3(config-if)#int f 0/1
R3(config-if)#ip add 30.30.30.30 255.0.0.0
R3(config-if)#no shut
R3(config-if)#int lo 0
R3(config-if)#ip add 3.3.3.3 255.255.255.255
R3(config-if)#no shut
R3(config-if)#ex
R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#net 20.0.0.0 0.255.255.255 area 1
*Mar 1 00:02:05.795: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on FastEthernet0/0 from LOADING to FULL, Loading Done
R3(config-router)#net 30.0.0.0 0.255.255.255 area 0
R3(config-router)#ex
R4
R4#conf t
R4(config)#int f0/1
R4(config-if)#ip add 30.30.30.40 255.0.0.0
R4(config-if)#no shut
R4(config-if)#int f0/0
R4(config-if)#ip add 192.168.20.1 255.255.255.0
R4(config-if)#no shut
R4(config-if)#int lo 0
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config-if)#no shut
R4(config-if)#ex
R4(config)#router ospf 1
R4(config-router)#router-id 4.4.4.4
R4(config-router)#net 30.0.0.0 0.255.255.255 area 0
*Mar 1 02:34:26.647: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on FastEthernet0/1 from LOADING to FULL, Loading Done
R4(config-router)#net 192.168.20.0 0.0.0.255 area 0
R4(config-router)#ex
At this time, the respective routing device has been set up. But actually area 0 in the backbone area of the route is learned in one segment area associated therewith, does not learn the segment 2 in the area spaced routing table learning incomplete, naturally impossible Unicom.
Below it is quietly "dig" in the tunnel area 1 area, establish virtual links connected to area 0 backbone area.
The second step: the establishment of a virtual link, complete routing table
R2
R2(config)#router ospf 1 //进入ospf协议1号进程中
R2(config-router)#area 1 virtual-link 3.3.3.3 //建立虚连接
R3
R3(config)#router ospf 1
R3(config-router)#area 1 virtual-link 2.2.2.2
Step Three: Configure the PC, to achieve interconnection
PC1
PC1>
PC1> ip 192.168.10.10 192.168.10.1
Checking for duplicate address...
PC1 : 192.168.10.10 255.255.255.0 gateway 192.168.10.1
PC1>
PC2
PC2>
PC2> ip 192.168.20.20 192.168.20.1
Checking for duplicate address...
PC1 : 192.168.20.20 255.255.255.0 gateway 192.168.20.1
PC2>