兴宁A8 兴宁论坛 兴宁新闻 兴宁人的网络社区
标题:
EIGRP管理距离引起路由震荡的原因及解决
[打印本页]
作者:
computer
时间:
2012/3/8 23:56
标题:
EIGRP管理距离引起路由震荡的原因及解决
<P align=center><FONT face=Arial size=2></FONT></P>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT face=FangSong_GB2312 size=2>EIGRP和OSPF做双点双向重分发</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT face=仿宋_GB2312></FONT><BR><FONT size=2><FONT face=FangSong_GB2312>第一种情况:</FONT><BR></FONT></FONT><FONT face=FangSong_GB2312 size=2>1,R1,R2,R3,R4初始配置</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2> R1 <BR>conf t<BR>int l 0<BR>ip add 1.1.1.1 255.255.255.255<BR>int f0/0<BR>ip add 1.1.123.1 255.255.255.0<BR>no shut<BR>router eigrp 1<BR>no auto<BR>net 1.1.1.1 0.0.0.0<BR>net 1.1.123.0 0.0.0.255<BR>end</FONT></FONT></DIV>
<DIV><BR><FONT face=Arial><FONT size=2> R2<BR>conf t<BR>int l 0<BR>ip add 1.1.2.2 255.255.255.255<BR>int f0/0<BR>ip add 1.1.123.2 255.255.255.0<BR>no shut<BR>int s1/0<BR>ip add 1.1.234.2 255.255.255.0<BR>encap f<BR>no arp f<BR>no frame inv<BR>frame map ip 1.1.234.4 204 b<BR>frame map ip 1.1.234.3 204 b<BR>no shut<BR>ip ospf p 0<BR>router ospf 1<BR>router-id 1.1.2.2<BR>net 1.1.234.2 0.0.0.0 a 0<BR>net 1.1.2.2 0.0.0.0 a 0<BR>router eigrp 1<BR>no auto<BR>net 1.1.2.2 0.0.0.0<BR>net 1.1.123.0 0.0.0.255<BR>end</FONT></FONT></DIV>
<DIV><BR><FONT face=Arial><FONT size=2> R3<BR>conf t<BR>int l 0<BR>ip add 1.1.3.3 255.255.255.255<BR>int f 0/0<BR>ip add 1.1.123.3 255.255.255.0<BR>no shut<BR>int s1/0<BR>ip add 1.1.234.3 255.255.255.0<BR>encap f<BR>no arp f<BR>no frame inv<BR>frame map ip 1.1.234.4 304 b<BR>frame map ip 1.1.234.2 304 b<BR>no shut<BR>ip ospf p 0<BR>router ospf 1<BR>router-id 1.1.3.3 <BR>net 1.1.234.3 0.0.0.0 a 0<BR>net 1.1.3.3 0.0.0.0 a 0<BR>router eigrp 1<BR>no auto<BR>net 1.1.3.3 0.0.0.0<BR>net 1.1.123.0 0.0.0.255<BR>end</FONT></FONT></DIV>
<DIV><BR><FONT face=Arial><FONT size=2> R4<BR>conf t<BR>int l 0<BR>ip add 1.1.4.4 255.255.255.255<BR>int s1/0<BR>ip add 1.1.234.4 255.255.255.0<BR>encap f<BR>no arp f<BR>no frame inv<BR>frame map ip 1.1.234.2 402 b<BR>frame map ip 1.1.234.3 403 b<BR>no shut<BR>router ospf 1<BR>router-id 1.1.4.4<BR>nei 1.1.234.2<BR>nei 1.1.234.3<BR>net 1.1.234.4 0.0.0.0 a 0<BR>net 1.1.4.4 0.0.0.0 a 0<BR>end</FONT></FONT></DIV>
<DIV><BR><FONT face=FangSong_GB2312 size=2>到这里,所有的EIGRP和OSPF邻居关系都建立好了。</FONT></DIV>
<DIV><FONT face=仿宋_GB2312 size=2></FONT> </DIV>
<DIV><FONT face=FangSong_GB2312 size=2>2,在R2和R3上做双点双向重分发</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2> R2<BR>router eigrp 1<BR>redistribute ospf 1 metric 10000 100 255 1 1500<BR>router ospf 1<BR>redistribute eigrp 1 metric 100 metric-type 1 subnets<BR>end</FONT></FONT></DIV>
<DIV><BR><FONT face=Arial><FONT size=2> R3<BR>router eigrp 1<BR>redistribute ospf 1 metric 10000 100 255 1 1500<BR>router ospf 1<BR>redistribute eigrp 1 metric 100 metric-type 1 subnets<BR>end</FONT></FONT></DIV>
<DIV><FONT face=FangSong_GB2312 size=2>重分发完成,</FONT></DIV>
<DIV><FONT face=FangSong_GB2312 size=2></FONT> </DIV>
<DIV><FONT face=FangSong_GB2312 size=2>验证</FONT></DIV>
<DIV><BR><FONT face=FangSong_GB2312 size=2>R1路由表</FONT></DIV>
<DIV><FONT face=Arial size=2>R1#sh ip route</FONT></DIV>
<DIV><FONT face=Arial size=2>Gateway of last resort is not set</FONT></DIV>
<DIV><FONT face=Arial size=2> 1.0.0.0/8 is variably subnetted, 6 subnets, 2 masks<BR>D EX 1.1.4.4/32 [170/284160] via 1.1.123.3, 00:01:03, FastEthernet0/0<BR> [170/284160] via 1.1.123.2, 00:01:03, FastEthernet0/0<BR>D 1.1.3.3/32 [90/156160] via 1.1.123.3, 00:08:44, FastEthernet0/0<BR>D 1.1.2.2/32 [90/156160] via 1.1.123.2, 00:08:44, FastEthernet0/0<BR>C 1.1.1.1/32 is directly connected, Loopback0<BR>C 1.1.123.0/24 is directly connected, FastEthernet0/0<BR>D EX 1.1.234.0/24 [170/284160] via 1.1.123.3, 00:02:51, FastEthernet0/0<BR> [170/284160] via 1.1.123.2, 00:02:51, FastEthernet0/0</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><FONT face=FangSong_GB2312>R4路由表</FONT><BR>R4#sh ip route</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>Gateway of last resort is not set</FONT></DIV>
<DIV><FONT face=Arial size=2> 1.0.0.0/8 is variably subnetted, 6 subnets, 2 masks<BR>C 1.1.4.4/32 is directly connected, Loopback0<BR>O 1.1.3.3/32 [110/65] via 1.1.234.3, 00:00:14, Serial1/0<BR>O 1.1.2.2/32 [110/65] via 1.1.234.2, 00:00:14, Serial1/0<BR>O E1 1.1.1.1/32 [110/164] via 1.1.234.3, 00:00:14, Serial1/0<BR> [110/164] via 1.1.234.2, 00:00:14, Serial1/0<BR>O E1 1.1.123.0/24 [110/164] via 1.1.234.3, 00:00:14, Serial1/0<BR> [110/164] via 1.1.234.2, 00:00:14, Serial1/0<BR>C 1.1.234.0/24 is directly connected, Serial1/0</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><BR><FONT face=Arial><FONT size=2><FONT face=FangSong_GB2312>第二种情况</FONT><BR><FONT face=FangSong_GB2312>在R1的S1/2接口接入R5,并启用RIPV2</FONT><BR> R5<BR>conf t<BR>int s1/2<BR>ip add 192.168.45.5 255.255.255.0<BR>no shut<BR>router rip<BR>ver 2<BR>no auto<BR>net 192.168.45.0<BR>end</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2> R1<BR>conf t<BR>int s1/2<BR>no shut<BR>ip add 192.168.45.4 255.255.255.0<BR>router rip<BR>ver 2<BR>no au<BR>net 192.168.45.0<BR>end</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2></FONT><FONT face=Arial> </DIV>
<DIV><BR><FONT size=2>把RIP再分发到EIGRP1中</FONT><BR><FONT size=2>router eigrp 1<BR>redistribute rip metric 10000 100 255 1 1500<BR>end</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT></FONT><FONT face="宋体, MS Song"> </FONT></DIV>
<DIV><FONT face=Arial size=2>这时看R2和R3上的路由表</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2>R2(config)#do sh ip route <BR>Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP<BR> D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area <BR> N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2<BR> E1 - OSPF external type 1, E2 - OSPF external type 2<BR> i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2<BR> ia - IS-IS inter area, * - candidate default, U - per-user static route<BR> o - ODR, P - periodic downloaded static route</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>Gateway of last resort is not set</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2> 1.0.0.0/8 is variably subnetted, 6 subnets, 2 masks<BR>O 1.1.4.4/32 [110/65] via 1.1.234.4, 00:31:58, Serial1/0<BR>D 1.1.3.3/32 [90/156160] via 1.1.123.3, 00:05:56, FastEthernet0/0<BR>C 1.1.2.2/32 is directly connected, Loopback0<BR>D 1.1.1.1/32 [90/156160] via 1.1.123.1, 00:05:56, FastEthernet0/0<BR>C 1.1.123.0/24 is directly connected, FastEthernet0/0<BR>C 1.1.234.0/24 is directly connected, Serial1/0<BR><FONT color=#0000ff>O E1 192.168.45.0/24 [110/164] via 1.1.234.3, 00:05:59, Serial1/0</FONT><BR>R2(config)#do ping 192.168.45.5</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>Type escape sequence to abort.<BR>Sending 5, 100-byte ICMP Echos to 192.168.45.5, timeout is 2 seconds:<BR>.....<BR>Success rate is 0 percent (0/5)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> 仔细查看路由表可以发现,R2到192.168.45.0网段下一跳是1.1.234.2,也就是R3的S1/0接口,但是拓扑上表明下一跳为R1的F0/0接口为最佳路径。为什么会出现这样的情况呢?<BR> 我们知道,EIGRP的AD(管理距离)有两种情况:<BR> 1,当收到内部路由时,AD为90,路由表里的标识为“D”<BR> 2,当收到外部转发的路由是,AD为170,路由表里的标识为“ D EX”<BR> 当R1把RIP再分发到EIGRP1中的时候,R2和R3的收到192.168.45.0网段为“D EX"标识(可以通过shou ip bgp top命令校验),这时EIGRP的AD为170,当R2把EIGRP1再分发到OSPF中后,因为的OSPF的AD为110,R3会从R1和R2这个两个路由器上收到192.168.45.0这个路由条目,根据路由选路原则,R3会优先选择OSPF协议收到的路由,所以在路由表上显示“O E1”,这样的结果会造成数据包在R4和R2之间震荡,<BR> <BR>用trace命令验证<BR>R2(config)#do trace 192.168.45.5</FONT></DIV>
<DIV><FONT face=Arial size=2>Type escape sequence to abort.<BR>Tracing the route to 192.168.45.5</FONT></DIV>
<DIV><FONT face=Arial size=2> 1 1.1.234.4 252 msec 232 msec 232 msec<BR> 2 1.1.234.3 432 msec 308 msec 304 msec<BR> 3 * * * <BR> 4 1.1.234.4 576 msec 612 msec 480 msec<BR> 5 1.1.234.3 720 msec 464 msec 648 msec<BR> 6 * * * <BR> 7 1.1.234.4 528 msec 684 msec 552 msec<BR> 8 1.1.234.3 888 msec 932 msec 672 msec<BR> 9 * * * <BR> ……</FONT></DIV><FONT face=Arial>
<DIV><BR><FONT size=2>R3上也会出现相同的情况</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT></FONT><FONT face="宋体, MS Song"> </FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><FONT face=FangSong_GB2312>解决方法</FONT><BR>将R2和R3上OSPF的AD修改为大于170</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2> R2<BR>conf t<BR>access 10 permit 192.168.45.0 0.0.0.255<BR>router ospf 1<BR>distance 180 1.1.3.3 0.0.0.0 10<BR>end</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2> R3<BR>conf t<BR>access 10 permit 192.168.45.0 0.0.0.255<BR>router ospf 1<BR>distance 180 1.1.2.2 0.0.0.0 10<BR>end</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><FONT face=FangSong_GB2312>验证R2,R3,R4路由表</FONT><BR></FONT><FONT size=2>R2(config)#do sh ip route<BR>Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP<BR> D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area <BR> N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2<BR> E1 - OSPF external type 1, E2 - OSPF external type 2<BR> i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2<BR> ia - IS-IS inter area, * - candidate default, U - per-user static route<BR> o - ODR, P - periodic downloaded static route</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>Gateway of last resort is not set</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2> 1.0.0.0/8 is variably subnetted, 6 subnets, 2 masks<BR>O 1.1.4.4/32 [110/65] via 1.1.234.4, 00:11:38, Serial1/0<BR>D 1.1.3.3/32 [90/156160] via 1.1.123.3, 00:11:38, FastEthernet0/0<BR>C 1.1.2.2/32 is directly connected, Loopback0<BR>D 1.1.1.1/32 [90/156160] via 1.1.123.1, 00:11:38, FastEthernet0/0<BR>C 1.1.123.0/24 is directly connected, FastEthernet0/0<BR>C 1.1.234.0/24 is directly connected, Serial1/0<BR><FONT color=#0000ff>D EX 192.168.45.0/24 [170/284160] via 1.1.123.1, 00:11:38, FastEthernet0/0</FONT></FONT></FONT></DIV>
<DIV><BR><FONT face=Arial><FONT size=2>R3(config)#do sh ip route<BR>Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP<BR> D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area <BR> N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2<BR> E1 - OSPF external type 1, E2 - OSPF external type 2<BR> i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2<BR> ia - IS-IS inter area, * - candidate default, U - per-user static route<BR> o - ODR, P - periodic downloaded static route</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>Gateway of last resort is not set</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2> 1.0.0.0/8 is variably subnetted, 6 subnets, 2 masks<BR>O 1.1.4.4/32 [110/65] via 1.1.234.4, 00:01:27, Serial1/0<BR>C 1.1.3.3/32 is directly connected, Loopback0<BR>D 1.1.2.2/32 [90/156160] via 1.1.123.2, 00:01:27, FastEthernet0/0<BR>D 1.1.1.1/32 [90/156160] via 1.1.123.1, 00:01:27, FastEthernet0/0<BR>C 1.1.123.0/24 is directly connected, FastEthernet0/0<BR>C 1.1.234.0/24 is directly connected, Serial1/0<BR><FONT color=#0000ff>D EX 192.168.45.0/24 [170/284160] via 1.1.123.1, 00:01:27, FastEthernet0/0</FONT></FONT></FONT></DIV>
<DIV><BR><FONT face=Arial><FONT size=2>R4#sh ip route<BR>Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP<BR> D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area <BR> N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2<BR> E1 - OSPF external type 1, E2 - OSPF external type 2<BR> i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2<BR> ia - IS-IS inter area, * - candidate default, U - per-user static route<BR> o - ODR, P - periodic downloaded static route</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>Gateway of last resort is not set</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2> 1.0.0.0/8 is variably subnetted, 6 subnets, 2 masks<BR>C 1.1.4.4/32 is directly connected, Loopback0<BR>O 1.1.3.3/32 [110/65] via 1.1.234.3, 00:19:57, Serial1/0<BR>O 1.1.2.2/32 [110/65] via 1.1.234.2, 00:19:57, Serial1/0<BR>O E1 1.1.1.1/32 [110/164] via 1.1.234.3, 00:19:57, Serial1/0<BR> [110/164] via 1.1.234.2, 00:19:57, Serial1/0<BR>O E1 1.1.123.0/24 [110/164] via 1.1.234.3, 00:19:57, Serial1/0<BR> [110/164] via 1.1.234.2, 00:19:57, Serial1/0<BR>C 1.1.234.0/24 is directly connected, Serial1/0<BR></FONT><FONT color=#0000ff size=2>O E1 192.168.45.0/24 [110/164] via 1.1.234.3, 00:12:25, Serial1/0<BR> [110/164] via 1.1.234.2, 00:12:25, Serial1/0</FONT></FONT></DIV>
欢迎光临 兴宁A8 兴宁论坛 兴宁新闻 兴宁人的网络社区 (http://bbs.xna8.com/)
Powered by Discuz! X3.1