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

全部博文(48)

文章存档

2011年(1)

2010年(1)

2009年(46)

我的朋友

分类: 系统运维

2009-06-27 15:50:26

实验目的:

1、掌握如何使用管理距离控制OSPF的默认路由选择。

实验拓扑图:

实验步骤及要求:

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

2、R1与R4路由器的s1/2接口帧中继配置。 

R1(config)#interface serial 1/2

R1(config-if)#encapsulation frame-relay

R1(config-if)#ip ospf network broadcast

R1(config-if)#ip address 172.16.1.1 255.255.255.252

R1(config)#exit

R4(config)#interface serial 1/2

R4(config-if)#encapsulation frame-relay

R4(config-if)#ip ospf network broadcast

R4(config-if)#ip address 172.16.1.2 255.255.255.252

R4(config)#exit

3、按实验拓扑配置各路由器的OSPF协议,注意接口所在不同网络。

4、查看R2的路由表。

R2#show ip route 

Gateway of last resort is not set

     192.168.1.0/30 is subnetted, 2 subnets

C       192.168.1.0 is directly connected, Serial1/0

C       192.168.1.4 is directly connected, Serial1/1

R2#

R2#ping 10.1.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:

.....

Success rate is 0 percent (0/5)

R2#

5、为了能够保证网络通讯,在R1和R3上配置不同协议的路由重发布和OSPF的默认路由。

R1(config)#router rip 

R1(config-router)#redistribute ospf 1 metric 10

R1(config-router)#exit

R1(config)#

R1(config)#router ospf 1

R1(config-router)# default-information originate always 

R1(config-router)#exit

R1(config)#exit

R3(config)#router rip 

R3(config-router)#redistribute ospf 1 metric 10

R3(config-router)#exit

R3(config)#

R3(config)#router ospf 1

R3(config-router)# default-information originate always 

R3(config-router)#exit

R3(config)#exit

R3#

6、再次查看R2路由器路由表并使用ping命令确认路由。

R2#show ip route 

Gateway of last resort is not set

O E2 10.0.0.0/8 [110/20] via 192.168.1.1, 00:01:19, Serial1/0

     192.168.1.0/30 is subnetted, 2 subnets

C       192.168.1.0 is directly connected, Serial1/0

C       192.168.1.4 is directly connected, Serial1/1

O*E2 0.0.0.0/0 [110/1] via 192.168.1.6, 00:01:19, Serial1/1

                  [110/1] via 192.168.1.1, 00:01:19, Serial1/0

R2#

R2#ping 172.16.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 28/82/120 ms

R2#

7、在上面的实验中,R2选择到达非OSPF网络的路由下一跳是R1和R3,并且是均衡负载。而在本实验中,从R1到达非OSPF网络是使用帧中继的网络。从R3到达非OSPF网络是使用100Mbps的快速以太网。因此选择从R3到达外网远比从R1到达非OSPF网络要好。也即是最佳最路由。

8、为了解决这个问题,在通告默认路由时可以采用定制度量的参数,来影响路由器选择最佳路由。可以在R1和R3上进行如下配置。

R1(config)#router ospf 1

R1(config-router)#default-information originate always metric 100

R1(config-router)#exit

R3(config)#router ospf 1

R3(config-router)#default-information originate always metric 50

R3(config-router)#exit

9、再次查看R2的路由表。

R2#show ip route 

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route

Gateway of last resort is 192.168.1.6 to network 0.0.0.0

O E2 10.0.0.0/8 [110/20] via 192.168.1.1, 00:08:05, Serial1/0

     192.168.1.0/30 is subnetted, 2 subnets

C       192.168.1.0 is directly connected, Serial1/0

C       192.168.1.4 is directly connected, Serial1/1

O*E2 0.0.0.0/0 [110/50] via 192.168.1.6, 00:00:32, Serial1/1

R2#

10、此时非最佳路由的问题已经解决。其实更准确的说,是通过控制OSPF的默认路由的度量值,来影响OSPF路由器选择最佳路由。

11、实验完成。

阅读(785) | 评论(0) | 转发(0) |
0

上一篇:无题

下一篇:Configuring OSPF Stub Area

给主人留下些什么吧!~~