上次说到OSPF建立虚链路解决跨区域的问题。但是虚链路解决这个问题是有局限的。我们先讨论一下它的局限性,与使用GRE建立遂道来解决这个问题。
还是用那个拓扑:
如果我们作了以下这个设置:
- R0(config-router)#area 1 stub
- R1(config-router)#area 1 stub
再想做虚链路时发生下面这种情况:
- R0(config-router)#area 1 virtual-link 2.2.2.2
- % OSPF: Area 1 is a stub or nssa so virtual links are not allowed
具体原理我不明白是为什么?但是我做 了一下猜想,STUB区域是不允许连接有外部网络的,通常情况下,STUB区域只能连接有一个区域,不知道这是不是它不能做为虚链路的原因。呵呵,这是乱猜的,应该是错误的。如果有人知道这个问题的话,请留下言告诉我一声,谢谢。
解决这个问题的方法就是使用GRE建立遂道了。配置如下:
R0:
- interface Tunnel0
- ip address 192.168.1.3 255.255.255.0
- tunnel source 12.1.1.1
- tunnel destination 12.1.1.2
- router ospf 100
- router-id 1.1.1.1
- area 1 stub
- network 192.168.1.0 0.0.0.255 area 0
- !
R1:
- interface Tunnel0
- ip address 192.168.1.1 255.255.255.0
- tunnel source 12.1.1.2
- tunnel destination 12.1.1.1
- !
- router ospf 100
- network 192.168.1.0 0.0.0.255 area 0
- !
这样便建立起遂道了。
转载于:https://blog.51cto.com/yeelone/428289