网络原理实验报告路由器.docx
《网络原理实验报告路由器.docx》由会员分享,可在线阅读,更多相关《网络原理实验报告路由器.docx(12页珍藏版)》请在冰豆网上搜索。
![网络原理实验报告路由器.docx](https://file1.bdocx.com/fileroot1/2023-1/10/256bb686-0226-42db-87ef-768424d79cab/256bb686-0226-42db-87ef-768424d79cab1.gif)
网络原理实验报告路由器
网络拓扑结构以及端口,主机配置
1:
添加模块:
默认情况下,路由器的电源是打开的,添加模块时需要关闭路由器的电源,单击图一箭头所指的电源开关,将其关闭,路由器的电源关闭后绿色的电源指示灯也将变暗。
2:
在“MODULES”下寻找所需要的模块,选中某个模块时会在下方显示该模块的信息:
然后拖到路由器的空插槽上即可,添加完后即可加上电源。
3:
用其RS-232与路由器的Console端口相连和电脑相连
Router0和Router1之间的为192.168.5.0网络
Router1和Router2之间的为192.168.6.0网络
拓扑图中各个端口主机地址情况:
Router0各个端口配置信息:
Fa0/0IP地址192.168.1.254(网络192.168.1.0的网关地址)
Fa0/1IP地址192.168.2.254(网络192.168.2.0的网关地址)
Se1/0IP地址192.168.5.1
Router1各个端口配置信息:
Fa0/0IP地址192.168.3.254(网络192.168.3.0的网关地址)
Se1/0IP地址192.168.5.2
Se1/1IP地址192.168.6.1
Router2各个端口配置信息:
Fa0/0IP地址192.168.4.254(网络192.168.4.0的网关地址)
Se1/0IP地址192.168.6.2
配置计算机1IP:
如图配置的为192.168.1.1主机的IP,子网掩码,网关。
其他主机配置步骤类似。
(网关默认为网络的最后一个地址,即254)
配置Router0Se及fa口命令行:
Router>en
Router#conft
Router(config)#intfa0/0
Router(config-if)#ipaddress192.168.1.254255.255.255.0
Router(config-if)#noshutdown
Router(config-if)#exit
Router(config)#intfa0/1
Router(config-if)#ipaddress192.168.2.254255.255.255.0
Router(config-if)#noshutdown
Router(config-if)#exit
Router(config)#intse1/0
Router(config-if)#ipaddress192.168.5.1255.255.255.0
Router(config-if)#clockrate38400
Router(config-if)#noshutdown
配置Router1Se及fa口命令行:
Router>en
Router#conft
Router(config)#intfa0/0
Router(config-if)#ipaddress192.168.3.254255.255.255.0
Router(config-if)#noshutdown
Router(config-if)#exit
Router(config)#intse1/1
Router(config-if)#ipaddress192.168.6.1255.255.255.0
Router(config-if)#clockrate38400
Router(config-if)#noshutdown
Router(config-if)#exit
Router(config)#intse1/0
Router(config-if)#ipaddress192.168.5.2255.255.255.0
Router(config-if)#clockrate38400
Router(config-if)#noshutdown
配置Router2Se及fa口命令行:
Router>en
Router#conft
Router(config)#intfa0/0
Router(config-if)#ipaddress192.168.4.254255.255.255.0
Router(config-if)#noshutdown
Router(config-if)#exit
Router(config)#intse1/0
Router(config-if)#ipaddress192.168.6.2255.255.255.0
Router(config-if)#clockrate38400
Router(config-if)#noshutdown
静态路由协议网络配置
根据路由协议必须为每个路由器配置路由表,当前路由器连接网络不用配置,路由表的内容为所连网络到达目的网络需要送到那个IP地址(Se口地址)
Route0配置命令行代码如下:
Router>en
Router#showiproute
配置前路由表信息:
C192.168.1.0/24isdirectlyconnected,FastEthernet0/0
C192.168.2.0/24isdirectlyconnected,FastEthernet0/1
C192.168.5.0/24isdirectlyconnected,Serial1/0
Router#conft
Router(config)#iproute192.168.3.0255.255.255.0192.168.5.2
Router(config)#iproute192.168.4.0255.255.255.0192.168.5.2
Router(config)#iproute192.168.6.0255.255.255.0192.168.5.2
Router(config)#exit
Router#showiproute
配置后路由表信息:
C192.168.1.0/24isdirectlyconnected,FastEthernet0/0
C192.168.2.0/24isdirectlyconnected,FastEthernet0/1
S192.168.3.0/24[1/0]via192.168.5.2
S192.168.4.0/24[1/0]via192.168.5.2
S192.168.6.0/24[1/0]via192.168.5.2
C192.168.5.0/24isdirectlyconnected,Serial1/0
Route1配置命令行代码如下:
Router>en
Router#showiproute
配置前路由表信息:
C192.168.3.0/24isdirectlyconnected,FastEthernet0/0
C192.168.5.0/24isdirectlyconnected,Serial1/0
C192.168.6.0/24isdirectlyconnected,Serial1/1
Router#conft
Router(config)#iproute192.168.1.0255.255.255.0192.168.5.1
Router(config)#iproute192.168.2.0255.255.255.0192.168.5.1
Router(config)#iproute192.168.4.0255.255.255.0192.168.6.2
Router(config)#exit
Router#showiproute
配置后路由表信息:
S192.168.1.0/24[1/0]via192.168.5.1
S192.168.2.0/24[1/0]via192.168.5.1
C192.168.3.0/24isdirectlyconnected,FastEthernet0/0
S192.168.4.0/24[1/0]via192.168.6.2
C192.168.5.0/24isdirectlyconnected,Serial1/0
C192.168.6.0/24isdirectlyconnected,Serial1/1
Route2配置命令行代码如下:
Router>en
Router#showiproute
配置前路由表信息:
C192.168.4.0/24isdirectlyconnected,FastEthernet0/0
C192.168.6.0/24isdirectlyconnected,Serial1/0
Router#conft
Router(config)#iproute192.168.1.0255.255.255.0192.168.6.1
Router(config)#iproute192.168.2.0255.255.255.0192.168.6.1
Router(config)#iproute192.168.3.0255.255.255.0192.168.6.1
Router(config)#iproute192.168.5.0255.255.255.0192.168.6.1
Router(config)#exit
配置后路由表信息
Router#showiproute
S192.168.1.0/24[1/0]via192.168.6.1
S192.168.2.0/24[1/0]via192.168.6.1
S192.168.3.0/24[1/0]via192.168.6.1
S192.168.5.0/24[1/0]via192.168.6.1
C192.168.4.0/24isdirectlyconnected,FastEthernet0/0
C192.168.6.0/24isdirectlyconnected,Serial1/0
配置完路由表后的PING测试结果:
主机192.168.1.1PING192.168.4.1测试
PacketTracerPCCommandLine1.0
PC>ping192.168.4.1
Pinging192.168.4.1with32bytesofdata:
Requesttimedout.
Replyfrom192.168.4.1:
bytes=32time=172msTTL=125
Replyfrom192.168.4.1:
bytes=32time=174msTTL=125
Replyfrom192.168.4.1:
bytes=32time=157msTTL=125
Pingstatisticsfor192.168.4.1:
Packets:
Sent=4,Received=3,Lost=1(25%loss),
Approximateroundtriptimesinmilli-seconds:
Minimum=157ms,Maximum=174ms,Average=167ms
主机192.168.1.1PING192.168.3.1测试
PC>ping192.168.3.1
Pinging192.168.3.1with32bytesofdata:
Requesttimedout.
Replyfrom192.168.3.1:
bytes=32time=141msTTL=126
Replyfrom192.168.3.1:
bytes=32time=156msTTL=126
Replyfrom192.168.3.1:
bytes=32time=140msTTL=126
Pingstatisticsfor192.168.3.1:
Packets:
Sent=4,Received=3,Lost=1(25%loss),
Approximateroundtriptimesinmilli-seconds:
Minimum=140ms,Maximum=156ms,Average=145ms
经过测试发现局域网里已经配置联通,可以正常通信。
RIP由协议网络配置
配置Router0的RIP协议的命令行:
Router>EN
Router#RIP
Router#conft
Router(config)#routerrip
Router(config-router)#network192.168.1.0
Router(config-router)#network192.168.2.0
Router(config-router)#network192.168.5.0
Router(config-router)#exit
Router(config)#exit
由于配置第一路由器根据RIP工作原理,表中无RIP协议数据,等其他临近路由器配置完成后会根据算法自动添加。
配置Router1的RIP协议的命令行:
Router>en
Router#conft
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
Router(config)#routerrip
Router(config-router)#network192.168.5.0
Router(config-router)#network192.168.3.0
Router(config-router)#network192.168.6.0
Router(config-router)#exit
Router(config)#exit
Router#showiproute
配置后的路由表信息:
R192.168.1.0/24[120/1]via192.168.5.1,00:
00:
01,Serial1/0
R192.168.2.0/24[120/1]via192.168.5.1,00:
00:
01,Serial1/0
C192.168.3.0/24isdirectlyconnected,FastEthernet0/0
C192.168.5.0/24isdirectlyconnected,Serial1/0
C192.168.6.0/24isdirectlyconnected,Serial1/1
配置Router2的RIP协议的命令行:
Router>en
Router#conft
Router(config)#routerrip
Router(config-router)#network192.168.5.0
Router(config-router)#network192.168.3.0
Router(config-router)#network192.168.6.0
Router(config-router)#exit
Router(config)#exit
Router#showiproute
配置后的路由表信息:
R192.168.1.0/24[120/1]via192.168.5.1,00:
00:
01,Serial1/0
R192.168.2.0/24[120/1]via192.168.5.1,00:
00:
01,Serial1/0
C192.168.3.0/24isdirectlyconnected,FastEthernet0/0
C192.168.5.0/24isdirectlyconnected,Serial1/0
C192.168.6.0/24isdirectlyconnected,Serial1/1
配置完RIP后的PING测试结果:
主机192.168.4.1PING192.168.1.1测试
PC>ping192.168.1.1
Pinging192.168.1.1with32bytesofdata:
Requesttimedout.
Replyfrom192.168.1.1:
bytes=32time=172msTTL=125
Replyfrom192.168.1.1:
bytes=32time=172msTTL=125
Replyfrom192.168.1.1:
bytes=32time=172msTTL=125
Pingstatisticsfor192.168.1.1:
Packets:
Sent=4,Received=3,Lost=1(25%loss),
Approximateroundtriptimesinmilli-seconds:
Minimum=172ms,Maximum=172ms,Average=172ms
主机192.168.4.1PING192.168.3.1测试
PC>ping192.168.3.1
Pinging192.168.3.1with32bytesofdata:
Requesttimedout.
Replyfrom192.168.3.1:
bytes=32time=141msTTL=126
Replyfrom192.168.3.1:
bytes=32time=109msTTL=126
Replyfrom192.168.3.1:
bytes=32time=109msTTL=126
Pingstatisticsfor192.168.3.1:
Packets:
Sent=4,Received=3,Lost=1(25%loss),
Approximateroundtriptimesinmilli-seconds:
Minimum=109ms,Maximum=141ms,Average=119ms
经过测试发现局域网里已经配置联通,可以正常通信。
OSPF路由协议网络配置
配置Router0的OSPF协议的命令行:
Router>en
Router#conft
Router(config)#routerospf1
Router(config-router)#network192.168.1.00.0.0.255area0
Router(config-router)#network192.168.2.00.0.0.255area0
Router(config-router)#network192.168.5.00.0.0.255area0
Router(config-router)#exit
Router(config)#exit
Router#showiproute
配置后路由表信息:
由于配置第一路由器根据OSPF工作原理,表中无OSPF协议数据,等其他临近路由器配置完成后会根据算法自动添加。
C192.168.1.0/24isdirectlyconnected,FastEthernet0/0
C192.168.2.0/24isdirectlyconnected,FastEthernet0/1
C192.168.5.0/24isdirectlyconnected,Serial1/0
配置Router1的OSPF协议的命令行:
Router>en
Router#conft
Router(config)#routerospf1
Router(config-router)#network192.168.5.00.0.0.255area0
Router(config-router)#network192.168.6.00.0.0.255area0
Router(config-router)#network192.168.3.00.0.0.255area0
Router(config-router)#exit
Router(config)#exit
Router#showiproute
配置后路由表信息:
O192.168.1.0/24[110/782]via192.168.5.1,00:
01:
58,Serial1/0
O192.168.2.0/24[110/782]via192.168.5.1,00:
01:
58,Serial1/0
C192.168.3.0/24isdirectlyconnected,FastEthernet0/0
C192.168.5.0/24isdirectlyconnected,Serial1/0
C192.168.6.0/24isdirectlyconnected,Serial1/1
配置Router2的OSPF协议的命令行:
Router>en
Router#showiproute
配置前路由表信息:
C192.168.4.0/24isdirectlyconnected,FastEthernet0/0
C192.168.6.0/24isdirectlyconnected,Serial1/0
Router#conft
Router(config)#routerospf1
Router(config-router)#network192.168.4.00.0.0.255area0
Router(config-router)#network192.168.6.00.0.0.255area0
Router(config)#exit
Router#showiproute
配置后路由表信息:
O192.168.1.0/24[110/1563]via192.168.6.1,00:
00:
06,Serial1/0
O192.168.2.0/24[110/1563]via192.168.6.1,00:
00:
06,Serial1/0
O192.168.3.0/24[110/782]via192.168.6.1,00:
00:
06,Serial1/0
C192.168.4.0/24isdirectlyconnected,FastEthernet0/0
O192.168.5.0/24[110/1562]via192.168.6.1,00:
00:
06,Serial1/0
C192.168.6.0/24isdirectlyconnected,Serial1/0
配置完OSPF后的PING测试结果:
主机192.168.4.1PING192.168.1.1测试
PC>ping192.