网络实验报告1 2.docx

上传人:b****5 文档编号:11576616 上传时间:2023-03-19 格式:DOCX 页数:12 大小:140.92KB
下载 相关 举报
网络实验报告1 2.docx_第1页
第1页 / 共12页
网络实验报告1 2.docx_第2页
第2页 / 共12页
网络实验报告1 2.docx_第3页
第3页 / 共12页
网络实验报告1 2.docx_第4页
第4页 / 共12页
网络实验报告1 2.docx_第5页
第5页 / 共12页
点击查看更多>>
下载资源
资源描述

网络实验报告1 2.docx

《网络实验报告1 2.docx》由会员分享,可在线阅读,更多相关《网络实验报告1 2.docx(12页珍藏版)》请在冰豆网上搜索。

网络实验报告1 2.docx

网络实验报告12

实验四路由器配置

实验题目:

路由器配置

实验学时:

2学时

实验目的:

1、熟悉PacketTracer5.0环境,学会用该软件配置路由器

2、掌握路由器的配置方法

3、掌握RIP协议和静态路由的配置方法

实验环境:

一台计算机,Internet环境,PacketTracer5.0

实验要求:

1、熟悉路由器的基本配置

2、掌握静态路由、RIP配置方法

实验步骤:

1、路由器的基本配置

(1)路由器命令模式

●用户模式“Router>”:

在该模式下,用户只有最低访问权限,可以查看路由器的当前连接状态,访问其他网络和主机,但不能看到和转发路由器的设置内容。

●特权模式“Router#”:

在用户模式下,输入“enable”命令即可进入特权模式。

在该模式下,用户能够使用命令查看路由器配置的内容和对路由器进行测试。

●全局模式“Router(config)”:

在特权模式下,输入“configureterminal”命令,进入全局模式。

此时,用户可以配置路由器的全部参数。

(2)路由器常用命令

●配置路由器名称Router2

hostnameROUTERNAME!

把设备的名称修改为ROUTERNAME

●显示命令

Showiproute!

显示路由配置命令

2、静态路由配置

图1静态路由.拓扑图

(1)分别配置两台路由器的接口地址。

---SystemConfigurationDialog---

Continuewithconfigurationdialog?

[yes/no]:

no

 

PressRETURNtogetstarted!

 

Router>enable

Router#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#interfacefa1/0

Router(config-if)#ipaddress172.16.1.1255.255.255.0

Router(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet1/0,changedstatetoup

%LINEPROTO-5-UPDOWN:

LineprotocolonInterfaceFastEthernet1/0,changedstatetoup

Router(config-if)#exit

Router(config)#interfacefa0/0

Router(config-if)#ipaddress172.16.21.1255.255.255.0

Router(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet0/0,changedstatetoup

Router(config-if)#exit

Router(config)#exit

%SYS-5-CONFIG_I:

Configuredfromconsolebyconsole

Router#

图2配置路由器R1的接口地址

---SystemConfigurationDialog---

Continuewithconfigurationdialog?

[yes/no]:

no

 

PressRETURNtogetstarted!

 

Router>enable

Router#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#interfacefa1/0

Router(config-if)#ipaddress172.16.2.1255.255.255.0

Router(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet1/0,changedstatetoup

%LINEPROTO-5-UPDOWN:

LineprotocolonInterfaceFastEthernet1/0,changedstatetoup

Router(config-if)#exit

Router(config)#interfacefa0/0

Router(config-if)#ipaddress172.16.21.2255.255.255.0

Router(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet0/0,changedstatetoup

%LINEPROTO-5-UPDOWN:

LineprotocolonInterfaceFastEthernet0/0,changedstatetoup

Router(config-if)#exit

Router(config)#exit

%SYS-5-CONFIG_I:

Configuredfromconsolebyconsole

Router#

图3配置路由器R2的接口地址

(2)配置静态路由

其格式如下:

Router(config)#iproute[网络编号][子网掩码][转发路由器的IP地址],即第一个地址为目标网段地址,

第二个地址为子网掩码,

第三个地址为下一跳地址

Router#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#iproute172.16.2.0255.255.255.0172.16.21.2

Router(config)#exit

%SYS-5-CONFIG_I:

Configuredfromconsolebyconsole

Router#showiproute

Codes:

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

D-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterarea

N1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2

E1-OSPFexternaltype1,E2-OSPFexternaltype2,E-EGP

i-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,ia-IS-ISinterarea

*-candidatedefault,U-per-userstaticroute,o-ODR

P-periodicdownloadedstaticroute

Gatewayoflastresortisnotset

172.16.0.0/24issubnetted,3subnets

C172.16.1.0isdirectlyconnected,FastEthernet1/0

S172.16.2.0[1/0]via172.16.21.2

C172.16.21.0isdirectlyconnected,FastEthernet0/0

Router#

图4路由器R1配置静态路由

Router#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#iproute172.16.1.0255.255.255.0172.16.21.1

Router(config)#exit

%SYS-5-CONFIG_I:

Configuredfromconsolebyconsole

Router#showiproute

Codes:

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

D-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterarea

N1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2

E1-OSPFexternaltype1,E2-OSPFexternaltype2,E-EGP

i-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,ia-IS-ISinterarea

*-candidatedefault,U-per-userstaticroute,o-ODR

P-periodicdownloadedstaticroute

Gatewayoflastresortisnotset

172.16.0.0/24issubnetted,3subnets

S172.16.1.0[1/0]via172.16.21.1

C172.16.2.0isdirectlyconnected,FastEthernet1/0

C172.16.21.0isdirectlyconnected,FastEthernet0/0

Router#

图5路由器R2配置静态路由

注意:

在网络工程中,为了使网络按照预定的设计工作,通常要为重要的干线路由器配置静态路由。

由于在路由器中静态路由优先于动态路由,因此一台配置了静态路由的路由器,无论是否配置动态选路协议,再路由器都按照静态路由来转发分组。

只有当该路由器配置静态路由的端口出现故障,才会按照动态协议给出的路由进行转发。

3、RIP配置

图6RIP拓扑图

(1)分别为三台路由器配置端口IP地址

Router>enable

Router#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#hostnamer1

r1(config)#interfacefa1/0

r1(config-if)#ipaddress30.0.0.1255.255.255.0

r1(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet1/0,changedstatetoup

%LINEPROTO-5-UPDOWN:

LineprotocolonInterfaceFastEthernet1/0,changedstatetoup

r1(config-if)#exit

r1(config)#interfacefa0/0

r1(config-if)#ipaddres40.0.0.1255.255.255.0

r1(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet0/0,changedstatetoup

r1(config-if)#exit

r1(config)#

图7路由器R1配置

Router>enable

Router#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#hostnamer2

r2(config)#interfacefa0/0

r2(config-if)#ipaddress40.0.0.2255.255.255.0

r2(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet0/0,changedstatetoup

%LINEPROTO-5-UPDOWN:

LineprotocolonInterfaceFastEthernet0/0,changedstatetoup

r2(config-if)#exit

r2(config)#interfacefa1/0

r2(config-if)#ipaddress128.1.0.1255.255.255.0

r2(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet1/0,changedstatetoup

r2(config-if)#exit

r2(config)#

图8路由器R2配置

Router>enable

Router#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#hostnamer3

r3(config)#interfacefa0/0

r3(config-if)#ipaddress128.1.0.2255.255.255.0

r3(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet0/0,changedstatetoup

%LINEPROTO-5-UPDOWN:

LineprotocolonInterfaceFastEthernet0/0,changedstatetoup

r3(config-if)#exit

r3(config)#interfacefa1/0

r3(config-if)#ipaddress192.4.48.1255.255.255.0

r3(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet1/0,changedstatetoup

%LINEPROTO-5-UPDOWN:

LineprotocolonInterfaceFastEthernet1/0,changedstatetoup

r3(config-if)#exit

r3(config)#

图9路由器R3配置

 

(2)分别为三台路由器配置RIP协议

首先要启用RIP选路协议,并指定版本号为2,再定义与RIP路由进程关联的网络。

r1(config)#routerip

r1(config-router)#version2

r1(config-router)#network30.0.0.0

r1(config-router)#network40.0.0.0

图10R1配置静态路由

r2(config)#routerip

r2(config-router)#version2

r2(config-router)#network40.0.0.0

r2(config-router)#network128.1.0.0

图11R2配置静态路由

r3(config)#routerip

r3(config-router)#version2

r3(config-router)#network128.1.0.0

r3(config-router)#network192.4.48.0

图12R3配置静态路由

4、OSPF配置

图13OSPF拓扑图

(1)分别给两台路由器配置端口地址

Router>en

Router#confter

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#hostnamer1

r1(config)#intfa1/0

r1(config-if)#ipaddress192.168.1.1255.255.255.0

r1(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet1/0,changedstatetoup

%LINEPROTO-5-UPDOWN:

LineprotocolonInterfaceFastEthernet1/0,changedstatetoup

r1(config-if)#exit

r1(config)#intfa0/0

r1(config-if)#ipaddress192.168.2.1255.255.255.0

r1(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet0/0,changedstatetoup

r1(config-if)#exit

r1(config)#

图14R1配置端口地址

Router>en

Router#confter

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#hostnamer2

r2(config)#intfa1/0

r2(config-if)#ipaddress192.168.3.1255.255.255.0

r2(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet1/0,changedstatetoup

%LINEPROTO-5-UPDOWN:

LineprotocolonInterfaceFastEthernet1/0,changedstatetoup

r2(config-if)#exit

r2(config)#intfa0/0

r2(config-if)#ipaddress192.168.2.2255.255.255.0

r2(config-if)#noshutdown

%LINK-5-CHANGED:

InterfaceFastEthernet0/0,changedstatetoup

%LINEPROTO-5-UPDOWN:

LineprotocolonInterfaceFastEthernet0/0,changedstatetoup

r2(config-if)#exit

r2(config)#

图15R2配置端口地址

(2)分别给两台路由器配置OSPF协议

其格式如下:

Router(config)#network[网络编号][反掩码]areaID,

即第一个地址为相邻网段地址,第二个地址为反掩码。

r1(config)#routerospf1

r1(config-router)#network192.168.1.00.0.0.255area0

r1(config-router)#network192.168.2.00.0.0.255area0

r1(config-router)#exit

r1(config)#

图16R1配置OSPF协议

r2(config)#routerospf1

r2(config-router)#network192.168.2.00.0.0.255area0

r2(config-router)#network192.168.3.00.0.0.255area0

00:

15:

56:

%OSPF-5-ADJCHG:

Process1,Nbr192.168.2.1onFastEthernet0/0fromLOADINGtoFULL,LoadingDone

r2(config-router)#end

%SYS-5-CONFIG_I:

Configuredfromconsolebyconsole

r2#

图17R2配置OSPF协议

实验总结:

通过这次实验我熟悉了PacketTracer5.0环境,学会了用该软件配置路由器;对静态路由的配置有所了解;网关的设置,ping通过两个路由器的主机,对其有了基本的掌握.

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

当前位置:首页 > 人文社科 > 教育学心理学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1