Chinaunix首页 | 论坛 | 博客
  • 博客访问: 214138
  • 博文数量: 48
  • 博客积分: 4011
  • 博客等级: 上校
  • 技术积分: 695
  • 用 户 组: 普通用户
  • 注册时间: 2009-06-26 17:15
文章分类

全部博文(48)

文章存档

2011年(1)

2010年(1)

2009年(46)

我的朋友

分类: 系统运维

2009-06-29 21:03:13

实验目的:

1、掌握通过修改管理距离解决重发布选择次佳路由问题。

实验拓扑图:

实验步骤及要求:

1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。

2、按照拓扑配置RIP和OSPF的路由协议。

3、查看R2和R5的路由表:

R2#show ip route 

Gateway of last resort is not set

     172.16.0.0/30 is subnetted, 3 subnets

C       172.16.255.0 is directly connected, Serial1/1

O       172.16.255.4 [110/128] via 172.16.255.2, 00:01:44, Serial1/1

O       172.16.255.8 [110/192] via 172.16.255.2, 00:01:44, Serial1/1

R    10.0.0.0/8 [120/1] via 192.168.1.1, 00:00:21, Serial1/0

C    192.168.1.0/24 is directly connected, Serial1/0

O E2 192.168.2.0/24 [110/200] via 172.16.255.2, 00:01:44, Serial1/1

R2#

R5#show ip route 

Gateway of last resort is not set

     172.16.0.0/30 is subnetted, 3 subnets

O       172.16.255.0 [110/192] via 172.16.255.9, 00:02:08, Serial1/0

O       172.16.255.4 [110/128] via 172.16.255.9, 00:02:08, Serial1/0

C       172.16.255.8 is directly connected, Serial1/0

O E2 10.0.0.0/8 [110/200] via 172.16.255.9, 00:02:08, Serial1/0

O E2 192.168.1.0/24 [110/200] via 172.16.255.9, 00:02:08, Serial1/0

C    192.168.2.0/24 is directly connected, FastEthernet0/0

R5#

4、通过观察两台路由器的路表,可以看出R5路由器到达10.0.0.0/8的网络并不是直接通过R1路由器,而是通过R4-->R3-->R2-->R1-->10.0.0.0/8。通过拓扑可以看出,此条路由并不是最佳的路由。产生此问题的最主要的原因是:因为在R2路由器上配置路由重发布,R2将10.0.0.0/8网络通告给其它的路由器时,其重发布路由的管理距离是110,即OSPF的管理距离。当此条路由到达R5上时,R5会比较RIP与OSPF的管理距离后,再决定采用谁的路由。因此造成了R5认为到达10.0.0.0/8网络最佳路由是通过OSPF的区域。而不是直接选择从R1到达。是因为:管理距离决定路由器选择何种路由协议产生的路由。

5、为了解决此问题,我们可以通过修改本地某条路由的管理距离来强制路由器选择最佳路由,配置如下:

R5(config)#access-list 1 permit 10.0.0.0 0.255.255.255

R5(config)#router rip

R5(config-router)#distance 80 192.168.2.1 0.0.0.0 1

R5(config-router)#exit

R5(config)#exit

6、再次查看R5的路由表:

R5#show ip route 

Gateway of last resort is not set

     172.16.0.0/30 is subnetted, 3 subnets

O       172.16.255.0 [110/192] via 172.16.255.9, 00:00:02, Serial1/0

O       172.16.255.4 [110/128] via 172.16.255.9, 00:00:02, Serial1/0

C       172.16.255.8 is directly connected, Serial1/0

R    10.0.0.0/8 [80/1] via 192.168.2.1, 00:00:02, FastEthernet0/0

O E2 192.168.1.0/24 [110/200] via 172.16.255.9, 00:00:02, Serial1/0

C    192.168.2.0/24 is directly connected, FastEther

7、为了确保网络的稳定,因此建议在R2路由器上也采用相同的配置,进行管理距离值的设定。具体配置请参照第6步。

8、实验完成。

阅读(985) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~