应用场景描述:
因为设计的失误或者是通信的需要,需要把一个不和骨干相联的区域相连接通过一个虚链路的设置。
虚链路配置命令
area 传送区域 virtual-link 对端的 routerID
实验步骤:
BJ1 的配置:
ena
conf t
host bj1
int e0/0
ip add 192.168.224.1 255.255.255.0
no sh
exit
int loop 0
ip add 192.168.1.3 255.255.255.0
exit
router ospf 1
network 192.168.224.0 0.0.0 .255 area 51
network 192.168.1.0 0.0.0 .255 area 0
area 51 virtual-link 192.168.3.1 ..... 配置虚链路,注意一定是在ABR
exit
exit
wri
*****************************************************
GZ1 的配置:
ena
conf t
host gz1
int e0/0
ip add 192.168.224.2 255.255.255.0
no sh
exit
int e0/1
ip add 192.168.240.1 255.255.255.252
no sh
exit
int loop 0
ip add 192.168.3.1 255.255.255.0
exit
router ospf 1
network 192.168.240.0 0.0.0 .3 area 3
network 192.168.224.0 0.0.0 .255   area 51
network 192.168.3.0 0.0.0 .255 area 51
area 51   virtual-link 192.168.1.3 .... 配置虚链路,注意一定是在ABR
exit
exit
wri
************************************************
SH1 上的配置:
ena
conf  t
host  sh1
int  e0/0
ip  add 192.168.240.2 255.255.255.252
no  sh
exit
int loop 0
ip add 192.168.252.1 255.255.255.0
exit
router ospf 1
network 192.168.240.0 0.0.0 .3 area 3
network 192.168.252.0 0.0.0 .255 area 2
exit
exit
wri
**************************************************
实验验证:
sh1#sh ip route
Gateway of last resort is not set
O IA 192.168.224.0/24 [110/20] via 192.168.240.1, 00:03:47, Ethernet0/0
     192.168.240.0/30 is subnetted, 1 subnets
C        192.168.240.0 is directly connected, Ethernet0/0
      192.168.1.0/32 is subnetted, 1 subnets
O IA     192.168.1.3 [110/21] via 192.168.240.1, 00:03:47, Ethernet0/0
C     192.168.252.0/24 is directly connected, Loopback0
     192.168.3.0/32 is subnetted, 1 subnets
O IA     192.168.3.1 [110/11] via 192.168.240.1, 00:03:47, Ethernet0/0
*******************************************************
gz1#sh ip   route
Gateway of last resort is not set
C     192.168.224.0/24 is directly connected, Ethernet0/0
     192.168.240.0/30 is subnetted, 1 subnets
C        192.168.240.0 is directly connected, Ethernet0/1
     192.168.1.0/32 is subnetted, 1 subnets
O        192.168.1.3 [110/11] via 192.168.224.1, 00:01:46, Ethernet0/0
C     192.168.3.0/24 is directly connected, Loopback0
***********************************************************
bj1#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       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
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
C     192.168.224.0/24 is directly connected, Ethernet0/0
     192.168.240.0/30 is subnetted, 1 subnets
O IA     192.168.240.0 [110/20] via 192.168.224.2, 00:01:35, Ethernet0/0
C     192.168.1.0/24 is directly connected, Loopback0
     192.168.3.0/32 is subnetted, 1 subnets
O        192.168.3.1 [110/11] via 192.168.224.2, 00:02:31, Ethernet0/0
******************************************************
sh1#ping 192.168.1.3
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/65/100 ms
sh1#ping 192.168.224.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.224.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/80/128 ms
*******************************************************
实验总结:
    配置虚链路一定是在两个ABR上配置的,或者是ASBR但也应该同时是ABR