Cisco路由器静态路由和默认路由的配置
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
实验四 Cisco路由器静态路由和默认路由的配置(验证性)(2学时)
一、实验目的
1.进一步熟悉Cisco路由器的配置环境
2.掌握Cisco路由器静态路由的配置方法
3.掌握Cisco路由器默认路由的配置方法
二、实验内容
(一)静态路由的配置
建立如上所示的拓扑结构,现在需要完成的就是让HostA能和HostB互相ping通。
具体配置如下:
router1的配置:
Press Enter to Start
Router>
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname router1
router1(config)#interface e0
router1(config-if)#ip address 192.168.1.2 255.255.255.0
router1(config-if)#no shut
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
router1(config-if)#interface s0
router1(config-if)#ip address 192.168.2.1 255.255.255.0
router1(config-if)#clock rate 6400 //clock rate是dce设备给dte设备提供时钟频率的,需要在dce里面设置,而另外的一个路由器里面则不用设置
router1(config-if)#no shut
%LINK-3-UPDOWN: Interface Serial0, changed state to up
router1(config-if)#end
%LINK-3-UPDOWN: Interface Serial0, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down
router1#config t
Enter configuration commands, one per line. End with CNTL/Z.
router1(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.1 //设定静态路由
router1(config)#ip route 192.168.2.0 255.255.255.0 192.168.2.1
router1(config)#end
router1#copy running startup
Destination filename [startup-config]?
Building configuration...
[OK]
%LINK-3-UPDOWN: Interface Serial0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up
router2的配置:
Press Enter to Start
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface e0
Router(config-if)#end
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname router2
router2(config)#interface s0
router2(config-if)#ip address 192.168.2.2 255.255.255.0
router2(config-if)#no shut
%LINK-3-UPDOWN: Interface Serial0, changed state to up
router2(config-if)#interface s0
router2(config-if)#interface e0
router2(config-if)#ip address 192.168.3.1 255.255.255.0
router2(config-if)#no shut
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
router2(config-if)#end
router2#config t
Enter configuration commands, one per line. End with CNTL/Z.
router2(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.2
router2(config)#ip route 192.168.2.0 255.255.255.0 192.168.2.2
router2(config)#end
router2#copy running startup
Destination filename [startup-config]?
Building configuration...
[OK]
router2#ping 192.168.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
router2#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
router2#ping 192.168.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms //路由器之间试ping 一下,应该可以ping通,接下来配pc
pc1的配置如下:
Boson BOSS 5.0
Copyright 1998-2003 Boson Software, Inc.
Use the command help to get started
Press Enter to begin
C:>ipconfig /ip 192.168.1.1 255.255.255.0 //此时尚未指定网关
C:>ping 192.168.2.1
Pinging 192.168.2.1 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.2.1:
Packets: Sent = 5, Received = 0, Lost = 5 (100% loss), //未指定网关时不能ping通router1的s0
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:>ipconfig /dg 192.168.1.2 //指定网关为与本机直连的router1的e0口