实验1-Cisco路由器基本配置+静态路由+广域网连接
Cisco路由器静态路由设计实验报告

一、实训目的(1)掌握Cisco路由器静态路由设计和配置方法。
(2)掌握Cisco路由器默认路由的配置方法。
二、实验环境(1)每组一台路由器、1~3台微机、一根Console电缆、一根交叉双绞线(2)前后组结合,通过一对DTE/DCE电缆将串口相连。
(3)实验环境可参见图:R3以太网口F0/0的IP地址:192.16.8.1.1F0/1的IP地址:192.16.8.3.1 R4以太网口F0/0的IP地址:192.16.8.3.2 F0/1的IP地址:192.16.8.2.1三、实验内容Router3的配置:Continue with configuration dialog? [yes/no]: nPress RETURN to get started!Router>enableRouter#config terEnter configuration commands, one per line. End with CNTL/Z.Router(config)#interface f0/0Router(config-if)#ip add 192.168.1.1 255.255.255.0Router(config-if)#no shutdown%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to upRouter(config-if)#exitRouter(config)#interface f0/1Router(config-if)#ip add 192.168.3.1 255.255.255.0Router(config-if)#no shutRouter4的配置:Continue with configuration dialog? [yes/no]: nPress RETURN to get started!Router>enableRouter#config terEnter configuration commands, one per line. End with CNTL/Z.Router(config)#interface f0/0Router(config-if)#ip add 192.168.3.2 255.255.255.0Router(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upRouter(config-if)#exitRouter(config)#inter f0/1Router(config-if)#ip add 192.168.2.1 255.255.255.0Router(config-if)#no shut注意事项:(1)严禁带电插、拔串口电缆。
Cisco路由器配置实例(经典)

实训报告实训一路由基本配置1、实验目的:路由器基本配置及ip设置2、拓扑结构图Router0 fa0/0: 192.168.11.1Fa0/1:192.168.1.1Router1 fa0/0: 192.168.11.2Fa0/1:192.168.2.1Znn1:192.168.1.2Znn2:192.168.2.23、实验步骤Router1Router>en 用户模式进入特权模式Router#conf t 特权模式进入全局模式Enter configuration commands, one per line. End with CNTL/Z.Router(config)#host rznn1 改名字为rznn1rznn1(config)#int fa0/0 进入fa0/0端口rznn1(config-if)#ip add 192.168.11.1 255.255.255.0 设置ip地址rznn1(config-if)#no sh 激活rznn1(config)#int fa0/1rznn1(config-if)#ip add 192.168.1.1 255.255.255.0rznn1(config-if)#no shrznn1(config-if)#exitrznn1(config)#exitrznn1#copy running-config startup-config 保存Destination filename [startup-config]? startup-configrznn1#conf trznn1(config)#enable secret password 222 设置密文rznn1#show ip interface b 显示Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.1 YES manual up up FastEthernet0/1 192.168.1.1 YES manual up upVlan1 unassigned YES manual administratively down downrouter 2outer>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host rznn2rznn2(config)#int fa0/0rznn2(config-if)#ip add 192.168.11.2 255.255.255.0rznn2(config-if)#no shrznn2(config)#int fa0/1rznn2(config-if)#ip add 192.168.2.1 255.255.255.0rznn2(config-if)#no shRznn2#copy running-config startup-config 保存Destination filename [startup-config]? startup-configrznn2(config-if)#exitrznn2(config)#exitrznn2#conf trznn2(config)#enable secret 222rznn2#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.2 YES manual up up FastEthernet0/1 192.168.2.1 YES manual up upVlan1 unassigned YES manual administratively down down实训二1、远程登录、密码设置及验证为路由器开设telnet端口,PC机可以远程登陆到Rznn3(Router 1)拓扑结构图Router0:192.168.1.1Pc:192.168.1.2步骤rznn3>rznn3>enrznn3#conf tEnter configuration commands, one per line. End with CNTL/Z.rznn3(config)#no ip domain lookuprznn3(config)#line cons 0rznn3(config-line)#password znnrznn3(config-line)#loginrznn3(config-line)#no exec-trznn3(config-line)#logg syncrznn3(config-line)#exitrznn3(config)#int fa0/0rznn3(config-if)#ip add 192.168.1.1 255.255.255.0rznn3(config-if)#no shrznn3(config-if)#exitrznn3(config)#line vty 0 4 打通五个端口rznn3(config-line)#password cisco 设置密码rznn3(config-line)#login 保存rznn3(config-line)#exit4、测试:实训三命令组1、目的:八条命令(no ip domain lookup\line cons 0\password\login\no exec-t\logg sync\show version\reload\copy running-config startup-config)\show cdp neighbors)2、拓扑结构图Router0 fa0/0: 192.168.11.1Router1 fa0/0: 192.168.11.23、步骤rznn1#conf tEnter configuration commands, one per line. End with CNTL/Z.1、rznn1(config)#no ip domain lookup 取消域名查找转换2、rznn1(config)#line cons 0 打开cons 0端口3、rznn1(config-line)#password znn 设置密码为znnrznn1(config-line)#login 保存rznn1(config-line)#no exec-t 设置永不超时4、rznn1(config-line)#logg sync 产生日志5、rznn1#show version 显示思科路由系统版本信息Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)Technical Support: /techsupportCopyright (c) 1986-2007 by Cisco Systems, Inc.Compiled Wed 18-Jul-07 06:21 by pt_rel_team6、rznn1#show cdp neighbors 查看路由器连接的相邻路由器的相关信息Capability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDrznn2 Fas 0/0 139 R C2800 Fas 0/07、rznn1#copy running-config startup-config 保存刚才指令Destination filename [startup-config]? startup-configBuilding configuration...[OK]8、rznn1#reload 重启路由器Proceed with reload? [confirm]System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)Copyright (c) 2000 by cisco Systems, Inc.cisco 2811 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memorySelf decompressing the image :########################################################################## [OK] Restricted Rights Legendrznn1#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.1 YES manual up up FastEthernet0/1 192.168.1.1 YES manual up upVlan1 unassigned YES manual administratively down down9、rznn1(config-if)#ip add 192.168.3.1 255.255.255.0 重置ip地址rznn1#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.3.1 YES manual up up FastEthernet0/1 192.168.1.1 YES manual up up Vlan1 unassigned YES manual administratively down down实训四发现协议1、实训目的通过发现协议显示路由器相邻路由的端口信息2、拓扑结构Router0:192.168.11.1Router1:fa0/0 192.168.11.2Fa0/1 192.168.12.1Router2:192.168.12.23、步骤R1路由器Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r1r1(config)#int fa0/0r1(config-if)#ip add 192.168.11.1 255.255.255.0r1(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to upr1(config-if)#r1(config-if)#exitr1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.1 YES manual up down FastEthernet0/1 unassigned YES manual administratively down downVlan1 unassigned YES manual administratively down downR2 路由器Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r2r2(config)#int fa0/0r2(config-if)#ip add 192.168.11.2 255.255.255.0r2(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up r2(config-if)#exitr2(config)#exitr2#%SYS-5-CONFIG_I: Configured from console by consoler2#conf tEnter configuration commands, one per line. End with CNTL/Z.r2(config)#int fa0/0r2(config-if)#int fa0/1r2(config-if)#ip add 192.168.12.1 255.255.255.0r2(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to upr2(config-if)#exitr2(config)#exitr2#%SYS-5-CONFIG_I: Configured from console by consoler2#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.2 YES manual up upFastEthernet0/1 192.168.12.1 YES manual up down Vlan1 unassigned YES manual administratively down downR3路由器Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r3r3(config)#int fa0/0r3(config-if)#ip add 192.168.12.2 255.255.255.0r3(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up r3(config-if)#exitr3(config)#exitr3#%SYS-5-CONFIG_I: Configured from console by consoler3#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.12.2 YES manual up up FastEthernet0/1 unassigned YES manual administratively down downVlan1 unassigned YES manual administratively down downR1发现邻居r1#show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDr2 Fas 0/0 165 R C2800 Fas 0/0R2发现邻居r2#show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDr1 Fas 0/0 176 R C1841 Fas 0/0r3 Fas 0/1 130 R C1841 Fas 0/0R3发现邻居r3#show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDr2 Fas 0/0 166 R C2800 Fas 0/14、总结show 命令(1)show ip interface b (显示端口ip信息)(2)show version (显示ios版本信息)(3)show running-config (显示刚才使用的命令配置信息)(4)show cdp neighbors (显示发现邻居直连设备信息)(5)show interface (显示所有端口详细信息)实训五静态路由1、实验目的:将不同网段的网络配通(ip route)Ip route语法:ip route 目标地址子网掩码相邻路由器接口地址Show ip route2、试验拓扑:Router0:192.168.11.1Router1:fa0/0 192.168.11.2Fa0/1 192.168.12.1Router2:192.168.12.23、实验步骤:Router1Router>enRouter#conf tRouter(config)#host r1r1(config)#int fa0/0r1(config-if)#ip add 192.168.11.1 255.255.255.0r1(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to upr1(config-if)#exitr1(config)#exitr1#show ip interface bInterface IP-Address OK? Method Status ProtocolFastEthernet0/0 192.168.11.1 YES manual up downFastEthernet0/1 unassigned YES manual administratively down downVlan1 unassigned YES manual administratively down downr1#%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up r1#ping 192.168.12.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:.....Success rate is 0 percent (0/5)r1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#ip route 192.168.12.0 255.255.255.0 192.168.11.2r1(config)#exitr1#ping 192.168.12.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 msr1#ping 192.168.12.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:.....Success rate is 0 percent (0/5)r1#ping 192.168.12.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 47/62/78 msr1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.11.0/24 is directly connected, FastEthernet0/0S 192.168.12.0/24 [1/0] via 192.168.11.2Router3Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r3r3(config)#int fa0/0r3(config-if)#ip add 192.168.12.2 255.255.255.0r3(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up r3(config-if)#exitr3(config)#exitr3#%SYS-5-CONFIG_I: Configured from console by consoler3#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.12.2 YES manual up up FastEthernet0/1 unassigned YES manual administratively down downVlan1 unassigned YES manual administratively down downr3#conf tEnter configuration commands, one per line. End with CNTL/Z.r3(config)#ip route 192.168.11.0 255.255.255.0 192.168.12.1r3(config)#exitr3#ping 192.168.11.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.2, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 msr3#ping 192.168.11.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.1, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 msr3#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setS 192.168.11.0/24 [1/0] via 192.168.12.1C 192.168.12.0/24 is directly connected, FastEthernet0/04、默认路由Route 1r1>enr1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#no ip route 192.168.12.0 255.255.255.0 192.168.11.2%No matching route to deleter1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.11.0/24 is directly connected, FastEthernet0/0r1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#ip route 0.0.0.0 0.0.0.0 192.168.11.2r1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.11.2 to network 0.0.0.0C 192.168.11.0/24 is directly connected, FastEthernet0/0S* 0.0.0.0/0 [1/0] via 192.168.11.2r1#ping 192.168.12.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 16/28/31 msr1#ping 192.168.12.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 msRoute 3r1>enr1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#no ip route 192.168.12.0 255.255.255.0 192.168.11.2%No matching route to deleter1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.11.0/24 is directly connected, FastEthernet0/0r1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#ip route 0.0.0.0 0.0.0.0 192.168.11.2r1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.11.2 to network 0.0.0.0C 192.168.11.0/24 is directly connected, FastEthernet0/0S* 0.0.0.0/0 [1/0] via 192.168.11.2r3#ping 192.168.11.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.1, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms实训六动态路由RIP 协议1、实验目的使用配置动态路由启动Rip协议使用到的命令(router rip/network/show ip protocols/show ip route)2、实验拓扑R1 fa0/0 192.168.11.1R2 fa0/0 192.168.11.2fa0/1 192.168.12.1R3 fa0/0 192.168.12.23、实验步骤R1Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#host r1r1(config)#int fa0/0r1(config-if)#ip add 192.168.11.1 255.255.255.0r1(config-if)#no shr1(config-if)#exitr1(config)#router ripr1(config-router)#network 192.168.11.0r1(config-router)#exitr1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoleR2Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#host r2r2(config)#int fa0/0r2(config-if)#ip add 192.168.11.2 255.255.255.0r2(config-if)#no shr2(config-if)#exitr2(config)#int fa0/1r2(config-if)#ip add 192.168.12.1 255.255.255.0r2(config-if)#no shr2(config-if)#exitr2(config)#router ripr2(config-router)#network 192.168.11.0r2(config-router)#network 192.168.12.0r2(config-router)#exitr2(config)#exitr2#R3Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#host r3r3(config)#int fa0/0r3(config-if)#ip add 192.168.12.2 255.255.255.0r3(config-if)#no shr3(config-if)#exitr3(config)#router ripr3(config-router)#network 192.168.12.0r3(config-router)#exitr3(config)#exitr3#%SYS-5-CONFIG_I: Configured from console by console4、实验测试R1r1#show ip protocolsRouting Protocol is "rip"Sending updates every 30 seconds, next due in 10 secondsInvalid after 180 seconds, hold down 180, flushed after 240 Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not set Redistributing: ripDefault version control: send version 1, receive any version Interface Send Recv Triggered RIP Key-chain FastEthernet0/0 1 2 1Automatic network summarization is in effectMaximum path: 4Routing for Networks:192.168.11.0Passive Interface(s):Routing Information Sources:Gateway Distance Last UpdateDistance: (default is 120)r1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.11.0/24 is directly connected, FastEthernet0/0R 192.168.12.0/24 [120/1] via 192.168.11.2, 00:00:24, FastEthernet0/0 r1#ping 192.168.12.0Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.0, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 msR2r2#show ip protocolsRouting Protocol is "rip"Sending updates every 30 seconds, next due in 21 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chain FastEthernet0/0 1 2 1FastEthernet0/1 1 2 1Automatic network summarization is in effectMaximum path: 4Routing for Networks:192.168.11.0192.168.12.0Passive Interface(s):Routing Information Sources:Gateway Distance Last UpdateDistance: (default is 120)r2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.11.0/24 is directly connected, FastEthernet0/0C 192.168.12.0/24 is directly connected, FastEthernet0/1R3r3#show ip protocolsRouting Protocol is "rip"Sending updates every 30 seconds, next due in 15 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chain FastEthernet0/0 1 2 1Automatic network summarization is in effectMaximum path: 4Routing for Networks:192.168.12.0Passive Interface(s):Routing Information Sources:Gateway Distance Last UpdateDistance: (default is 120)r3#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setR 192.168.11.0/24 [120/1] via 192.168.12.1, 00:00:04, FastEthernet0/0 C 192.168.12.0/24 is directly connected, FastEthernet0/0r3#ping 192.168.11.0Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.0, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms实训七负载平衡试训目的实现负载平衡实训拓扑R1 fa0/0 192.168.11.1R2 eth0/0/0 192.168.11.2Fa0/0 192.168.12.1Fa0/0 192.168.13.1R3 fa0/0 192.168.12.2Fa0/1 192.168.14.1R4 fa0/0 192.168.13.2Fa0/1 192.168.15.1R5 fa0/0 192.168.14.2Fa0/1 192.168.15.2实训步骤(R1 )r1>enR1#conf tR1(config)#ip route 0.0.0.0 0.0.0.0 192.168.11.2R1(config)#exitr1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.11.2 to network 0.0.0.0C 192.168.11.0/24 is directly connected, FastEthernet0/0S* 0.0.0.0/0 [1/0] via 192.168.11.2(R2)r2>enr2(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2r2(config)#ip route 0.0.0.0 0.0.0.0 192.168.13.2r2(config)#exitr2#%SYS-5-CONFIG_I: Configured from console by consoles% Ambiguous command: "s"r2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.12.2 to network 0.0.0.0C 192.168.11.0/24 is directly connected, Ethernet0/0/0C 192.168.12.0/24 is directly connected, FastEthernet0/0C 192.168.13.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.12.2[1/0] via 192.168.13.2(R3)r3>enr3#conf tEnter configuration commands, one per line. End with CNTL/Z.r3(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.1r3(config)#exitr3#%SYS-5-CONFIG_I: Configured from console by consoler3#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.12.1 to network 0.0.0.0C 192.168.12.0/24 is directly connected, FastEthernet0/0C 192.168.14.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.12.1(R4)r4>enr4#conf tEnter configuration commands, one per line. End with CNTL/Z.r4(config)#ip route 0.0.0.0 0.0.0.0 192.168.13.1r4(config)#exitr4#%SYS-5-CONFIG_I: Configured from console by consoler4#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.13.1 to network 0.0.0.0C 192.168.13.0/24 is directly connected, FastEthernet0/0C 192.168.15.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.13.1(R5)r5>enr5#conf tEnter configuration commands, one per line. End with CNTL/Z.r5(config)#ip route 0.0.0.0 0.0.0.0 192.168.14.1r5(config)#ip route 0.0.0.0 0.0.0.0 192.168.15.1r5(config)#exitr5#%SYS-5-CONFIG_I: Configured from console by consoler5#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.14.1 to network 0.0.0.0C 192.168.14.0/24 is directly connected, FastEthernet0/0C 192.168.15.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.14.1[1/0] via 192.168.15.1实训测试(R1)r1#ping 192.168.14.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.14.1, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 62/84/94 ms (R5)r5#ping 192.168.11.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.1, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 79/91/94 ms实训八DHCP 协议配置实训目的全网配通实训拓扑Fa0/0 192.168.11.1Fa0/1 192.168.12.1实训步骤Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r1r1(config)#int fa0/0r1(config-if)#ip add 192.168.11.1 255.255.255.0r1(config-if)#no shr1(config-if)#exitr1(config)#int fa0/1r1(config-if)#ip add 192.168.12.1 255.255.255.0r1(config-if)#no shr1(config-if)#exitr1(config)#ip dhcp pool znn //配置一个根地址池znnr1(dhcp-config)#network 192.168.11.0 255.255.255.0 //为所有客户机动态分配的地址段r1(dhcp-config)#default-router 192.168.11.1 //为客户机配置默认的网关r1(dhcp-config)#dns-server 192.168.11.1 //为客户机配置DNS服务器r1(dhcp-config)#exitr1(config)#ip dhcp pool znn1r1(dhcp-config)#network 192.168.12.0 255.255.255.0r1(dhcp-config)#default-router 192.168.12.1r1(dhcp-config)#dns-server 192.168.12.1r1(dhcp-config)#exit。
《计算机网络技术》实验指导书:Cisco路由器的基本配置

《计算机网络技术》实验指导书:Cisco路由器的基本配置【实验目的】:1.熟练使用超级终端对路由器进行配置2.学习路由器命令3.掌握路由器的基本连接和配置【实验内容】:1.超级终端的使用2.路由器的启动和初始配置3.路由器的常规配置【实验原理及相关知识】:路由器可以用来连通不同的网络,并且能够选择信息传送的路径。
选择通畅快捷的路径,能大大提高信息速度,减轻网络系统通信负荷,节约网络系统资源,提高网络系统畅通率,从而让网络系统发挥出更大的效益。
从过滤网络流量的角度来看,路由器的作用与交换机、网桥非常相似。
但是与工作在网络底层、从物理上划分网段的交换机不同,路由器使用专门的软件协议从逻辑上对整个网络进行划分。
例如,一台支持IP协议的路由器可以把网络划分成多个子网络,只有网间的网络流量才可以通过路由器。
对于每一个接收到的数据包,路由器都会重新计算其校验值,并写入新的物理地址。
因此使用路由器转发和过滤数据的速度往往要比只查看数据包物理地址的交换机慢,但是对于那些结构复杂的网络,使用路由器可以提高网络的整体效率。
路由器的另一个明显优势就是可以自动过滤网络广播。
总体来说,在网络中添加路由器的整个安装过程要比安装即插即用的交换机复杂的多。
一般来说,异种网络互联或多个子网互联都应采用路由器来完成。
路由器的主要工作就是为经过路由的每个数据包寻找一条最佳的传输路径,并将该数据有效地址传送到目的站点。
由此可见,选择最佳路径的策略是路由器的关键所在。
为了完成这项工作,在路由表中保存着子网的标志信息、网上路由的个数和下一个路由器的名字等内容。
路由表可以由系统管理员固定设置,也可以由系统动态修改;可以由路由器自动调整,也可以由主机控制。
路由器的构成从硬件组成上来看,路由器由CPU、内存和接口等部分组成。
1 CPU路由器和PC机一样,有中央处理单元CPU,CPU是路由器的处理中心。
对于不同的路由器,其CPU一般也不一样。
2 内存内存用来存储路由器的信息和数据,Cisco路由器有以下几种内存组件:(1)ROM(Read Only Memory)ROM中存储路由器加电自检程序(Power-On Self-Test Program)启动程序(Bootstrap Program)和部分或全部的IOS。
Cisco(思科)路由器静态路由的配置

Cisco(思科)路由器静态路由的配置实验拓扑实验步骤我们要使得 1.1.1.0/24、2.2.2.0/24、3.3.3.0/24 ⽹络之间能够互相通信。
(1)步骤 1:在各路由器上配置 IP 地址、保证直连链路的连通性R1(config)#int loopback0R1(config-if)#ip address 1.1.1.1 255.255.255.0R1(config)#int s0/0/0R1(config-if)#ip address 192.168.12.1 255.255.255.0R1(config-if)#no shutdownR2(config)#int loopback0R2(config-if)#ip address 2.2.2.2 255.255.255.0R2(config)#int s0/0/0R2(config-if)#clock rate 128000R2(config-if)#ip address 192.168.12.2 255.255.255.0R2(config-if)#no shutdownR2(config)#int s0/0/1R2(config-if)#clock rate 128000R2(config-if)#ip address 192.168.23.2 255.255.255.0R2(config-if)#no shutdownR3(config)#int loopback0R3(config-if)#ip address 3.3.3.3 255.255.255.0R3(config)#int s0/0/1R3(config-if)#ip address 192.168.23.3 255.255.255.0R3(config-if)#no shutdown(2)步骤 2:R1上配置静态路由R1(config)#ip route 2.2.2.0 255.255.255.0 s0/0/0//下⼀跳为接⼝形式,s0/0/0 是点对点的链路,注意应该是 R1 上的s0/0/0 接⼝R1(config)#ip route 3.3.3.0 255.255.255.0 192.168.12.2//下⼀跳为IP 地址形式,192.168.12.2 是R2 上的IP 地址(3)步骤 3:R2上配置静态路由R2(config)#ip route 1.1.1.0 255.255.255.0 s0/0/0R2(config)#ip route 3.3.3.0 255.255.255.0 s0/0/1(4)步骤 4:R3上配置静态路由R3(config)#ip route 1.1.1.0 255.255.255.0 s0/0/1R3(config)#ip route 2.2.2.0 255.255.255.0 s0/0/1实验调试(1)在 R1、R2、R3 上查看路由表R1#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2 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 routeo - ODR, P - periodic downloaded static routeGateway of last resort is not setC 192.168.12.0/24 is directly connected, Serial0/0/01.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback02.0.0.0/24 is subnetted, 1 subnetsS 2.2.2.0 is directly connected, Serial0/0/03.0.0.0/24 is subnetted, 1 subnetsS 3.3.3.0 [1/0] via 192.168.12.2R2#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not setC 192.168.12.0/24 is directly connected, Serial0/0/01.0.0.0/24 is subnetted, 1 subnetsS 1.1.1.0 is directly connected, Serial0/0/02.0.0.0/24 is subnetted, 1 subnetsC 2.2.2.0 is directly connected, Loopback03.0.0.0/24 is subnetted, 1 subnetsS 3.3.3.0 is directly connected, Serial0/0/1C 192.168.23.0/24 is directly connected, Serial0/0/1R3#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set1.0.0.0/24 is subnetted, 1 subnetsS 1.1.1.0 is directly connected, Serial0/0/12.0.0.0/24 is subnetted, 1 subnetsS 2.2.2.0 is directly connected, Serial0/0/13.0.0.0/24 is subnetted, 1 subnets C 3.3.3.0 is directly connected, Loopback0C 192.168.23.0/24 is directly connected, Serial0/0/1(2)从各路由器的环回⼝ ping 其他路由器的环回⼝:R1#ping//不带任何参数的 ping命令,允许我们输⼊更多的参数Protocol [ip]:Target IP address: 2.2.2.2 //⽬标IP地址Repeat count [5]: //发送的ping 次数Datagram size [100]: //ping包的⼤⼩Timeout in seconds [2]: //超时时间Extended commands [n]: y //是否进⼀步扩展命令Source address or interface: 1.1.1.1 //源IP地址Type of service [0]:Set DF bit in IP header? [no]:Validate reply data? [no]:Data pattern [0xABCD]:Loose, Strict, Record, Timestamp, Verbose[none]:Sweep range of sizes [n]:Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:Packet sent with a source address of 1.1.1.1Success rate is 100 percent (5/5), round-trip min/avg/max = 12/14/16 ms//以上说明从 R1 的 loopback0 可以ping 通R2 上的 loopback0。
思科,静态路由实验详细配置教程

思科,静态路由实验详细配置教程PC0:192.168.10.10/24R1g0/0:192.168.10.1/24R1g0/1:200.0.0.1/30PC1:192.168.20.10/24R2g0/0:200.0.0.2/30R2g0/1:192.168.20.1/24R2g0/2:202.0.0.1/30PC2:192.168.30.10/24R4g0/1:202.0.0.2/30R4g0/0:192.168.30.1/24静态路由心法口诀:路由表少什么网络加什么网络静态路由配置命令:ip route XXXX(要添加的网络号).XXXXX(要添加网络的子网掩码).XXXXX(下一跳地址)常用命令:show ip route(查看路由表,在特权模式下查看)注:正确模式下输入正确命令!配置:R1命令:R1>en //进入特权模式R1#conf t //进入全局配置模式R1(config)#inter g0/0 //进入g0/0接口R1(config-if)#ip add 192.168.10.1 255.255.255.0 //给g0/0接口配置IP地址R1(config-if)#no shutdown //激活g0/0接口R1(config-if)#inter g0/1R1(config-if)#ip add 200.0.0.1 255.255.255.252R1(config-if)#no shutdownR1(config-if)#exit(根据心法口诀可以先在特权模式下先执行show ip route(查看路由表)看看少哪些网段少什么网段加什么网段)R1(config)#ip route 192.168.20.0(要添加网络的网络号) 255.255.255.0 200.0.0.2 (下一跳地址这里是R2路由的g0/0接口) //(配置静态路由,把192.168.20.0网络添加的R1的路由表,可以在特权模式下执行show ip route查看)R1(config)#ip route 202.0.0.0 255.255.255.252 200.0.0.2 //(将202.0.0.0段添加到路由表)R1(config)#ip route 192.168.30.0 255.255.255.0 200.0.0.2 //(将192.168.30.0段添加到路由表)R2命令:R2>enR2#conf tR2(config)#inter g0/0R2(config-if)#ip add 200.0.0.2 255.255.255.252R2(config-if)#no shutdownR2(config-if)#inter g0/1R2(config-if)#ip add 192.168.20.1 255.255.255.0R2(config-if)#no shutdownR2(config-if)#inter g0/2R2(config-if)#ip add 202.0.0.1 255.255.255.252R2(config-if)#no shutdownR2(config-if)#exitR2(config)#ip route 192.168.10.0 255.255.255.0 200.0.0.1 R2(config)#ip route 192.168.30.0 255.255.255.0 202.0.0.2R4命令:R4>enR4#conf tR4(config)#inter g0/1R4(config-if)#ip add 202.0.0.2 255.255.255.252R4(config-if)#no shutdownR4(config-if)#inter g0/0R4(config-if)#ip add 192.168.30.1 255.255.255.0R4(config-if)#no shutdownR4(config-if)#exitR4(config)#ip route 192.168.10.0 255.255.255.0 202.0.0.1 R4(config)#ip route 200.0.0.0 255.255.255.252 202.0.0.1 R4(config)#ip route 192.168.20.0 255.255.255.0 202.0.0.1用pc ping测试,全网互通有兴趣朋友可以了解更多java教程/java/video.shtml。
实验1. 配置静态路由

实验1. 静态路由基础配置1 应用背景管理员可以通过手工的方法在路由器中直接配置路由表,这就是静态路由。
虽然静态路由不适合于在大的网络中使用,但是由于静态路由简单、路由器负载小、安全性高等原因,现在在ISP、金融、证券等单位经常被使用。
2 实验目的通过本实验,掌握以下技能:◆路由表的概念◆命令ip route的使用,以及静态路由跟下一条地址和接口◆根据需求正确的配置静态路由◆掌握验证静态路由的命令3 设备需求:思科路由器 3640 三台4 实验拓扑:Hlsz_R1Hlsz_R3Hlsz_R2LOOPBACK 0Ip add 1.1.1.1/32LOOPBACK 0Ip add 3.3.3.3/32成都互联神州网络技术培训S2/0S2/0S2/1S2/15 实验步骤5.1、静态路由配置静态路由让R1 loopback 0:1.1.1.1/24、R2 loopback 0:2.2.2.2/24、R3 loopback 0:3.3.3.3/24能够相互通信5.1.1、基本配置配置接口IP地址,保证直连链路的互通R1(config)#int loopback0R1(config-if)#ip address 1.1.1.1 255.255.255.0R1(config)#int s2/0R1(config-if)#ip address 12.1.1.1 255.255.255.0R1(config-if)#no shutdownR2(config)#int loopback0R2(config-if)#ip address 2.2.2.2 255.255.255.0R2(config)#int s2/0R2(config-if)#clock rate 64000 /DCE端配置时钟速率R2(config-if)#ip address 12.1.1.2 255.255.255.0R2(config-if)#no shutdownR2(config)#int s2/1R2(config-if)#clock rate 64000 /DCE端配置时钟速率R2(config-if)#ip address 23.1.1.2 255.255.255.0R2(config-if)#no shutdownR3(config)#int loopback0R3(config-if)#ip address 3.3.3.3 255.255.255.0R3(config)#int s2/1R3(config-if)#ip address 23.1.1.3 255.255.255.0R3(config-if)#no shutdown5.1.2、配置静态路由静态路由指向下一跳地址R1(config)#ip route 3.3.3.0 255.255.255.0 12.1.1.2R1(config)#ip route 2.2.2.0 255.255.255.0 12.1.1.2R1(config)#ip route 23.1.1.0 255.255.255.0 12.1.1.2/在R1上配置静态路由分别到网段:23.1.1.0、3.3.3.0和2.2.2.0,采用下一跳IP地址的形式,注意IP:12.1.1.2是R2上S2/0接口IP地址。
实验1-Cisco路由器基本配置+静态路由+广域网连接

静态路由
• 由网络管理员在路由器上手工添加路由信息以实 现路由目的。 • 作用
– 在不会显著增长的小型网络中,使用静态路由便于维 护路由表。 – 静态路由可以路由到存根网络,或者从存根网络路由 到外部网络。
– 使用单一默认路由。如果某个网络在路由表中找不到 更匹配的路由条目,则可使用静态路由作为通往该网 络的路径。
– 在 Windows 中的【开始】→【程序】→【附件】→【通信】菜单 下打开“超级终端”程序,在“名称”对话框中输入名称,例如 “Router”;按【确定】按钮。在“连接时使用”下拉菜单中选择 计算机的 COM1口,按【确定】按钮。
9
通过Console口访问路由器
• 步骤 3:设置通信参数;
• 步骤 4:路由器开机 ,观察路由器的开机过程。
这是一条单方向的路径,必须配置一条相反的路径。
静态路由举例
R1的配置命令: Router> Router>enable Router#configure terminal Router(config)#hostname R1 R1(config)#interface fa0/0 R1(config-if)#ip address 10.1.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#interface fa0/1 R1(config-if)#ip address 202.128.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#exit R1(config)#ip route 200.168.10.0 255.255.255.0 10.1.1.2
– 在特权模式下输入相应的命令时进入 – 例如:interface fastEthernet0/0 router(config-if)#
Cisco路由器静态路由和默认路由的配置

实验四 Cisco路由器静态路由和默认路由的配置(验证性)(2学时)一、实验目的1.进一步熟悉Cisco路由器的配置环境2.掌握Cisco路由器静态路由的配置方法3.掌握Cisco路由器默认路由的配置方法二、实验内容(一)静态路由的配置建立如上所示的拓扑结构,现在需要完成的就是让HostA能和HostB互相ping通。
具体配置如下:router1的配置:Press Enter to StartRouter>Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname router1router1(config)#interface e0router1(config-if)#ip address 192.168.1.2 255.255.255.0router1(config-if)#no shut%LINK-3-UPDOWN: Interface Ethernet0, changed state to uprouter1(config-if)#interface s0router1(config-if)#ip address 192.168.2.1 255.255.255.0router1(config-if)#clock rate 6400 //clock rate是dce设备给dte设备提供时钟频率的,需要在dce里面设置,而另外的一个路由器里面则不用设置router1(config-if)#no shut%LINK-3-UPDOWN: Interface Serial0, changed state to uprouter1(config-if)#end%LINK-3-UPDOWN: Interface Serial0, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to downrouter1#config tEnter 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.1router1(config)#endrouter1#copy running startupDestination 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 uprouter2的配置:Press Enter to StartRouter>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#interface e0Router(config-if)#endRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname router2router2(config)#interface s0router2(config-if)#ip address 192.168.2.2 255.255.255.0router2(config-if)#no shut%LINK-3-UPDOWN: Interface Serial0, changed state to uprouter2(config-if)#interface s0router2(config-if)#interface e0router2(config-if)#ip address 192.168.3.1 255.255.255.0router2(config-if)#no shut%LINK-3-UPDOWN: Interface Ethernet0, changed state to uprouter2(config-if)#endrouter2#config tEnter configuration commands, one per line. End with CNTL/Z.router2(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.2router2(config)#ip route 192.168.2.0 255.255.255.0 192.168.2.2router2(config)#endrouter2#copy running startupDestination filename [startup-config]?Building configuration...[OK]router2#ping 192.168.1.2Type 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 msrouter2#ping 192.168.2.1Type 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 msrouter2#ping 192.168.2.2Type 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通,接下来配pcpc1的配置如下:Boson BOSS 5.0Copyright 1998-2003 Boson Software, Inc.Use the command help to get startedPress Enter to beginC:>ipconfig /ip 192.168.1.1 255.255.255.0 //此时尚未指定网关C:>ping 192.168.2.1Pinging 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的s0Approximate round trip times in milli-seconds:Minimum = 0ms, Maximum = 0ms, Average = 0msC:>ipconfig /dg 192.168.1.2 //指定网关为与本机直连的router1的e0口C:>ping 192.168.1.2Pinging 192.168.1.2 with 32 bytes of data:Reply from 192.168.1.2: bytes=32 time=60ms TTL=241Reply from 192.168.1.2: bytes=32 time=60ms TTL=241Reply from 192.168.1.2: bytes=32 time=60ms TTL=241Reply from 192.168.1.2: bytes=32 time=60ms TTL=241Reply from 192.168.1.2: bytes=32 time=60ms TTL=241Ping statistics for 192.168.1.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55msC:>ping 192.168.2.1Pinging 192.168.2.1 with 32 bytes of data:Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Ping statistics for 192.168.2.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), //指定网关后可以ping通s0口了Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55msC:>ping 192.168.2.2Pinging 192.168.2.2 with 32 bytes of data:Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Ping statistics for 192.168.2.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55msC:>ping 192.168.3.1Pinging 192.168.3.1 with 32 bytes of data:Reply from 192.168.3.1: bytes=32 time=60ms TTL=241Reply from 192.168.3.1: bytes=32 time=60ms TTL=241Reply from 192.168.3.1: bytes=32 time=60ms TTL=241Reply from 192.168.3.1: bytes=32 time=60ms TTL=241Reply from 192.168.3.1: bytes=32 time=60ms TTL=241Ping statistics for 192.168.3.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55ms//可以ping通任意一台设备的IP地址,实验成功C:>pc2 的配置如下:Boson BOSS 5.0Copyright 1998-2003 Boson Software, Inc.Use the command help to get startedPress Enter to beginC:>C:>ipconfig /ip 192.168.3.1 255.255.255.0C:>ipconfig /dg 192.168.3.1 //把IP和网关设好C:>ping 192.168.1.1Pinging 192.168.1.1 with 32 bytes of data:Reply from 192.168.1.1: bytes=32 time=60ms TTL=241Reply from 192.168.1.1: bytes=32 time=60ms TTL=241Reply from 192.168.1.1: bytes=32 time=60ms TTL=241Reply from 192.168.1.1: bytes=32 time=60ms TTL=241Reply from 192.168.1.1: bytes=32 time=60ms TTL=241Ping statistics for 192.168.1.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55msC:>ping 192.168.1.2Pinging 192.168.1.2 with 32 bytes of data:Reply from 192.168.1.2: bytes=32 time=60ms TTL=241Reply from 192.168.1.2: bytes=32 time=60ms TTL=241Reply from 192.168.1.2: bytes=32 time=60ms TTL=241Reply from 192.168.1.2: bytes=32 time=60ms TTL=241Reply from 192.168.1.2: bytes=32 time=60ms TTL=241Ping statistics for 192.168.1.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55msC:>ping 192.168.2.1Pinging 192.168.2.1 with 32 bytes of data:Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Ping statistics for 192.168.2.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55msC:>ping 192.168.2.2Pinging 192.168.2.2 with 32 bytes of data:Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Ping statistics for 192.168.2.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55msC:>ping 192.168.3.1Pinging 192.168.3.1 with 32 bytes of data:Reply from 192.168.3.1: bytes=32 time=60ms TTL=241Reply from 192.168.3.1: bytes=32 time=60ms TTL=241Reply from 192.168.3.1: bytes=32 time=60ms TTL=241Reply from 192.168.3.1: bytes=32 time=60ms TTL=241Reply from 192.168.3.1: bytes=32 time=60ms TTL=241Ping statistics for 192.168.3.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55ms //可以ping通任意一台设备的IP地址,实验成功(二)默认路由的配置建立如上所示的拓扑结构。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Web 或网络管 理服务器
7
通过Console口访问路由器
• 用计算机的串口对Cisco设备进行配置是最基本的 方法。 需要用专用配置电缆连接到设备的Console 口和计算机的串口:
8
通过Console口访问路由器
• 步骤 1:连接好计算机COM1口和路由器的 Console口; • 步骤 2:打开Windows自带的超级终端程序
R2的配置命令: Router> Router>enable Router#configure terminal Router(config)#hostname R2 R2(config)#interface fa0/0 R2(config-if)#ip address 10.1.1.2 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#interface fa0/1 R2(config-if)#ip address 200.168.10.1 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#exit R2(config)#ip route 202.128.1.0 22 255.255.255.0 10.1.1.1
Cisco路由器和交换机
路由器
交换机
3
路由器的硬件组成
• (1) CPU:中央处理单元,是路由器的控制和运算部件。 • (2) RAM/DRAM:内存,用于存储临时的运算结果,如:路由表、ARP 表、快速交换缓存、缓冲数据包、数据队列、当前配置。RAM 中的数 据在路由器断电后是会丢失的。 • (3) FLASH:可擦除、可编程的 ROM,用于存放路由器的 IOS,FLASH 的可擦除特性允许我们更新、升级 IOS 而不用更换路由器内部的芯片 。路由器断电后,FLASH 的内容不会丢失。FLASH 容量较大时,就可 以存放多个 IOS 版本。 • (4) NVRAM:非易失性 RAM,用于存放路由器的配置文件,路由器断 电后,NVRAM 中的内容仍然保持。 • (5) ROM:只读存储器,存储了路由器的开机诊断程序、引导程序和 特殊版本的 IOS 软件(用于诊断等有限用途),ROM 中软件升级时需 要更换芯片。 • (6) 接口(Interface):用于网络连接,路由器就是通过这些接口和不 同的网络进行连接的。
– 在 Windows 中的【开始】→【程序】→【附件】→【通信】菜单 下打开“超级终端”程序,在“名称”对话框中输入名称,例如 “Router”;按【确定】按钮。在“连接时使用”下拉菜单中选择 计算机的 COM1口,按【确定】按钮。
9
通过Console口访问路由器
• 步骤 3:设置通信参数;
• 步骤 4:路由器开机 ,观察路由器的开机过程。
• 路由器与计算机互联
– 通过局域网接口与网卡接口互联 – 使用双绞线(交叉线)
• 路由器与交换机互联
– 通过局域网接口与交换机接口互联 – 使用双绞线(直连线)
• 路由器与路由器互联(三种方式)
– 通过局域网接口互联,使用双绞线(交叉线) – 通过广域网串口互联,使用DTE和DCE串口连接线 – 通过高速网络互联,使用光纤接入 11
路由器的广域网连接配置
• 网络层数据在通过广域网链路传输之前都会封装 成帧,需要配置适当的二层封装类型。
– HDLC
• 由ISO开发的面向比特的同步数据链路层协议。 • 不提供身份验证,缺少对链路的安全防护。
19
静态路由配置命令
• 配置静态路由的命令为“ip route”:
– ip route 目的网络 掩码 {下一跳地址 | 接口}
• 举例:
– R1(config)#ip route 210.1.1.0 255.255.255.0 200.1.1.2 //手工配置路由表项 – R1(config)#no ip route 210.1.1.0 255.255.255.0 200.1.1.2 //手工删除路由表项 – R1#show ip route //查看路由表
• 【Tab】键的使用
Router>en【Tab】//使用【Tab】键帮助我们自动补全命令 Router>enable
17
使用IOS命令对路由器进行基本配置
Router>enable Router#configure terminal //进入全局配置模式 Router(config)#hostname R1 //配置路由器的名称为“R1”,设置立即生效 R1(config)#interface fastEthernet0/0 //进入到接口模式,这里是百兆以 太网口(第 0 个插槽的第 0 个接口,编号从 0 开始)。 R1(config-if)#ip address 10.1.1.1 255.255.255.0 //配置 IP 地址和掩码 R1(config-if)#no shutdown //开启以太网口,默认时各个接口是关闭的。 R1(config-if)#exit //退回到上一级模式 R1(config)#interface Serial0/0/0 //进入到接口模式,这里是串行接口 R1(config-if)#ip address 10.12.12.1 255.255.255.0 //配置 IP 地址和掩码 R1(config-if)#no shutdown //开启接口 R1(config-if)#end(或【Ctrl+Z】 ) //结束配置直接回到特权模式下。 R1#show ip interface brief //显示接口的IP地址、地址获得方法和状态 R1#show running-config //查看当前配置 18 R1#ping 10.1.1.2 //测试连通性
6
Cisco设备的多种配置方法
Telnet 端口
虚拟终端
TFTP
控制端口
Aux 端口 PC or Unix服务器
• • • • •
用Console口接终端配置 在Aux口接一个MODEM同电话网相连,在远端进行配置 在TCP/IP网上可通过仿真终端Telnet配置 可以从TFTP Server上下载配置 可用网管工作站进行监控和配置
– (1) 用户模式:通常用来查看路由器的状态。在此状态下,无法 对路由器进行配置,可以查看的路由器信息也是有限的。
– (2) 特权模式:可以更改路由器的配置,也可以查看路由器的所 有信息。
5
Cisco路由器的启动过程
• (1) 执行 ROM 中的引导程序加载(Bootstrap Loader),把 IOS 装到 RAM 中; • (2) IOS 可以存放在许多地方(FLASH、TFTP 服务器上或 ROM 中),路由器寻找 IOS 映像的顺序,取决于配置寄存器的启 动域以及其他的设置。 • (3) 加载 IOS 到 RAM 中:如果 IOS 是压缩过的,就先解压。 • (4) 在 NVRAM 中查找配置文件,并把配置文件加载到 RAM 中运行。 • (5) 如果在 NVRAM 中没有找到配置文件, 就进入 setup 配置模式
双绞线 Unshielded Twisted Paired (UTP)
线对 T 代表发送 R 代表接收 线对2 T2 线对2 R2 线对3 T3 线对1 R1 线对1 T1 线对3 R3 线对4 T4 线对4 R4
针 1 2 3 4 5 6 7 8
1
8
RJ-45 连接器
12
直连线 VS. 交叉线
– 在特权模式下输入相应的命令时进入 – 例如:interface fastEthernet0/0 router(config-if)#
16
IOS命令的使用
• “?” 的使用 (以配置路由器时钟为例)
Router#cl? //列出当前模式下可以使用的以“cl”开头的所有命令 clear clock Router#clock ? //列出当前模式下可以使用的以“clock”开头的所有命令 set Set the time and date
Cisco路由器的基本配置 静态路由 广域网连接(串行的点对点连接)
内容
•
– – – –
Cisco路由器简介
路由器的硬件组成 IOS简介 路由器的启动过程 配置路由器的方法
• • • • •
Cisco路由器与其它设备的连接 IOS命令的使用 使用IOS命令对Cisco路由器进行基本配置 Cisco路由器的静态路由 路由器的广域网连接配置
静态路由
• 由网络管理员在路由器上手工添加路由信息以实 现路由目的。 • 作用
– 在不会显著增长的小型网络中,使用静态路由便于维 护路由表。 – 静态路由可以路由到存根网络,或者从存根网络路由 到外部网络。
– 使用单一默认路由。如果某个网络在路由表中找不到 更匹配的路由条目,则可使用静态路由作为通往该网 络的路径。
直连线
交叉线
8 1 8
1
8 1
1
8
8
1
8
1
8
18Βιβλιοθήκη 1棕 棕 绿 蓝蓝 绿 橙 橙 白 白 白 白
棕 棕 绿 蓝蓝 绿 橙 橙 白 白 白 白
棕 棕 绿 蓝 蓝 绿 橙橙 白 白 白 白
棕 棕 橙 蓝蓝 橙 绿 绿 白 白 白 白
两端的线序相同
部分线序交叉
13
串行连接中的DTE和DCE
Data Terminal Equipment 数据终端设备
• WAN连接中用户方的最后设备
Data Communications Equipment 数据通讯设备
• WAN服务商方的最后通讯设备 • DCE提供时钟 调制解调器 通道服务单元/ 数据服务单元
DTE
S S S S
DCE
S
DTE
DCE
S