实验三 路由协议.docx

上传人:b****1 文档编号:13358040 上传时间:2023-06-13 格式:DOCX 页数:36 大小:84.73KB
下载 相关 举报
实验三 路由协议.docx_第1页
第1页 / 共36页
实验三 路由协议.docx_第2页
第2页 / 共36页
实验三 路由协议.docx_第3页
第3页 / 共36页
实验三 路由协议.docx_第4页
第4页 / 共36页
实验三 路由协议.docx_第5页
第5页 / 共36页
实验三 路由协议.docx_第6页
第6页 / 共36页
实验三 路由协议.docx_第7页
第7页 / 共36页
实验三 路由协议.docx_第8页
第8页 / 共36页
实验三 路由协议.docx_第9页
第9页 / 共36页
实验三 路由协议.docx_第10页
第10页 / 共36页
实验三 路由协议.docx_第11页
第11页 / 共36页
实验三 路由协议.docx_第12页
第12页 / 共36页
实验三 路由协议.docx_第13页
第13页 / 共36页
实验三 路由协议.docx_第14页
第14页 / 共36页
实验三 路由协议.docx_第15页
第15页 / 共36页
实验三 路由协议.docx_第16页
第16页 / 共36页
实验三 路由协议.docx_第17页
第17页 / 共36页
实验三 路由协议.docx_第18页
第18页 / 共36页
实验三 路由协议.docx_第19页
第19页 / 共36页
实验三 路由协议.docx_第20页
第20页 / 共36页
亲,该文档总共36页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

实验三 路由协议.docx

《实验三 路由协议.docx》由会员分享,可在线阅读,更多相关《实验三 路由协议.docx(36页珍藏版)》请在冰点文库上搜索。

实验三 路由协议.docx

实验三路由协议

实验三路由协议

3.1实验目的:

1.熟悉主机的路由配置;

2.熟悉路由器的路由配置;

3.掌握RIP协议的基本配置;

4.掌握IGRP协议的基本配置;

5.区别以上两种路由协议的特点。

3.2实验环境

实际组网中路由器是用来连接两个物理网络的,为了模拟实际环境,我们在实验中采用背靠背直接相连来模拟广域网连接。

由于时间限制,让我们先完成几个简单的背靠背实验,每个对应一个相对独立的内容。

如果时间充足,可以完成后面的综合性实验,进一步提高动手能力,深层理解路由协议。

下面是简单实验的模拟实验环境,共两台路由器,一台交换机,两台PC。

按照上图的实验组网建立实验环境。

为了不受路由器原来的配置影响,在实验之前请先将所有路由器的配置数据擦除后重新启动。

交换机在此只用作连接主机和路由器用,以便全采用标准网线连接,不需配置。

3.3实验步骤:

3.3.1静态路由

清空路由器的原有配置

Quidway>enable

Quidway#erase

Quidway#reboot

重新启动路由器后,查看初始配置并显示路由表如下:

Quidway#showrunning-config

Nowcreateconfiguration...

Currentconfiguration

!

version1.5.6

!

interfaceAux0

asyncmodeinteractive

encapsulationppp

!

interfaceEthernet0

speedauto

duplexauto

noloopback

!

interfaceSerial0

encapsulationppp

!

interfaceSerial1

encapsulationppp

!

end

Quidway#showiproute

RoutingTables:

Destination/MaskProtoPrefMetricNexthopInterface

127.0.0.0/8Direct00127.0.0.1LoopBack0

127.0.0.1/32Direct00127.0.0.1LoopBack0

配置路由器接口和PC的IP地址

路由器各接口的IP地址如下:

RTA

RTB

E0

202.0.0.1/24

202.0.1.1/24

S0

192.0.0.1/24

192.0.0.2/24

PC的IP地址和缺省网关Gateway如下:

PCA

PCB

IP

202.0.0.2/24

202.0.1.2/24

Gateway

202.0.0.1

202.0.1.1

为了标识路由器,我们修改路由器名称分别为RTA、RTB并按照上述表格完成IP地址的配置之后,再次查看配置信息和路由表信息如下:

RTA#showrunning-config

Nowcreateconfiguration...

Currentconfiguration

!

version1.5.6

hostnameRTA

!

interfaceAux0

asyncmodeinteractive

encapsulationppp

!

interfaceEthernet0

speedauto

duplexauto

noloopback

ipaddress202.0.0.1255.255.255.0

!

interfaceSerial0

encapsulationppp

ipaddress192.0.0.1255.255.255.0

!

interfaceSerial1

encapsulationppp

!

end

RTA(config-if-Serial0)#showiproute

RoutingTables:

Destination/MaskProtoPrefMetricNexthopInterface

127.0.0.0/8Direct00127.0.0.1LoopBack0

127.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.0/24Direct00192.0.0.2Serial0

192.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.2/32Direct00192.0.0.2Serial0

202.0.0.0/24Direct00202.0.0.1Ethernet0

202.0.0.1/32Direct00127.0.0.1LoopBack0

RTB的相关信息类似RTA,可以自己在实验中显示比较。

注意:

串口的配置需要在接口配置模式下完成shutdown和noshutdown命令之后才生效。

完成上述配置之后,用ping命令测试网络互通性,会发现两个以太网段不能互通。

你知道为什么吗?

仔细看看路由表就可以明白,路由器还没有相关的路由项。

在这里我们采用配置静态路由的办法来添加路由。

分别在RTA,RTB上配置到对端以太网段的静态路由,RTA的配置信息和路由表信息如下:

RTA(config)#showrunning-config

Nowcreateconfiguration...

Currentconfiguration

!

version1.5.6

hostnameRTA

!

interfaceAux0

asyncmodeinteractive

encapsulationppp

!

interfaceEthernet0

speedauto

duplexauto

noloopback

ipaddress202.0.0.1255.255.255.0

!

interfaceSerial0

encapsulationppp

ipaddress192.0.0.1255.255.255.0

!

interfaceSerial1

encapsulationppp

!

exit

iproute202.0.1.0255.255.255.0192.0.0.2preference60

!

end

RTA(config)#showiproute

RoutingTables:

Destination/MaskProtoPrefMetricNexthopInterface

127.0.0.0/8Direct00127.0.0.1LoopBack0

127.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.0/24Direct00192.0.0.2Serial0

192.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.2/32Direct00192.0.0.2Serial0

202.0.0.0/24Direct00202.0.0.1Ethernet0

202.0.0.1/32Direct00127.0.0.1LoopBack0

202.0.1.0/24Static600192.0.0.2Serial0

RTB的相关信息类似RTA。

比较前后路由表发现现在新增了一项静态路由,此时再测试网络互通性,可以ping通了吗?

3.3.2RIP协议

在上面的实验基础上,删除静态路由的配置之后再启动RIP协议,显示配置信息和路由表信息如下:

RTA的配置和路由表:

RTA#showrunning-config

Nowcreateconfiguration...

Currentconfiguration

!

version1.5.6

hostnameRTA

!

interfaceAux0

asyncmodeinteractive

encapsulationppp

!

interfaceEthernet0

speedauto

duplexauto

noloopback

ipaddress202.0.0.1255.255.255.0

!

interfaceSerial0

encapsulationppp

ipaddress192.0.0.1255.255.255.0

!

interfaceSerial1

encapsulationppp

!

exit

routerrip

networkall

!

end

RTA#showiproute

RoutingTables:

Destination/MaskProtoPrefMetricNexthopInterface

127.0.0.0/8Direct00127.0.0.1LoopBack0

127.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.0/24Direct00192.0.0.2Serial0

192.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.2/32Direct00192.0.0.2Serial0

202.0.0.0/24Direct00202.0.0.1Ethernet0

202.0.0.1/32Direct00127.0.0.1LoopBack0

202.0.1.0/24RIP1001192.0.0.2Serial0

RTB的配置和路由表:

RTB#showrunning-config

Nowcreateconfiguration...

Currentconfiguration

!

version1.5.6

hostnameRTB

!

interfaceAux0

asyncmodeinteractive

encapsulationppp

!

interfaceEthernet0

speedauto

duplexauto

noloopback

ipaddress202.0.1.1255.255.255.0

!

interfaceSerial0

clock-selectDTECLK1

encapsulationppp

ipaddress192.0.0.2255.255.255.0

!

interfaceSerial1

encapsulationppp

!

exit

routerrip

networkall

!

end

RTB#showiproute

RoutingTables:

Destination/MaskProtoPrefMetricNexthopInterface

127.0.0.0/8Direct00127.0.0.1LoopBack0

127.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.0/24Direct00192.0.0.1Serial0

192.0.0.1/32Direct00192.0.0.1Serial0

192.0.0.2/32Direct00127.0.0.1LoopBack0

202.0.0.0/24RIP1001192.0.0.1Serial0

202.0.1.0/24Direct00202.0.1.1Ethernet0

202.0.1.1/32Direct00127.0.0.1LoopBack0

测试网络互通性,应该是全网互通的。

如果不是,请检查您的配置是否与上面的一致。

现在我们可以看看RIP是怎样发现路由的,再特权模式下打开RIP协议调试开关,有如下信息在路由器之间传递,它们完成了路由的交换,并形成新的路由。

RTA#debugiprippacket//打开RIP协议调试开关;

Rippacketdebuggingison

RTA#configure

Enterconfigurationcommands,oneperline.Endwithcommandexit!

RTA(config)#loggingconsole//使调试信息从console口输出;

RTA(config)#

RIP:

sendfrom192.0.0.1to255.255.255.255(Serial0)

Packet:

vers1,cmdResponse,length24

dest202.0.0.0,Metric1

RIP:

receiveResponsefrom192.0.0.2(Serial0)

Packet:

vers1,cmdResponse,length24

dest202.0.1.0,Metric1

从上面的信息可以看到RIP协议版本为version1,这是华为路由器的默认版本。

可以用ipripversion2mcast命令改变协议版本,再查看debug信息如下:

●RTA#debugiprippacket

Rippacketdebuggingison

RTA#

RIP:

receiveResponsefrom192.0.0.2(Serial0)

Packet:

vers2,cmdResponse,length24

dest202.0.1.0mask255.255.255.0,router0.0.0.0,metric1

RIP:

sendfrom192.0.0.1to224.0.0.9(Serial0)

Packet:

vers2,cmdResponse,length24

dest202.0.0.0mask255.255.255.0,router0.0.0.0,metric1

然后使用ipripversion2bcast命令改变协议报文的发送方式为广播方式,查看debug信息如下:

RTA#debugiprippacket

Rippacketdebuggingison

RTA#

RIP:

receiveResponsefrom192.0.0.2(Serial0)

Packet:

vers2,cmdResponse,length24

dest202.0.1.0mask255.255.255.0,router0.0.0.0,metric1

RIP:

sendfrom192.0.0.1to255.255.255.255(Serial0)

Packet:

vers2,cmdResponse,length24

dest202.0.0.0mask255.255.255.0,router0.0.0.0,metric1

比较以上三种情况的debug信息,能够发现它们的异同吗?

广播地址是什么,组播地址又是什么?

华为路由器的默认状态启动了水平分割功能,在以上配置基础上,关闭水平分割(RTA(config-if-Serial0)#noipripsplit)再看看debug信息有什么变化吗?

RTA#debugiprippacket

Rippacketdebuggingison

RTA#

RIP:

receiveResponsefrom192.0.0.2(Serial0)

Packet:

vers2,cmdResponse,length44

dest202.0.0.0mask255.255.255.0,router0.0.0.0,metric2

dest202.0.1.0mask255.255.255.0,router0.0.0.0,metric1

RIP:

sendfrom192.0.0.1to255.255.255.255(Serial0)

Packet:

vers2,cmdResponse,length44

dest202.0.1.0mask255.255.255.0,router0.0.0.0,metric2

dest202.0.0.0mask255.255.255.0,router0.0.0.0,metric1

我们比较发现关闭水平分割时,交换的路由信息增加了,这就是水平分割的作用。

水平分割规定不能将从某一网关送来的路由信息再送回此网关,这就是为什么关闭水平分割时交换的路由信息增加了。

下面我们再来理解验证路由器的自动聚合功能。

先修改各路由器的E0口的IP地址如下:

RTA

RTB

E0

10.0.1.1/24

10.0.2.1/24

显示路由器配置信息和路由表信息如下:

RTA#showrunning-config

Nowcreateconfiguration...

Currentconfiguration

!

version1.5.6

loggingconsole

hostnameRTA

!

interfaceAux0

asyncmodeinteractive

encapsulationppp

!

interfaceEthernet0

speedauto

duplexauto

noloopback

ipaddress10.0.1.1255.255.255.0

!

interfaceSerial0

encapsulationppp

ipaddress192.0.0.1255.255.255.0

ipripversion2bcast

!

interfaceSerial1

encapsulationppp

!

exit

routerrip

networkall

!

end

RTA#showiproute

RoutingTables:

Destination/MaskProtoPrefMetricNexthopInterface

10.0.1.0/24Direct0010.0.1.1Ethernet0

10.0.1.1/32Direct00127.0.0.1LoopBack0

127.0.0.0/8Direct00127.0.0.1LoopBack0

127.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.0/24Direct00192.0.0.2Serial0

192.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.2/32Direct00192.0.0.2Serial0

然后在协议配置模式下关闭自动聚合功能,显示路由表信息如下:

RTA(config-router-rip)#noauto-summary

RTA(config-router-rip)#showiproute

RoutingTables:

Destination/MaskProtoPrefMetricNexthopInterface

10.0.1.0/24Direct0010.0.1.1Ethernet0

10.0.1.1/32Direct00127.0.0.1LoopBack0

10.0.2.0/24RIP1001192.0.0.2Serial0

127.0.0.0/8Direct00127.0.0.1LoopBack0

127.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.0/24Direct00192.0.0.2Serial0

192.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.2/32Direct00192.0.0.2Serial0

比较前后两次的路由表信息,会发现关闭自动聚合功能时增加了一条动态路由,知道为什么吗?

然后改变协议版本(ipripversion1)并使之生效,并在关闭和启动自动聚合功能下显示路由表信息会发现都没有动态路由项产生,知道为什么吗?

因为version1不支持可变长子网掩码,而10.0.1.1与10.0.2.1属于A类地址,自然掩码为8位,属于同一网段的地址。

路由表信息如下:

RTA(config-if-Serial0)#shoiproute

RoutingTables:

Destination/MaskProtoPrefMetricNexthopInterface

10.0.1.0/24Direct0010.0.1.1Ethernet0

10.0.1.1/32Direct00127.0.0.1LoopBack0

127.0.0.0/8Direct00127.0.0.1LoopBack0

127.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.0/24Direct00192.0.0.2Serial0

192.0.0.1/32Direct00127.0.0.1LoopBack0

192.0.0.2/32Direct00192.0.0.2Serial0

你还可以在接口配置模式下配置命令ipripversion2mcast后,显示路由表信息看看又是什么情况。

比较上述几种情况下的路由信息,总结version1和version2的异同,mcast和bcast的异同以及水平分割和自动聚合的功能。

3.3.3IGRP协议

IGRP协议是RIP协议的改进型距离矢量路由协议,但它有更加准确的综合路有权,适用于更大的网络。

下面我们就来研究一下IGRP协议,实验环境同上,将路由器和PC的配置恢复到做RIP协议实验之前的配置。

然后启动IGRP协议,显示路由器的配置信息和路由表信息如下:

RTA的相关信息:

RTA#showrunning-config

Nowcreateconfiguration...

Currentconfiguration

!

version1.5.6

loggin

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 幼儿教育 > 幼儿读物

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2