今天突然兴趣一来,回想一下课堂上讲了虚链路的知识,NP的书里也讲了虚链路的知识,但是都是讲怎么配置的,一带而过。虚链路到底是怎么样建立起这样一条通道呢?
OSPF的TTL=1,所以OSPF的组播HELLO包不会穿过那么多中间路由器到达虚链路的另一端的。上面搜了搜,才发现虚链路中的是使用单播的方式来发送HELLO包的。
下面做实验证明:
OSPF的配置就不说了。说一下怎么建立虚链路就行了:
R1 :
- router ospf 100
- router-id 2.2.2.2
- log-adjacency-changes
- area 1 virtual-link 1.1.1.1
- network 12.1.1.2 0.0.0.0 area 1
- network 23.1.1.2 0.0.0.0 area 2
R0:
- router ospf 100
- router-id 1.1.1.1
- log-adjacency-changes
- area 1 virtual-link 2.2.2.2
- network 1.1.1.1 0.0.0.0 area 0
- network 12.1.1.1 0.0.0.0 area 1
这样子虚链路就可以成功建立起来 了:
- R0#show ip ospf virtual-links
- Virtual Link OSPF_VL1 to router 2.2.2.2 is up
- Run as demand circuit
- DoNotAge LSA allowed.
- Transit area 1, via interface Serial0/0, Cost of using 64
- 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:04
- Adjacency State FULL (Hello suppressed)
- Index 1/2, retransmission queue length 0, number of retransmission 0
- First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
- Last retransmission scan length is 0, maximum is 0
- Last retransmission scan time is 0 msec, maximum is 0 msec
下面切入重点,我们现在将R1 的虚链路down掉,也就是no掉。
- R1(config-router)#no area 1 virtual-link 1.1.1.1
然后:
- R1#debug ip ospf events
再启用虚链路:
- R1(config-router)#area 1 virtual-link
显示如下:
- R1(config-router)#area 1 virtual-link 1.1.1.1
- R1(config-router)#
- *Mar 1 00:55:36.499: OSPF: Interface OSPF_VL2 going Up
- *Mar 1 00:55:36.503: OSPF: Send hello to 12.1.1.1 area 0 on OSPF_VL2 from 12.1.1.2
看到了吧,从虚链路发送单播hello包到目的地12.1.1.1.
证明了虚链路发送hello包是通过单播的方式的。
有人说只有在虚链路刚建立时才是用单播包发送的,之后仍然用组播。我觉得不明白。所以:
R0:
- interface loopback 0
- ip add 10.1.1.1 255.255.255.0
- router ospf 100
- network 10.1.1.1 0.0.0.0 area 0
再查看:
- R1#
- *Mar 1 01:02:43.595: OSPF: Rcv LS UPD from 1.1.1.1 on OSPF_VL2 length 88 LSA count 1
- R1#
转载于:https://blog.51cto.com/yeelone/428250