Combat tutorial --OSPF virtual link (experiments can now do)

OSPF virtual link

Virtual link:

1.指一条通过一个非骨干区域连接到骨干区域的链路

Virtual link object:

1.通过一个非骨干区域连接一个区域到骨干区域
2.通过一个非骨干区域连接一个分段的骨干区域

Virtual link configuration rule and characteristics:

1.虚链路必须配置在两台ABR路由器之间
2.传送区域不能是一个末梢区域
3.虚链路的稳定性取决于其经过的区域的稳定性
4.虚链路有助于提供逻辑冗余

Virtual link configuration commands:

Router(config-router)#area area-id vritual-link router-id

Virtual link configuration experiments: (GNS3 topology in the following)

Combat tutorial --OSPF virtual link (experiments can now do)

Test environment preparation: GNS3 and CRT connected to it

1.打开GNS3后我们需要拖出四个路由器,两台PC机
2.其中area0为骨干区域,area1和area2为标准区域
3.R2为ABR

The virtual links in OSPF is that we play a channel region is directly connected by a non-backbone area0 backbone area, just like in FIG. Area2 To area0 and directly connected, then the stability of this link depends on the stable area1 sex, if area1 is not stable enough then this link is unstable. Next we look at the method of operation of the virtual link.

The first step: first routing address configuration and declared segments:

R1:

R1#conf t
R1(config)#int f0/0 
R1(config-if)#ip add 192.168.10.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int f0/1
R1(config-if)#ip add 192.168.20.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#ex
R1(config)#int lo 0
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#no shut
R1(config-if)#ex 
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 192.168.10.0 0.0.0.255 area 2
R1(config-router)#network 192.168.20.0 0.0.0.255 area 2

R2:

R2#conf t
R2(config)#int f0/0
R2(config-if)#ip add 192.168.20.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int f0/1
R2(config-if)#ip add 192.168.30.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#ex
R2(config)#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)#network 192.168.20.0 0.0.0.255 area 2
R2(config-router)#network 192.168.30.0 0.0.0.255 area 1
R2(config-router)#ex
注意:此处为达到实验效果,暂时先不配置虚链路!!!

R3:

R3#conf t 
R3(config)#int f0/0
R3(config-if)#ip add 192.168.30.2 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int f0/1
R3(config-if)#ip add 192.168.40.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#ex
R3(config)#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)#network 192.168.30.0 0.0.0.255 area 1
R3(config-router)#network 192.168.40.0 0.0.0.255 area 0

R4:

R4#conf t
R4(config)#int f0/0
R4(config-if)#ip add 192.168.40.2 255.255.255.0
R4(config-if)#no shut
R4(config-if)#int f0/1
R4(config-if)#ip add 192.168.50.1 255.255.255.0
R4(config-if)#no shut
R4(config-if)#ex
R4(config)#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)#network 192.168.40.0 0.0.0.255 area 0
R4(config-router)#network 192.168.50.0 0.0.0.255 area 0

Step two: check between the router does not have to learn from each network segment:

R1:

R1(config)#do show ip route
.....此处省略部分
     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
C    192.168.10.0/24 is directly connected, FastEthernet0/0
C    192.168.20.0/24 is directly connected, FastEthernet0/1

R2:

R2(config)#do show ip route
.....此处省略部分
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
C    192.168.30.0/24 is directly connected, FastEthernet0/1
O    192.168.10.0/24 [110/20] via 192.168.20.1, 00:15:57, FastEthernet0/0
O IA 192.168.40.0/24 [110/20] via 192.168.30.2, 00:08:28, FastEthernet0/1
C    192.168.20.0/24 is directly connected, FastEthernet0/0
O IA 192.168.50.0/24 [110/30] via 192.168.30.2, 00:03:29, FastEthernet0/1

R3:

R3(config)#do show ip route
.....此处省略部分
     3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
C    192.168.30.0/24 is directly connected, FastEthernet0/0
C    192.168.40.0/24 is directly connected, FastEthernet0/1
O    192.168.50.0/24 [110/20] via 192.168.40.2, 00:10:35, FastEthernet0/1
注意:因为我们刚刚在R2中没有配置虚链路,所以此时R3是没有学习到area2区域的网段的!!!

R4:

R4(config)#do show ip route 
.....此处省略部分
O IA 192.168.30.0/24 [110/20] via 192.168.40.1, 00:12:42, FastEthernet0/0
     4.0.0.0/32 is subnetted, 1 subnets
C    192.168.40.0/24 is directly connected, FastEthernet0/0
C    192.168.50.0/24 is directly connected, FastEthernet0/1

The third step: enter if two clients to configure IP addresses and gateways, and can ping test:

PC1>ip 192.168.10.2 192.168.10.1
PC2>ip 192.168.50.2 192.168.50.1
PC1> ping 192.168.50.2           
*192.168.10.1 icmp_seq=1 ttl=255 time=19.999 ms (ICMP type:3, code:1, Destination host unreachable)    
此时显示:目标主机不可达,无法连通
所以此时我们就需要做一条虚链路,经过area1区域做这个虚链路
此处需要注意的是,在做虚链路时,写入的router-id是对方的,我们应该如何去操作,请接着看。

Step Four: virtual link configuration:

Back R2:

R2(config)#router ospf 1
R2(config-router)#area 1 virtual-link 3.3.3.3    //area1为穿越区域,写上R3的router-id

Then R3:

R3(config)#router ospf 1
R3(config-router)#area 1 virtual-link 2.2.2.2    //area1为穿越区域,写上R2的router-id

Step five: back to the client to see whether the ping is:

PC1> ping 192.168.50.2
192.168.50.2 icmp_seq=1 timeout
84 bytes from 192.168.50.2 icmp_seq=2 ttl=60 time=82.984 ms    //显示状态连通

Conclusion: At this point in the case of the whole network interworking learning each router's routing table is a link to all network segments, which explains setting a virtual link to the backbone area can make a standard area separated by a non-straight to achieve interoperability in connection with the state.

Guess you like

Origin blog.51cto.com/14464303/2437996