CISCO CERTIFIED NETWORK ASSOCIATE LAB GUIDE 思科认证网络工程师完全实验手册 作者红头发 CCIE#15101-1-
-2-
-3-
-4-
-5-
第一章基础篇 实验一 - 路由器基本设置 Lab Exercise 1.1 熟练掌握如何进入路由器各种模式并设置主机名. Cisco 2501 路由器一台. 1. 从路由器用户模式进入特权模式 : Aiko>enable 2. 从特权模式进入全局配置模式 : configure terminal 3. 为路由器设置主机名 : Aiko(config)#hostname {hostname} 4. 退出到特权模式 : Aiko(config)#end 5. 退出到用户模式 : disable 6. 退出控制台线路 : Aiko>quit 解释 : 路由器的模式大致可分为 : 1. 用户模式 : 权限最低, 通常只能使用少量查看性质的命令. 2. 特权模式 : 可以使用更多查看性质的命令和一些少量修改路由器参数的命令. 3. 全局配置模式 : 不能使用查看性质的命令, 但是确实做全局性修改和设置的模式, 它还可以向下分为一些子模式, 比如接口配置模式, 线路配置模式, 路由进程配置模式等等. 配置实例一 : Router>enable Router#configure terminal Router(config)#hostname Aiko Aiko(config)#exit *Mar 1 00:04:30.815: %SYS-5-CONFIG_I: Configured from console by console disable Aiko> -6-
Lab Exercise 1.2 熟练掌握如何为路由器设置时间. Cisco 2501 路由器一台. 在特权模式下设置路由器时间 : clock set {hh:mm:ss day month year} 解释 : 路由器本地的时间标识. 配置实例一 : clock set 16:16:16 25 September 2005 show clock 16:16:24.503 UTC Sun Sep 25 2005 Lab Exercise 1.3 熟练掌握如何设置空闲超时时间. Cisco 2501 路由器一台 1. 从全局配置模式进入线路配置模式, 进入控制台口线路 : Aiko(config)#line console {number} 2. 启用光标跟随 : Aiko(config-line)#logging synchronous 3. 设置当键盘多少时间内无动作, 自动被路由器弹出到用户模式以外, 即退出. 如果设置为 0 分 0 秒代表永不超时 : Aiko(config-line)#exec-timeout {minute} {second} 解释 : 所谓光标跟随, 是指当我们在输入命令的时候, 不会被一些日志信息或 debug 命令产生的调试命令所冲断. 模式该特性是没有启用的. 配置实例一 : Aiko(config)#exit -7-
*Mar 1 00:20:11.231: %SYS-5-CONFIG_I: Configured from console by consoleconfigure terminal Aiko(config)#line console 0 Aiko(config-line)#logging synchronous Aiko(config-line)#end *Mar 1 00:20:38.123: %SYS-5-CONFIG_I: Configured from console by console configure terminal Aiko(config)# 配置实例二 : show clock *15:32:12.747 UTC Mon Jul 28 2005 configure terminal Aiko(config)#line console 0 Aiko(config-line)#exec-timeout 20 0 Aiko(config)#end exit *Mar 1 00:24:33.643: %SYS-5-CONFIG_I: Configured from console by console show clock *15:52:12.747 UTC Mon Jul 28 2005 Aiko con0 is now available Press RETURN to get started. Aiko> Lab Exercise 1.4 熟练掌握如何为路由器设置标语信息和描述信息. Cisco 2501 路由器一台. 1. 进入全局配置模式, 设置标语信息 : Aiko(config)#banner motd # {text} # 2. 进入接口配置模式 : Aiko(config-if)#interface {type} {number} -8-
3. 为路由器接口设置描述信息 : Aiko(config-if)#description {text} 解释 : 在设置标语信息的时候, 以 # 号做为分隔符, 并按下回车键. 描述语句的本地的一个标识, 它只在本地可见, 并 且 Cisco IOS 执行命令的时候会跳过它. 配置实例一 : Aiko(config)#banner motd # Enter TEXT message. End with the character '#'. hello! # Aiko(config)#end exit Aiko con0 is now available Press RETURN to get started. hello! Aiko> 配置实例二 : Aiko(config-if)#description LAN Sales Aiko(config-if)#end *Mar 1 02:05:48.919: %SYS-5-CONFIG_I: Configured from console by console show running-config interface ethernet 0 Building configuration... Current configuration : 75 bytes! interface Ethernet0 description LAN Sales no ip address shutdown end Lab Exercise 1.5 熟练掌握如何为路由器特权模式设置密码. -9-
Cisco 2501 路由器一台. 进入全局配置模式, 设置密码 : Aiko(config)#enable {password secret} {password} 解释 : 两种密码的区别在于, 前者是一些低版本 Cisco IOS 软件的认证方式, 并且密码是基于明文的 ; 后者是目前 Cisco IOS 软件最常用的认证方式, 它是基于 MD5 加密的. 如果同时设置了这两种认证方式, 他们的口令必须不一样. 但是, 我们推荐使用后者进行认证, 并且如果同时设置了两种认证方式, 只有后者生效. 密码区分大小写. 配置实例一 : Aiko(config)#enable password Aiko Aiko(config)#enable secret Aiko The enable secret you have chosen is the same as your enable password. This is not recommended. Re-enter the enable secret. Aiko(config)#enable secret Asuqa Aiko(config)#exit *Mar 1 02:16:48.067: %SYS-5-CONFIG_I: Configured from console by console exit Aiko con0 is now available Press RETURN to get started. Aiko>enable Password:Asuqa show running-config Building configuration... Current configuration : 609 bytes! version 12.2 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption! hostname Aiko! -10-
logging queue-limit 100 enable secret 5 $1$NTU5$EEYi0qfB1pGENzuPxDCyz. enable password Aiko! --More-- Lab Exercise 1.6 熟练掌握如何为路由器各个配置模式设置密码. Cisco 2501 路由器一台. 1. 从全局配置模式进入线路配置模式, 进入控制台口线路 : Aiko(config)#line {console aux vty} {start-number} [end-number] 2. 设置密码 : Aiko(config-line)#password {password} 3. 启用登陆 : Aiko(config-line)#login 解释 : 当设置密码之后, 如果不启用登陆命令, 退出之后, 路由器是不会提示输入密码的. 控制台线路密码为控制台线路所用 ; 辅助接口 (AUX) 线路密码为辅助接口线路所用 ; 虚拟终端线路 (VTY) 是为 telnet 会话所用, 路由器根据 Cisco IOS 软件版本不同, 支持多条 VTY 会话数目也不同. 所有密码是以明文方式保存在 DRAM(running-config) 文件里的. 配置实例一 : Aiko(config)#line console 0 Aiko(config-line)#password Aiko Aiko(config-line)#login Aiko(config-line)#line aux 0 Aiko(config-line)#password Aiko Aiko(config-line)#login Aiko(config-line)#exit Aiko(config)#line vty 0 4 Aiko(config-line)#password Aiko Aiko(config-line)#login Aiko(config-line)#end *Mar 1 03:04:43.491: %SYS-5-CONFIG_I: Configured from console by console exit Aiko con0 is now available -11-
Press RETURN to get started. User Access Verification Password:Aiko Aiko> Lab Exercise 1.7 熟练掌握如何为路由器关闭 DNS 查询功能. Cisco 2501 路由器一台. 全局配置模式下, 关闭 DNS 查询功能 : Aiko(config)#no ip domain lookup 解释 : 默认情况下, 路由器的 DNS 查询是启用的, 即当你错误的输入一条 Cisco IOS 软件无法识别的命令的时候, 路由器会把这个命令当成主机名, 然后向 DNS 服务器进行查询. 一般实验性的环境中, 如果我们没有 DNS 服务器, 因为输入错误的命令而造成无用的查询, 是非常耗时的. 因此我们可以关闭这一功能. 配置实例一 : Aiko Translating "Aiko"...domain server (255.255.255.255) Translating "Aiko"...domain server (255.255.255.255) Translating "Aiko"...domain server (255.255.255.255) % Unknown command or computer name, or unable to find computer address configure terminal Aiko(config)#no ip domain lookup Aiko(config)#end *Mar 1 03:13:12.371: %SYS-5-CONFIG_I: Configured from console by console Aiko Translating "Aiko" % Unknown command or computer name, or unable to find computer address 实验二 - 路由器连通性设置 -12-
Lab Exercise 2.1 熟练掌握如何连通路由器并进行相互间 ping 和 telnet 的测试. Cisco 2501 路由器两台. 1. 进入接口配置模式 : Aiko(config)#interface {type} {number} 2. 为接口设置 IP 地址信息 : Aiko(config-if)#ip address {ip-address} {mask} 3. 根据需要, 如果接口为串行接口, 要为 DCE 端设置时钟频率 : Aiko(config-if)#clock rate {speed} 4. 开启接口 : Aiko(config-if)#no shutdown 解释 : 默认所有接口都是处于关闭状态的, 对于一般的以太网接口, 设置了 IP 地址信息之后, 只需要开启该接口即可 ; 对于串行接口, 还要注意在 DCE 端设置时钟频率, 以便为 DTE 端提供时钟频率进行同步. 当然这一般用于实验室背对背环境中, 真正现实环境中,DCE 是由 CSU/DSU 来提供, 无须用户设置. 另外要注意的是, 端到端 (end-to-end) 的连接, 直连的接口必须处于同一子网. 配置实例一 : 路由器 Aiko 配置如下 : configure terminal Aiko(config)#interface serial 0 Aiko(config-if)#ip address 10.0.0.1 255.255.255.252 Aiko(config-if)#no shutdown *Mar 1 00:13:45.839: %LINK-3-UPDOWN: Interface Serial0, changed state to down Aiko(config-if)#end *Mar 1 00:14:24.511: %LINK-3-UPDOWN: Interface Serial0, changed state to up *Mar 1 00:14:25.515: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up 路由器 Asuqa 配置如下 : -13-
configure terminal Asuqa(config)#interface serial 0 Asuqa(config-if)#ip address 10.0.0.2 255.255.255.252 Asuqa(config-if)#clock rate 56000 Asuqa(config-if)#no shutdown Asuqa(config-if)#end Sep 25 16:24:25.347: %SYS-5-CONFIG_I: Configured from console by console Sep 25 16:24:25.787: %LINK-3-UPDOWN: Interface Serial0, changed state to up Sep 25 16:24:26.791: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up 测试一 : ping 10.0.0.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/40 ms ping 10.0.0.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/40 ms 测试二 : telnet 10.0.0.2 Trying 10.0.0.2... Open Password required, but none set [Connection to 10.0.0.2 closed by foreign host] 解释 : 在 telnet 到远端路由器的时候, 如果对方的 VTY 线路没有设置密码和启用登陆, 将拒绝本地路由器 telnet. -14-
解决方案 : 是在远端路由器设置 VTY 线路的密码和启用登陆. 路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#line vty 0 4 Asuqa(config-line)#password Aiko Asuqa(config-line)#login Asuqa(config-line)#end 测试三 : telnet 10.0.0.2 Trying 10.0.0.2... Open User Access Verification Password:Aiko Asuqa>exit [Connection to 10.0.0.2 closed by foreign host] Lab Exercise 2.2 熟练掌握如何创建主机列表, 并使用 ping 和 telnet 测试. Cisco 2501 路由器两台. 准备工作 : 确保两台路由器已经预先的端到端的连通. 全局配置模式下创建静态的 IP 地址到主机名的映射 : Aiko(config)#ip host {hostname} {ip-address} 配置实例一 : 路由器 Aiko 配置如下 : Aiko(config)#ip host Asuqa 10.0.0.2 Aiko(config)#end -15-
测试一 : Asuqa Trying Asuqa (10.0.0.2)... Open User Access Verification Password:Aiko Asuqa>exit [Connection to Asuqa closed by foreign host] 测试二 : ping Asuqa Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/40/48 ms 实验三 - 路由器恢复性设置 Lab Exercise 3.1 熟练掌握如何快速和恢复路由器到出厂设置. Cisco 2501 路由器一台. 准备工作 : 确保路由器之间有所配置. 1. 进入全局配置模式, 快速恢复路由器的接口配置到出厂配置 : Aiko(config)#default interface {type} {number} 2. 特权模式下删除启动配置文件, 路由器下次启动将全局恢复到出厂设置 : erase startup-config 配置实例一 : show running-config interface serial 0-16-
Building configuration... Current configuration : 62 bytes! interface Serial0 ip address 10.0.0.1 255.255.255.252 end configure terminal Aiko(config)#default interface serial 0 Building configuration... Interface Serial0 set to default configuration Aiko(config)#end show running-config interface serial 0 Building configuration... Current configuration : 40 bytes! interface Serial0 no ip address end Lab Exercise 3.2 熟练掌握如何重启路由器和计划性的重启路由器. Cisco 2501 路由器一台. 在特权模式下, 重启或计划性的重启路由器 : reload [at {hh:mm day year} in {minutes}] [text] 解释 : 可以定义路由器, 立即重启或在多少分钟之后, 或在具体的时间里重启, 还可以指定重启原因. 如果在重启之 前, 路由器配置文件被修改过, 系统会提醒你是否保存修改. 配置实例一 : reload in 1 the Administrator's mad -17-
System configuration has been modified. Save? [yes/no]: n Reload scheduled in 56 seconds Reload reason: the Administrator's mad Proceed with reload? [confirm] *Mar 1 00:50:49.787: %SYS-5-SCHEDULED_RELOAD: Reload requested for 00:51:42 UTC Mon Mar 1 1993 at 00:50:42 UTC Mon Mar 1 1993 by console. Reload Reason: the Administrator's mad. 测试 : show reload Reload scheduled in 47 seconds by console Reload reason: the Administrator's mad *** *** --- SHUTDOWN NOW --- *** -18-
第二章路由篇 实验一 - 静态路由基本配置 Lab Exercise 1.1 熟练掌握如何配置静态路由. Cisco 2501 路由器两台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好, 能够端到端的 ping 通. 进入全局配置模式, 定义目标网络号, 目标网络的子网掩码和下一跳地址或接口 : Aiko(config)#ip route {network} {mask} {next-hop-address exit-interface} [distance] 解释 : 选用下一跳地址和选择下一跳路由器的接口做为到达目标网络的出口的区别在于管理距离. 选择前者, 管理 距离为 1; 选择后者, 管理距离为 0 还可以在定义静态路由的时候指定管理距离. 配置实例一 : 路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#ip route 221.101.1.0 255.255.255.0 10.0.0.2 Asuqa(config)#end -19-
路由器 Aiko 配置如下 : configure terminal Aiko(config)#ip route 202.10.20.0 255.255.255.0 serial 0 Aiko(config)#end 测试 : show ip route static S 221.101.1.0/24 [1/0] via 10.0.0.2 ping 221.101.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 221.101.1.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms show ip route static S 202.10.20.0/24 is directly connected, Serial0 ping 202.10.20.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 202.10.20.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/36 ms Lab Exercise 1.2 熟练掌握如何配置默认路由. Cisco 2501 路由器两台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好, 能够端到端的 ping 通. 进入全局配置模式, 定义目标网络号, 目标网络的子网掩码分别为 0.0.0.0, 并定义下一跳地址或接口 : Aiko(config)#ip route 0.0.0.0 0.0.0.0 {next-hop-address exit-interface} [distance] 解释 : 0.0.0.0 0.0.0.0 代表所有网络. 选用下一跳地址和选择下一跳路由器的接口做为到达目标网络的出口的区 -20-
别在于管理距离. 选择前者, 管理距离为 1; 选择后者, 管理距离为 0 还可以在定义静态路由的时候指定管理 距离. 配置实例一 : 路由器 Aiko 配置如下 : configure terminal Aiko(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.1 Aiko(config)#end 测试 : show ip route static S* 0.0.0.0/0 [1/0] via 10.0.0.1 实验二 - 距离矢量路由协议基本配置 Lab Exercise 2.1 熟练掌握如何配置 RIP. Cisco 2501 路由器两台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好, 能够端到端的 ping 通. 1. 进入全局配置模式, 启用 RIP: Aiko(config)#router rip -21-
2. 定义要宣告的直连主类网络号 : Aiko(config-router)#network {network-number} 解释 : 启用了 RIP 路由协议之后, 只需要宣告主类直连网络号, 即可完成 RIP 的配置. 配置实例一 : 路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#router rip Asuqa(config-router)#network 202.10.20.0 Asuqa(config-router)#network 10.0.0.0 Asuqa(config-router)#end 路由器 Aiko 配置如下 : configure terminal Aiko(config)#router rip Aiko(config-router)#network 221.101.1.0 Aiko(config-router)#network 10.0.0.0 Aiko(config-router)#end 测试 : show ip route rip R 221.101.1.0/24 [120/1] via 10.0.0.2, 00:00:21, Serial0 ping 221.101.1.1 Type escape sequence to abort. -22-
Sending 5, 100-byte ICMP Echos to 221.101.1.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms show ip route rip R 202.10.20.0/24 [120/1] via 10.0.0.1, 00:00:02, Serial0 ping 202.10.20.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 202.10.20.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms Lab Exercise 2.2 熟练掌握如何配置 RIPv2. Cisco 2501 路由器两台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好, 能够端到端的 ping 通. 1. 进入全局配置模式, 启用 RIP: Aiko(config)#router rip 2. 启用 RIP 版本 2(RIPv2): Aiko(config-router)#version 2 3. 定义要宣告的直连主类网络号 : Aiko(config-router)#network {network-number} 解释 : 启用了 RIPv2 路由协议之后, 只需要宣告主类直连网络号, 即可完成 RIPv2 的配置. 配置实例一 : -23-
路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#router rip Asuqa(config-router)#version 2 Asuqa(config-router)#network 202.10.20.0 Asuqa(config-router)#network 10.0.0.0 Asuqa(config-router)#end 路由器 Aiko 配置如下 : configure terminal Aiko(config)#router rip Aiko(config-router)#version 2 Aiko(config-router)#network 221.101.1.0 Aiko(config-router)#network 10.0.0.0 Aiko(config-router)#end 测试 : show ip route rip R 221.101.1.0/24 [120/1] via 10.0.0.2, 00:00:21, Serial0 ping 221.101.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 221.101.1.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms -24-
show ip route rip R 202.10.20.0/24 [120/1] via 10.0.0.1, 00:00:02, Serial0 ping 202.10.20.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 202.10.20.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms 实验三 - 链路状态路由协议基本配置 Lab Exercise 3.1 熟练掌握如何配置单区域的 OSPF. Cisco 2501 路由器两台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好, 能够端到端的 ping 通. 1. 启用 OSPF 进程 : Aiko(config)#router ospf {process-id} 2. 定义参与 OSPF 进程的接口和网络 : Aiko(config-router)#network {ip-address} {wildcard-mask} area {area-id} 解释 : OSPF 进程 ID 可以使用 1 到 65535 中任何一个整数, 该 ID 只是本地的一个标识, 即一个 OSPF 网络, 每台 OSPF 路由器的进程 ID 是否一样, 和 OSPF 网络能否正常运行无关. 在定义 OSPF 路由器要宣告的区域的时候, 反掩码用来控制要宣告的范围,0 表示精确匹配,255 表示任意匹配.OSPF 网络中骨干区域为区域 0, 因此必须要有区域 0. 配置实例一 : -25-
路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#router ospf 1 Asuqa(config-router)#network 10.0.0.1 0.0.0.0 area 0 Asuqa(config-router)#network 202.10.20.0 0.0.0.255 area 0 Asuqa(config-router)#end 路由器 Aiko 配置如下 : configure terminal Aiko(config)#router ospf 65535 Aiko(config-router)#network 10.0.0.0 0.0.0.3 area 0 Aiko(config-router)#network 221.101.1.1 0.0.0.0 area 0 Aiko(config-router)#end 测试 : show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 221.101.1.1 1 FULL/ - 00:00:31 10.0.0.2 Serial0 show ip route ospf O 221.101.1.0/24 [110/74] via 10.0.0.2, 00:01:13, Serial0 ping 221.101.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 221.101.1.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/36 ms -26-
show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 202.10.20.1 1 FULL/ - 00:00:39 10.0.0.1 Serial0 show ip route ospf O 202.10.20.0/24 [110/74] via 10.0.0.1, 00:01:48, Serial0 ping 202.10.20.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 202.10.20.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/36 ms Lab Exercise 3.2 熟练掌握如何配置多区域的 OSPF. Cisco 2501 路由器两台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好, 能够端到端的 ping 通. 1. 启用 OSPF 进程 : Aiko(config)#router ospf {process-id} 2. 定义参与 OSPF 进程的接口和网络 : Aiko(config-router)#network {ip-address} {wildcard-mask} area {area-id} 解释 : OSPF 进程 ID 可以使用 1 到 65535 中任何一个整数, 该 ID 只是本地的一个标识, 即一个 OSPF 网络, 每台 OSPF 路由器的进程 ID 是否一样, 和 OSPF 网络能否正常运行无关. 在定义 OSPF 路由器要宣告的区域的时候, 反掩码用来控制要宣告的范围,0 表示精确匹配,255 表示任意匹配.OSPF 网络中骨干区域为区域 0, 因此必须要有区域 0. 多区域的设计, 才是 OSPF 网络的精髓. 配置实例一 : -27-
路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#router ospf 1 Asuqa(config-router)#network 10.0.0.1 0.0.0.0 area 0 Asuqa(config-router)#network 202.10.20.0 0.0.0.255 area 1 Asuqa(config-router)#end 路由器 Aiko 配置如下 : configure terminal Aiko(config)#router ospf 65535 Aiko(config-router)#network 10.0.0.0 0.0.0.3 area 0 Aiko(config-router)#network 221.101.1.1 0.0.0.0 area 2 Aiko(config-router)#end 测试 : show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 221.101.1.1 1 FULL/ - 00:00:37 10.0.0.2 Serial0 show ip route ospf O IA 221.101.1.0/24 [110/74] via 10.0.0.2, 00:00:22, Serial0 ping 221.101.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 221.101.1.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/36 ms -28-
show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 202.10.20.1 1 FULL/ - 00:00:31 10.0.0.1 Serial0 show ip route ospf O IA 202.10.20.0/24 [110/74] via 10.0.0.1, 00:01:03, Serial0 ping 202.10.20.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 202.10.20.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/36 ms 实验四 - 混合型路由协议基本配置 Lab Exercise 4.1 熟练掌握如何配置 EIGRP. Cisco 2501 路由器两台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好, 能够端到端的 ping 通. 1. 定义自制系统 (AS) 号并启用 EIGRP: Aiko(config)#router eigrp {AS-number} 2. 宣告直连主类网络号 : Aiko(config-router)#network {network-number} 解释 : EIGRP 做为 IGRP 的扩展, 它同时集合了距离矢量和链路状态路由协议的特点. 参与同一 EIGRP 进程的 EIGRP 路由器必须处于相同的 AS 里, 接下来只需要宣告直连的主类网络号即可. 配置实例一 : -29-
路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#router eigrp 1 Asuqa(config-router)#network 10.0.0.0 Asuqa(config-router)#network 202.10.20.0 Asuqa(config-router)#end 路由器 Aiko 配置如下 : configure terminal Aiko(config)#router eigrp 1 Aiko(config-router)#network 221.101.1.0 Aiko(config-router)#network 10.0.0.0 Aiko(config-router)#end 测试 : show ip eigrp neighbors IP-EIGRP neighbors for process 1 H Address Interface Hold Uptime SRTT RTO Q Seq Type (sec) (ms) Cnt Num 0 10.0.0.2 Se0 12 00:01:34 32 200 0 2 show ip route eigrp D 221.101.1.0/24 [90/2195456] via 10.0.0.2, 00:01:39, Serial0 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks D 10.0.0.0/8 is a summary, 00:02:00, Null0 ping 221.101.1.1 Type escape sequence to abort. -30-
Sending 5, 100-byte ICMP Echos to 221.101.1.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/36 ms show ip eigrp neighbors IP-EIGRP neighbors for process 1 H Address Interface Hold Uptime SRTT RTO Q Seq Type (sec) (ms) Cnt Num 0 10.0.0.1 Se0 10 00:02:03 687 4122 0 2 show ip route eigrp D 202.10.20.0/24 [90/2195456] via 10.0.0.1, 00:02:08, Serial0 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks D 10.0.0.0/8 is a summary, 00:02:10, Null0 ping 202.10.20.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 202.10.20.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/36 ms Lab Exercise 4.2 熟练掌握如何关闭 EIGRP 的自动汇总特性. Cisco 2501 路由器两台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好, 能够端到端的 ping 通. 1. 定义自制系统 (AS) 号并启用 EIGRP: Aiko(config)#router eigrp {AS-number} 2. 宣告直连主类网络号 : Aiko(config-router)#network {network-number} 3. 关闭自动汇总 : Aiko(config-router)#no auto-summary 解释 : 当路由更新经过主类网络边界的时候, 它会自动向主类网络号进行汇总. 路由自动汇总特性是 EIGRP 默认的 操作.EIGRP 可以关闭该特性. -31-
配置实例一 : 路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#router eigrp 1 Asuqa(config-router)#network 10.0.0.0 Asuqa(config-router)#network 202.10.20.0 Asuqa(config-router)#no auto-summary Asuqa(config-router)#end 路由器 Aiko 配置如下 : configure terminal Aiko(config)#router eigrp 1 Aiko(config-router)#network 221.101.1.0 Aiko(config-router)#network 10.0.0.0 Aiko(config-router)#no auto-summary Aiko(config-router)#end 测试 : show ip eigrp neighbors IP-EIGRP neighbors for process 1 H Address Interface Hold Uptime SRTT RTO Q Seq Type (sec) (ms) Cnt Num 0 10.0.0.2 Se0 12 00:01:34 32 200 0 2 show ip route eigrp D 221.101.1.0/24 [90/2195456] via 10.0.0.2, 00:01:40, Serial0 ping 221.101.1.1-32-
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 221.101.1.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/36 ms show ip eigrp neighbors IP-EIGRP neighbors for process 1 H Address Interface Hold Uptime SRTT RTO Q Seq Type (sec) (ms) Cnt Num 0 10.0.0.1 Se0 10 00:02:03 687 4122 0 2 show ip route eigrp D 202.10.20.0/24 [90/2195456] via 10.0.0.1, 00:02:00, Serial0 ping 202.10.20.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 202.10.20.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/36/36 ms -33-
第三章交换篇 实验一 - 层二交换机基本配置 Lab Exercise 1.1 熟练掌握如何进入交换机各种模式并设置主机名. Catalyst 2950 系列交换机一台. 1. 从路由器用户模式进入特权模式 : Aiko>enable 2. 从特权模式进入全局配置模式 : configure terminal 3. 为路由器设置主机名 : Aiko(config)#hostname {hostname} 4. 退出到特权模式 : Aiko(config)#end 5. 退出到用户模式 : disable 6. 退出控制台线路 : Aiko>quit 解释 : 交换机的模式大致可分为 : 1. 用户模式 : 权限最低, 通常只能使用少量查看性质的命令. 2. 特权模式 : 可以使用更多查看性质的命令和一些少量修改交换机参数的命令. 3. 全局配置模式 : 不能使用查看性质的命令, 但是确实做全局性修改和设置的模式, 它还可以向下分为一些子模式, 比如接口配置模式, 线路配置模式等等. 配置实例一 : Switch>enable Switch#configure terminal Switch(config)#hostname Aiko Aiko(config)#exit *Mar 1 00:04:30.815: %SYS-5-CONFIG_I: Configured from console by console disable Aiko> -34-
Lab Exercise 1.2 熟练掌握如何为交换机设置时间. Catalyst 2950 系列交换机一台. 在特权模式下设置交换机时间 : clock set {hh:mm:ss day month year} 解释 : 交换机本地的时间标识. 配置实例一 : clock set 16:16:16 25 September 2005 show clock 16:16:24.503 UTC Sun Sep 25 2005 Lab Exercise 1.3 熟练掌握如何设置空闲超时时间. Catalyst 2950 系列交换机一台. 1. 从全局配置模式进入线路配置模式, 进入控制台口线路 : Aiko(config)#line console {number} 2. 启用光标跟随 : Aiko(config-line)#logging synchronous 3. 设置当键盘多少时间内无动作, 自动被交换机弹出到用户模式以外, 即退出. 如果设置为 0 分 0 秒代表永不超时 : Aiko(config-line)#exec-timeout {minute} {second} 解释 : 所谓光标跟随, 是指当我们在输入命令的时候, 不会被一些日志信息或 debug 命令产生的调试命令所冲断. 模式该特性是没有启用的. 配置实例一 : Aiko(config)#exit -35-
*Mar 1 00:20:11.231: %SYS-5-CONFIG_I: Configured from console by consoleconfigure terminal Aiko(config)#line console 0 Aiko(config-line)#logging synchronous Aiko(config-line)#end *Mar 1 00:20:38.123: %SYS-5-CONFIG_I: Configured from console by console configure terminal Aiko(config)# 配置实例二 : show clock *15:32:12.747 UTC Mon Jul 28 2005 configure terminal Aiko(config)#line console 0 Aiko(config-line)#exec-timeout 20 0 Aiko(config)#end exit *Mar 1 00:24:33.643: %SYS-5-CONFIG_I: Configured from console by console show clock *15:52:12.747 UTC Mon Jul 28 2005 Aiko con0 is now available Press RETURN to get started. Aiko> Lab Exercise 1.4 熟练掌握如何为交换机设置标语信息和描述信息. Catalyst 2950 系列交换机一台. 1. 进入全局配置模式, 设置标语信息 : Aiko(config)#banner motd # {text} # 2. 进入接口配置模式 : Aiko(config-if)#interface {type} {number} -36-
3. 为交换机接口设置描述信息 : Aiko(config-if)#description {text} 解释 : 在设置标语信息的时候, 以 # 号做为分隔符, 并按下回车键. 描述语句的本地的一个标识, 它只在本地可见, 并 且 Cisco IOS 执行命令的时候会跳过它. 配置实例一 : Aiko(config)#banner motd # Enter TEXT message. End with the character '#'. hello! # Aiko(config)#end exit Aiko con0 is now available Press RETURN to get started. hello! Aiko> 配置实例二 : Aiko(config-if)#description LAN Sales Aiko(config-if)#end *Mar 1 02:05:48.919: %SYS-5-CONFIG_I: Configured from console by console show running-config interface ethernet 0 Building configuration... Current configuration :! interface Ethernet0 description LAN Sales shutdown end Lab Exercise 1.5 熟练掌握如何为交换机特权模式设置密码. -37-
Catalyst 2950 系列交换机一台. 进入全局配置模式, 设置密码 : Aiko(config)#enable {password secret} {password} 解释 : 两种密码的区别在于, 前者是一些低版本 Cisco IOS 软件的认证方式, 并且密码是基于明文的 ; 后者是目前 Cisco IOS 软件最常用的认证方式, 它是基于 MD5 加密的. 如果同时设置了这两种认证方式, 他们的口令必须不一样. 但是, 我们推荐使用后者进行认证, 并且如果同时设置了两种认证方式, 只有后者生效. 密码区分大小写. 配置实例一 : Aiko(config)#enable password Aiko Aiko(config)#enable secret Aiko The enable secret you have chosen is the same as your enable password. This is not recommended. Re-enter the enable secret. Aiko(config)#enable secret Asuqa Aiko(config)#exit *Mar 1 02:16:48.067: %SYS-5-CONFIG_I: Configured from console by console exit Aiko con0 is now available Press RETURN to get started. Aiko>enable Password:Asuqa show running-config Building configuration... Current configuration : 609 bytes! version 12.0 no service pad service timestamps debug uptime service timestamps log uptime no service password-encryption! hostname Aiko! -38-
logging queue-limit 100 enable secret 5 $1$NTU5$EEYi0qfB1pGENzuPxDCyz. enable password Aiko! --More-- Lab Exercise 1.6 熟练掌握如何为交换机各个配置模式设置密码. Catalyst 2950 系列交换机一台. 1. 从全局配置模式进入线路配置模式, 进入控制台口线路 : Aiko(config)#line {console vty} {start-number} [end-number] 2. 设置密码 : Aiko(config-line)#password {password} 3. 启用登陆 : Aiko(config-line)#login 解释 : 当设置密码之后, 如果不启用登陆命令, 退出之后, 交换机是不会提示输入密码的. 控制台线路密码为控制台线路所用 ; 虚拟终端线路 (VTY) 是为 telnet 会话所用, 路由器根据 Cisco IOS 软件版本不同, 支持多条 VTY 会话数目也不同. 所有密码是以明文方式保存在 DRAM(running-config) 文件里的. 配置实例一 : Aiko(config)#line console 0 Aiko(config-line)#password Aiko Aiko(config-line)#login Aiko(config)#line vty 0 15 Aiko(config-line)#password Aiko Aiko(config-line)#login Aiko(config-line)#end *Mar 1 03:04:43.491: %SYS-5-CONFIG_I: Configured from console by console exit Aiko con0 is now available Press RETURN to get started. User Access Verification Password:Aiko -39-
Aiko> 实验二 - VLAN 基本配置 Lab Exercise 2.1 熟练掌握如何创建 VLAN. Catalyst 2950 系列交换机两台. 1. 全局配置模式下, 输入 VLAN ID, 进入 VLAN 配置模式 : Aiko(config)#vlan {vlan-id} 2. 为 VLAN 设置名字. 可选 : Aiko(config-vlan)#name {vlan-name} 3. 创建了以太网 VLAN 之后, 接下来把交换机端口分配到特定的 VLAN 里. 假如你把端口分配进了不存在的 VLAN 里, 那么新的 VLAN 将自动被创建. 进入接口配置模式 : Aiko(config)#interface {interface} 4. 定义 VLAN 端口的成员关系, 把它定义为层 2 接入端口 : Aiko(config-if)#switchport mode access 5. 把端口分配进特定的 VLAN 里 : Aiko(config-if)#switchport access vlan {vlan-id} 6. 配置中继端口, 定义中继模式 : Aiko(config-if)#switchport trunk encapsulation {isl dot1q negotiate} 7. 定义端口为层 2 的中继端口 : Aiko(config-if)#switchport mode {dynamic auto dynamic desirable trunk} 解释 : 一般当 VLAN 跨交换机划分, 通常要配置中继链路. 配置实例一 : 交换机 Asuqa 配置如下 : configure terminal -40-
Asuqa(config)#vlan 2 Asuqa(config-vlan)#name Sales Asuqa(config-vlan)#vlan 3 Asuqa(config-vlan)#name Tech Asuqa(config-vlan)#interface f0/2 Asuqa(config-if)#switchport mode access Asuqa(config-if)#switchport access vlan 2 Asuqa(config-if)#no shutdown Asuqa(config-if)#interface f0/3 Asuqa(config-if)#switchport mode access Asuqa(config-if)#switchport access vlan 3 Asuqa(config-if)#no shutdown Asuqa(config-if)#interface f0/1 Asuqa(config-if)#switchport trunk encapsulation dot1q Asuqa(config-if)#switchport mode trunk Asuqa(config-if)#no shutdown Asuqa(config-if)#end 交换机 Aiko 配置如下 : configure terminal Aiko(config)#vlan 2 Aiko(config-vlan)#name Sales Aiko(config-vlan)#vlan 3 Aiko(config-vlan)#name Tech Aiko(config-vlan)#interface f0/3 Aiko(config-if)#switchport mode access Aiko(config-if)#switchport access vlan 2 Aiko(config-if)#no shutdown Aiko(config-if)#interface f0/5 Aiko(config-if)#switchport mode access Aiko(config-if)#switchport access vlan 3 Aiko(config-if)#no shutdown Aiko(config-if)#interface f0/24 Aiko(config-if)#switchport trunk encapsulation dot1q Aiko(config-if)#switchport mode trunk Aiko(config-if)#no shutdown Aiko(config-if)#end 测试 : show vlan brief -41-
VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/7 Fa0/8, Fa0/9, Fa0/10, Fa0/11 Fa0/12, Fa0/13, Fa0/14, Fa0/15 Fa0/16, Fa0/17, Fa0/18, Fa0/19 Fa0/20, Fa0/21, Fa0/22, Fa0/23 Gi0/1, Gi0/2 2 Sales active Fa0/2 3 Tech active Fa0/3 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup show vlan brief VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/4, Fa0/6 Fa0/7, Fa0/8, Fa0/9, Fa0/10 Fa0/11, Fa0/12, Fa0/13, Fa0/14 Fa0/15, Fa0/16, Fa0/17, Fa0/18 Fa0/19, Fa0/20, Fa0/21, Fa0/22 Fa0/23, Gi0/1, Gi0/2 2 Sales active Fa0/3 3 Tech active Fa0/5 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup Lab Exercise 2.2 熟练掌握如何配置 VTP. Catalyst 2950 系列交换机两台. 1. 全局配置模式下, 定义 VTP 模式 : -42-
Aiko(config)#vtp mode {server client transparent} 2. 定义 VTP 域名, 在同一 VLAN 管理域的交换机的 VTP 域名必须相同. 该域名长度为 1 到 32 字符 : Aiko(config)#vtp domain {domain-name} 3. 设置 VTP 域的密码, 同一 VTP 域里的交换机的 VTP 域的密码必须一致, 密码长度为 8 到 64 字符. 可选 : Aiko(config)#vtp password {password} 解释 : VTP 模式如果为服务器模式, 可以在交换机上增加, 删除和修改 VLAN 信息 ; 如果 VTP 模式为客户模式, 不能在交换机上增加, 删除和修改 VLAN 信息, 它的 VLAN 信息是从 VTP 模式为服务器模式的交换机上学习而来 ; 如果 VTP 模式为透明模式, 交换机可以独立维持自身的 VLAN 信息库. 默认 VTP 模式均为服务器模式. 准备工作 : VLAN 已经划分完毕. 配置实例一 : 交换机 Asuqa 配置如下 : configure terminal Asuqa(config)#vtp domain Aiko Changing VTP domain name from NULL to Aiko Asuqa(config)#vtp mode server Device mode already VTP SERVER. Asuqa(config)#vtp password Asuqa Setting device VLAN database password to Asuqa Asuqa(config)#end 交换机 Aiko 配置如下 : configure terminal Aiko(config)#vtp domain Aiko Changing VTP domain name from NULL to Aiko Aiko(config)#vtp mode client Setting device to VTP CLIENT mode. Aiko(config)#no vlan 2-43-
VTP VLAN configuration not allowed when device is in CLIENT mode. Aiko(config)#vtp password Asuqa Setting device VLAN database password to Asuqa Aiko(config)#end -44-
第四章远程篇 实验一 - 帧中继基本配置 Lab Exercise 1.1 熟练掌握如何配置帧中继 PVC. Cisco 2501 路由器两台, 帧中继交换机一台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好. 1. 接口配置模式下, 在路由器接口上启用帧中继封装 : Aiko(config-if)#encapsulation frame-relay 2. 如果做 IP 地址到 DLCI 的静态映射, 需要关闭反向 ARP(IARP): Aiko(config-if)#no frame-relay inverse-arp 3. 配置 IP 地址到 DLCI 的静态映射 : Aiko(config-if)#frame-relay map ip {ip-address} {dlci} [broadcast] 解释 : 在做帧中继静态映射的时候, 记得关闭 IARP. 配置实例一 : 路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#interface serial 1 Asuqa(config-if)#encapsulation frame-relay Asuqa(config-if)#no frame-relay inverse-arp Asuqa(config-if)#frame-relay map ip 10.0.0.2 102 broadcast Asuqa(config-if)#no shutdown Asuqa(config-if)#end -45-
00:13:56: %SYS-5-CONFIG_I: Configured from console by console 00:13:56: %LINK-3-UPDOWN: Interface Serial1, changed state to up 00:14:07: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to up 路由器 Aiko 配置如下 : configure terminal Aiko(config)#interface serial 1 Aiko(config-if)#encapsulation frame-relay Aiko(config-if)#no frame-relay inverse-arp Aiko(config-if)#frame-relay map ip 10.0.0.2 201 broadcast Aiko(config-if)#no shutdown Aiko(config-if)#end 00:15:52: %SYS-5-CONFIG_I: Configured from console by console 00:15:53: %LINK-3-UPDOWN: Interface Serial1, changed state to up 00:16:04: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to up 测试 : show frame-relay map Serial1 (up): ip 10.0.0.2 dlci 102(0x66,0x1860), static, broadcast, CISCO, status defined, active ping 10.0.0.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 96/96/100 ms show frame-relay map Serial1 (up): ip 10.0.0.1 dlci 201(0xC9,0x3090), static, broadcast, CISCO, status defined, active ping 10.0.0.1 Type escape sequence to abort. -46-
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 96/98/100 ms Lab Exercise 1.2 熟练掌握如何配置帧中继点到点子接口和多点子接口. Cisco 2501 路由器两台, 帧中继交换机一台. 1. 接口配置模式下, 如果物理接口配置的有 IP 地址信息, 移除物理接口 IP 地址信息 : Aiko(config-if)#no ip address 2. 在物理接口上设置封装类型 Aiko(config-if)#encapsulation frame-relay 3. 在物理接口上关闭 IARP: Aiko(config-if)#no frame-relay inverse-arp 4. 创建子接口并指定子接口类型 : Aiko(config-if)#interface serial {number.subif-number} {point-to-point multipoint} 5. 为子接口设置 IP 地址信息 : Aiko(config-if)#ip address {ip-address} {mask} 6. 对于点到点类型的子接口, 定义 IP 地址到 DLCI 的映射 : Aiko(config-subif)#frame-relay interface-dlci {dlci} 7. 对于点到点类型的子接口, 定义 IP 地址到 DLCI 的映射 : Aiko(config-subif)#frame-relay map ip {ip-address} {dlci} [broadcast] 解释 : 在创建子接口的时候, 别忘记指定子接口的类型. 对于点到点类型的子接口, 静态映射的命令和在物理接口下 静态映射的命令不同 ; 对于多点类型的子接口, 静态映射的命令和在物理接口下静态映射的命令相同. 配置实例一 : 路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#interface serial 1-47-
Asuqa(config-if)#encapsulation frame-relay Asuqa(config-if)#no frame-relay inverse-arp Asuqa(config-if)#frame-relay map ip 10.0.0.2 102 broadcast Asuqa(config-if)#no shutdown Asuqa(config-if)#end 00:13:56: %SYS-5-CONFIG_I: Configured from console by console 00:13:56: %LINK-3-UPDOWN: Interface Serial1, changed state to up 00:14:07: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to up 路由器 Aiko 配置如下 : configure terminal Aiko(config)#interface serial 1 Aiko(config-if)#no ip address Aiko(config-if)#encapsulation frame-relay Aiko(config-if)#no frame-relay inverse-arp Aiko(config-if)#no frame-relay inverse-arp Aiko(config-if)#no shutdown Aiko(config-subif)#interface serial 1.1 point-to-point Aiko(config-subif)#ip address 10.0.0.2 255.255.255.252 Aiko(config-subif)#frame-relay interface-dlci 201 Aiko(config-fr-dlci)#end 00:15:52: %SYS-5-CONFIG_I: Configured from console by console 00:15:53: %LINK-3-UPDOWN: Interface Serial1, changed state to up 00:16:04: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to up 测试 : show frame-relay map Serial1 (up): ip 10.0.0.2 dlci 102(0x66,0x1860), static, broadcast, CISCO, status defined, active ping 10.0.0.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 96/96/100 ms -48-
show frame-relay map Serial1 (up): ip 10.0.0.1 dlci 201(0xC9,0x3090), static, broadcast, CISCO, status defined, active ping 10.0.0.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 96/98/100 ms 配置实例二 : 路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#interface serial 1 Asuqa(config-if)#no ip address Asuqa(config-if)#encapsulation frame-relay Asuqa(config-if)#no frame-relay inverse-arp Asuqa(config-if)#no shutdown Asuqa(config-subif)#interface serial 1.1 multipoint Asuqa(config-subif)#ip address 10.0.0.1 255.255.255.252 Asuqa(config-subif)#frame-relay map ip 10.0.0.2 201 broadcast Asuqa(config-if)#end 00:13:56: %SYS-5-CONFIG_I: Configured from console by console 00:13:56: %LINK-3-UPDOWN: Interface Serial1, changed state to up 00:14:07: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to up 路由器 Aiko 配置如下 : configure terminal -49-
Aiko(config)#interface serial 1 Aiko(config-if)#encapsulation frame-relay Aiko(config-if)#no frame-relay inverse-arp Aiko(config-if)#frame-relay map ip 10.0.0.2 201 broadcast Aiko(config-if)#no shutdown Aiko(config-if)#end 00:15:52: %SYS-5-CONFIG_I: Configured from console by console 00:15:53: %LINK-3-UPDOWN: Interface Serial1, changed state to up 00:16:04: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to up 测试 : show frame-relay map Serial1 (up): ip 10.0.0.2 dlci 102(0x66,0x1860), static, broadcast, CISCO, status defined, active ping 10.0.0.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 96/96/100 ms show frame-relay map Serial1 (up): ip 10.0.0.1 dlci 201(0xC9,0x3090), static, broadcast, CISCO, status defined, active ping 10.0.0.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 96/98/100 ms 实验二 - 网络地址翻译基本配置 Lab Exercise 2.1-50-
熟练掌握如何配置静态 NAT. Cisco 2501 路由器一台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好. 1. 特权模式下, 建立内部本地地址和和内部全局地址的对应关系 : Aiko(config)#ip nat inside source static {local ip-address} {global ip-address} 2. 分别定义连接内网和外网的接口 : Aiko(config)#ip nat {inside outside} 配置实例一 : 路由器 Aiko 配置如下 : configure terminal Aiko(config)#interface serial 0 Aiko(config-if)#ip add 202.100.100.1 255.255.255.0 Aiko(config-if)#ip nat outside Aiko(config-if)#no shutdown Aiko(config-if)#interface ethernet 0 Aiko(config-if)#ip add 192.168.1.253 255.255.255.0 Aiko(config-if)#ip nat inside Aiko(config-if)#no shutdown Aiko(config-if)#end 测试 : show ip nat statistics Total active translations: 0 (0 static, 0 dynamic; 0 extended) Outside interfaces: Serial0 Inside interfaces: Ethernet0 Hits: 0 Misses: 0 Expired translations: 0-51-
Dynamic mappings: -52-
第五章策略篇 实验一 - 访问控制列表基本配置 Lab Exercise 1.1 熟练掌握如何配置标准 IP ACL. Cisco 2501 路由器两台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好. 1. 全局配置模式下, 定义标准 IP ACL: Aiko(config)#access-list {access-list-number} {permit deny} [host] {source-ip-address} [inverse-mask] 2. 接口配置模式下应用 IP ACL: Aiko(config-if)#ip access-group {access-list-number} {in out} 解释 : 标准 IP ACL 的序列号的范围是 1 到 99. 标准 IP ACL 是根据源 IP 地址进行控制, 其中反掩码用于控 制网段范围. 另外如果使用关键字 host, 反掩码即为 0.0.0.0, 可省略不写. 并且要一记住 IP ACL 末尾默认隐 含的全部拒绝. 配置实例一, 禁止 PC 1 访问路由器 Asuqa: 路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#access-list 1 deny 192.168.0.0 0.0.0.255 Asuqa(config)#access-list 1 permit any Asuqa(config)#interface serial 1 Asuqa(config-if)#ip access-group 1 in -53-
Asuqa(config-if)#end 测试 : ping Protocol [ip]: Target IP address: 172.16.0.2 Repeat count [5]: Datagram size [100]: Timeout in seconds [2]: Extended commands [n]: y Source address or interface: 192.168.0.1 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 172.16.0.2, timeout is 2 seconds: Packet sent with a source address of 192.168.0.1... Success rate is 0 percent (0/5) Lab Exercise 1.2 熟练掌握如何配置标准 IP ACL 来控制 telnet 会话的建立. Cisco 2501 路由器两台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好,VTY 线路密码设置完成. 1. 全局配置模式下, 定义标准 IP ACL: Aiko(config)#access-list {access-list-number} {permit deny} [host] {source-ip-address} [inverse-mask] 2. 接口配置模式下应用 IP ACL: Aiko(config-if)#access-class {access-list-number} {in out} 解释 : 标准 IP ACL 的序列号的范围是 1 到 99. 标准 IP ACL 是根据源 IP 地址进行控制, 其中反掩码用于控 制网段范围. 另外如果使用关键字 host, 反掩码即为 0.0.0.0, 可省略不写. 并且要一记住 IP ACL 末尾默认隐 -54-
含的全部拒绝. 配置实例一, 禁止 PC 1 远程 telnet 到路由器 Asuqa: 路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#access-list 1 deny 192.168.0.0 0.0.0.255 Asuqa(config)#access-list 1 permit any Asuqa(config)#interface serial 1 Asuqa(config)#line vty 0 4 Asuqa(config-line)#access-class 1 in Asuqa(config-line)#end 测试 : telnet 172.16.0.2 /source-interface ethernet 0 Trying 172.16.0.2... % Destination unreachable; gateway or host down Lab Exercise 1.3 熟练掌握如何配置扩展 IP ACL. Cisco 2501 路由器两台. 准备工作 : 确保路由器之间接口 IP 地址信息已经设置好. 1. 全局配置模式下, 定义扩展 IP ACL: Aiko(config)#access-list {access-list-number} {permit deny} {protocol} [host] {source-ip-address} [inverse-mask] [host] {destination-ip-address} [inverse-mask] -55-
[operator port-number] 2. 接口配置模式下应用 IP ACL: Aiko(config-if)#ip access-group {access-list-number} {in out} 解释 : 扩展 IP ACL 的序列号的范围是 100 到 199. 扩展 IP ACL 是根据协议, 端口号, 源 IP 地址, 目标 IP 地 址进行控制, 其中反掩码用于控制网段范围. 另外如果使用关键字 host, 反掩码即为 0.0.0.0, 可省略不写. 并 且要一记住 IP ACL 末尾默认隐含的全部拒绝. 配置实例一, 禁止路由器 Aiko 远程 telnet 到路由器 Asuqa: 路由器 Asuqa 配置如下 : configure terminal Asuqa(config)#access-list 101 deny tcp host 172.16.0.1 host 172.16.0.2 eq 23 Asuqa(config)#access-list 101 deny tcp host 192.168.0.1 host 172.16.0.2 eq 23 Asuqa(config)#access-list 101 permit ip any any Asuqa(config)#interface serial 0 Asuqa(config-if)#ip access-group 101 in Asuqa(config-if)#end 测试 : telnet 172.16.0.2 Trying 172.16.0.2... % Destination unreachable; gateway or host down -56-
第六章设备篇 实验一 - 系统镜象软件备份 Lab Exercise 1.1 熟练掌握如何备份 Cisco IOS 软件. Cisco 2501 路由器一台, 装有 TFTP 软件的主机一台. 准备工作 : 确保路由器以太网接口 IP 地址和主机 (TFTP 服务器 )IP 地址位于同一网段. TFTP 软件下载地址 : http://www.91lab.com/downinfolist.php?typeid=3800 特权模式下, 将 Cisco IOS 软件备份到 TFTP 服务器上 : copy flash: tftp: 解释 : 启动主机上的 TFTP 软件程序, 要确保路由器以太网接口 IP 地址和主机 (TFTP 服务器 )IP 地址位于同 一网段. 在备份之前先 ping 远程 TFTP 服务器, 看 TFTP 服务器是否存活. 并确保 TFTP 服务器上有足够空间. 配置实例一 : 路由器 Aiko 配置如下 : ping 10.1.1.199 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.199, timeout is 2 seconds:!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms show flash: System flash directory: File Length Name/status 1 16423684 c2500-is-l.122-15.t14.bin -57-
[16423748 bytes used, 353468 available, 16777216 total] 16384K bytes of processor board System flash (Read ONLY) copy flash:c2500-is-l.122-15.t14.bin tftp: Address or name of remote host []? 10.1.1.199 Destination filename [c2500-is-l.122-15.t14.bin]?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 16423684 bytes copied in 314.464 secs (52228 bytes/sec) -58-
-59-
-60-
-61-
-62-
-63-
-64-