Cisco思科CCNP考试培训技术文档-GRE隧道递归路由错误
关注【乾颐堂网络实验室】我们将继续为大家更新更多Cisco思科CCNP培训相关技术文档。
如果您在遇到以下错误之前配置了GRE隧道:
%TUN-5-RECURDOWN: Tunnel0 temporarily disabled due to recursive routing
发生的事情是您的路由器通过隧道本身学习了隧道接口的目标IP地址。因此,它从路由表中删除了隧道目标IP地址的先前条目。现在隧道目的地不再可达.
让我向您演示这一点,因为它会更有意义......这是我们将使用的拓扑:
上面我们有3个路由器,想法是在R1和R3之间有一个GRE隧道。我将首先在接口上配置IP地址并使用RIP,以便R1和R3可以相互连接:
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface loopback0
R1(config-if)#ip address 1.1.1.1 255.255.255.255
R1(config-if)#exit
ISP(config)#interface fastEthernet 0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#exit
R2(config)#interface fastEthernet 1/0
R2(config-if)#ip address 192.168.23.2 255.255.255.0
Branch(config)#interface fastEthernet 0/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#exit
R3(config)#interface loopback 0
R3(config-if)#ip address 3.3.3.3 255.255.255.255
R3(config-if)#exit
现在让我们在所有路由器上配置RIP:
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network 192.168.12.0
R1(config-router)#network 1.0.0.0
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#network 192.168.12.0
R2(config-router)#network 192.168.23.0
R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#no auto-summary
R3(config-router)#network 192.168.23.0
R3(config-router)#network 3.0.0.0
上面的网络命令将确保R1和R3可以相互连接。现在让我们在R1和R3的环回接口之间创建一个隧道接口:
R1(config)#interface tunnel 1
R1(config-if)#tunnel source loopback0
R1(config-if)#ip address 192.168.13.1 255.255.255.0
R1(config-if)#tunnel destination 3.3.3.3
R3(config)#interface tunnel 1
R3(config-if)#tunnel source loopback0
R3(config-if)#ip address 192.168.13.3 255.255.255.0
R3(config-if)#tunnel destination 1.1.1.1
这将启用R1和R3的环回接口之间的隧道。我在隧道接口上配置了网络192.168.13.0 / 24。在继续之前,让我向您展示R1和R3的路由表:
R1#show ip route rip | include 3.3.3.3
R 3.3.3.3 [120/2] via 192.168.12.2, 00:00:24, FastEthernet0/0
R3#show ip route rip | include 1.1.1.1
R 1.1.1.1 [120/2] via 192.168.23.2, 00:00:17, FastEthernet0/0
仔细看看上面的输出。R1和R3各自的跳数为2,以达到彼此的环回接口。现在我们将在隧道接口上启用RIP:
R1(config)#router rip
R1(config-router)#network 192.168.13.0
R3(config)#router rip
R3(config-router)#network 192.168.13.0
一旦我们在隧道接口上启用RIP,您将在R1和R3上看到此消息:
%TUN-5-RECURDOWN: Tunnel1 temporarily disabled due to recursive routing
%LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel1, changed state to down
那么这里发生了什么?在隧道接口上启用RIP之前,R1和R3了解到它们可以通过R2到达彼此的环回接口,跳数为2。
在隧道接口上激活RIP后,R1和R3了解到它们可以通过跳数为1来到达彼此的环回接口。因此,他们将在路由表中安装此新信息并删除旧信息。如果你很快就可以在隧道出现时在路由表中捕获它。这是R3的一个例子:
R3#show ip route rip | include 1.1.1.1
R 1.1.1.1 [120/1] via 192.168.13.1, 00:00:02, Tunnel1
上面你可以看到R3希望通过隧道界面达到1.1.1.1,跳数为1.试图通过隧道到达隧道目的地有点问题......这是一个经典的鸡和蛋问题。
我们如何解决这个问题?您需要确保路由器不通过隧道本身到达隧道目的地。有很多选项可以做到这一点:
· 请勿在隧道接口上公布隧道目标IP地址。不要做广告或使用路由过滤。
· 确保通过隧道的隧道目标IP地址的管理距离比现在路由表中的更高(更差)。
· 确保通过隧道的隧道目标IP地址的度量标准比现在路由表中的度量标准更差。
我将使用其中一种技术来解决我们的设置中的问题:
R1(config)#router rip
R1(config-router)#offset-list 0 in 3 tunnel 1
R3(config)#router rip
R3(config-router)#offset-list 0 in 3 tunnel 1
偏移列表可用于更改度量标准。在上面的示例中,我正在配置RIP,以便它通过隧道接口通告的所有网络的跳数都为3。
由于通过隧道的跳数为3(更差),然后跳数为2到R2,我们的路由器R1和R3现在将使用FastEthernet链路到达隧道目标IP地址。
在这个例子中,我使用了RIP,但是其他路由协议(如OSPF或EIGRP)也会出现同样的问题
思科CCNP培训咨询可联系乾颐堂官网客服. 点击咨询
咨询QQ及电话:4006188070
乾颐堂官网:www.qytang.com
乾颐堂网络实验室 我们为您想的更多
姓名:
Q Q:
电话:
|