CCNA实验室操作指南
心得:
1.实验手册有两个作用:一是认识和了解实验设备,二是熟悉配置和排错过程;所以实验手册重点要在介绍实验设备和实验配置和排错方面;
第一章 认识CISCO路由器
本章主题
? 路由器
? 内存体系
? 启动路由器
1.1 认识CISCO路由器
路由器是一种连接多个网络或网段的网络设备,它能将不同网络或网段之间的数据信息进行“翻译”,以使它们能够相互“读”懂对方的数据,从而构成一个更大的网络。
路由器有两大典型功能,即数据通道功能和控制功能。数据通道功能包括转发决定、背板转发以及输出链路调度等,一般由特定的硬件来完成;控制功能一般用软件来实现,包括与相邻路由器之间的信息交换、系统配置、系统管理等。
现在CISCO的路由器分为三个等级,十多个系列:
1)低端接入路由器,包括CISCO2600,3600,3700系列;
2)终端模块化访问路由器,包括CISCO7200,7600系列;
3)高端电信级核心路由器,包括CISCO10000,12000GSR系列;
CISCO最近发布了下一代IP路由器,包括低端的CISCO2800,3800系列,高端的ISR系列。
1.2 2600系列路由器的界面
1.2 内存体系
? ROM相当于PC机的BIOS
? FLASH相当于PC机硬盘,包含IOS
? DRAM动态内存
? NVRAM 配置文件
1.3 启动路由器(初始配置)
打开路由器电源时,它首先需要测试它的硬件,包括内存和接口。下一步就是查找和
Console口
电源接口
Ethernet0
模块槽 2
加载I O S映像,即路由器操作系统。最后,在路由器可以在网络中正常工作之前,它需要找到它的配置信息,并使用它。
如果在打开电源的时候位于路由器控制台,则可以看见类似下面的信息:
此时,路由器已经从R O M中加载了引导程序。下一步,它将从闪存中加载它的I O S映像。它首先确认文件的完整性,然后在加载进入R A M的时候,进行解压缩。这些过程由“ R s”和“# s”代表。
下一步将看见版权声明和其他关于软件及其特点的信息。
下一步,路由器清理和测试它的接口。因为大多数C i s c o路由器具有不同的硬件配置,软件必须在接通电源的时候检测在路由器上安装了哪些特定的接口。 3
如果路由器没有在N V R A M中找到配置文件,而且没有配置为在网络上进行查找,它将开始设置对话框。好在它是菜单驱动的,你所需要做的全部工作就是回答问题。当询问,
“Would you like to enter the initial configuration dialog?(你希望进入初始配置对话框吗? )”,如果回答“ n o (不)”,则将进入正常的操作模式。回答“ y e s (是)”,则将进入菜单。
设置对话框允许你让路由器在一些非常基本的配置下运行。它将允许你命名路由器,设置启用密码和启用秘诀,启用任何一种网络层协议和为路由器接口指定合适的地址和启用动态路由选择协议。你将希望检查由这个过程产生的配置文件,以重新定义配置。
第二章 从CISCO IOS软件开始
本章主题
? 用户界面
? 路由器基础
? 初始配置
2.1认识用户行界面。
和路由器交流的最普通的方法是通过Cisco IOS软件提供的命令行界面。每个C i s c o路由器都具有一个控制台端口,它可以直接连接到P C或终端上,这样你可以在键盘上输入命令和在终端屏幕上得到输出。术语“控制台”指这个键盘和屏幕,它们直接连接到路由器上。提供用户界面和解释输入的命令的Cisco IOS软件的那部分称为命令执行器,或E X E C。
路由器有几种配置模式:
? 普通用户模式:开机直接进入普通用户模式,在该模式下我们只能查询路由器的一些基础信息,如版本号(show version)。
Router>
? 特权用户模式:在普通用户模式下输入enable命令即可进入特权用户模式,在该模式下我们可以查看路由器的配置信息和调试信息等等。
Router#
? 全局配置模式:在特权用户模式下输入configure terminal命令即可进入全局配置模式,在该模式下主要完成全局参数的配置。
Router(config)#
? 接口配置模式:在全局配置模式下输入interface interface-list即可进入接口配置模式,在该模式下主要完成接口参数的配置。
Router(config-if)#
2.1.1本节所讨论的命令
? Enable
? Exit
? End
? Ctrl^z
? Show history
? Show clock
? Clock set
? Terminal history size 4
2.1.2实验一 配置用户行(CLI)界面
2.1.2.1 所需设备:
1)2500系列路由器一台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
2.1.2.2 实验需求
1)要求熟练使用show命令查看路由器版本信息和配置信息;
2)能够修改路由器的时间显示;
3)能够为路由器配置密码;
2.1.2.2 实验配置
1)通过扁平线缆连接PC机和2501路由器,使用终端仿真程序访问2501路由器;
注意,终端仿真程序的配置要点:
2)打开路由器;在界面上出现了router>符号;
3)键入enable进入特权EXEC模式;
Router >enable
4)键入?查看在特权EXEC模式底下可以运行的选项;
5)键入show ?查看show命令下可以查看的选项;
6)键入 show history查看你已经执行过的命令;
7)键入 show clock 查看路由器上的时间显示是否正确;
8)如果不正确,使用clock set命令修改时间显示,具体配置过程如下:
Router#clock ?
Set set the time and date
Router#clock set ?
hh:mm:ss current time
Router#clock set 17:50:00 ?
<1-31> day of the month
MONTH month of the year
Router#clock set 17;50:00 1 ?
MONTH month of the year
Router#clock set 17:50:00 1 august ?
<1993-2035> year
Router#clock set 17:50:00 1 august 2004
Router#
9)你将输入的一些命令是非常长的。知道一些键盘命令,以使你可以在工作的时候向前或向后在命令行上移动,是非常有帮助的:
• CTRL-A 回到行的开始。
• CTRL-E 回到行的末尾。
• ESC-B 返回到前一个单词的开头。
• ESC-F 向前,到下一个单词的开头。
• CTRL-B 回退一个字符。
• CTRL-F 向前移动一个字符。
11)将路由器能够显示历史命令的空间扩大到100;
Router #terminal history size 100 5
12)进入全局配置模式,将超级用户权限模式加密,加密密码为非明码;
#configure terminal
#enable secret cisco
2.1.2.3 检测配置
mdcl#sh run
Building configuration...
Current configuration : 1517 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname mdcl
!
logging buffered 4096 debugging
enable secret 5 $1$c7nG$hkPABjRhAO7ZchLxBG.HW //该密码为非明码,如果命令为
! enable password cisco,则密码为明码//
username test password 0 88926
memory-size iomem 15
ip subnet-zero
!
!
2.2路由器基础
C i s c o使用下列类型的内存:
• 随机访问内存(RAM) 存储正在运行的配置或活动配置文件,路由和其他的表和数据包
缓冲区。Cisco IOS软件在主内存中运行。
• 闪存存储操作系统软件映像,或I O S映像。
• 非易失性RAM(NVRAM) 特殊的内存,在路由器电源被切断的时候,它的信息不会丢
失。用于存储系统的启动配置文件和虚拟配置注册表。
• 只读内存(ROM) ROM中的映像是路由器在启动的时候首先使用的映像。这个映像通常
是I O S的一个较旧的或较小的版本,它并不具有完整的I O S功能。
路由器的全部作用就是从一个网络向另一个网络传递数据包,所以它决定了路由器的接
口将是我们主要感兴趣的部分。接口是那些元素,它在物理上将路由器连接到各种不同类型
的网络上。一些最重要的路由器接口是串行(它通常将路由器连接到广域网链路上)和L A N接口:E t h e r n t、令牌环网和F D D I。
1.2.1本节所讨论的命令:
? Configure terminal
? Hostname
? Interface
? Show running-config
? Show startup-config
? Show flash
? Show buffers 6
? Show memory
? Show process cpu
? Show protocols
? Show starcks
? Show version
2.2.2 实验二 路由器基本的配置实验
2.2.2.1 所需设备:
1)2501路由器一台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
2.2.2.2 实验配置:
1)键入configure terminal进入全局配置模式;
2)键入hostname为路由器取一个名字;
3)键入interface Ethernet 0 进入接口配置模式;
4)键入show running-config查看当前运行的配置文件;
Router#show running-config //running-config是运行在RAM里面的配置信息//
Building configuration...
Current configuration:
!
version 11.3
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router
!
!
!
!
interface Ethernet0 //接口默认情况下是关闭的//
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
!
interface Serial1
no ip address
shutdown
!
no ip classless 7
!
line con 0
line aux 0
line vty 0 4
end
5)键入show startup-config查看NVRAM里面的配置信息;
6)键入show flash查看flash里面的IOS文件信息;
Router#show flash
File Length Name/status
1 7890728 c2500-ds-l_113-9.bin
[7890792 bytes used, 497816 available, 8388608 total]
8192K bytes of processor board System flash (Read ONLY)
注意:FLASH有两种类型,一种是只读的(read only),这种类型的FLASH内IOS是不能升级的,出厂的时候IOS就已经固化在里面;另一种是可擦写的(read write),这种类型的FALSH是可以升级IOS的。
7)键入show buffers查看日志信息;
8)键入show memory查看内存使用信息;
9)键入show process cpu查看处理器使用情况;
10)键入show protocols查看协议的使用情况;
11)键入show starcks查看堆栈使用情况;
12)键入show version查看系统硬件的配置信息、软件版本、配置文件的名称和来源,以及启动映像
Router#show version
ROM: System Bootstrap, Version 5.2(8a), RELEASE SOFTWARE
BOOTFLASH: 3000 Bootstrap Software (IGS-RXBOOT), Version 10.2(8a), RELEASE SOFTW
ARE (fc1)
RouterA uptime is 11 minutes
System restarted by power-on
System p_w_picpath file is "flash:c2500-d-l_113-5.bin", booted via flash
Bridging software.
X.25 software, Version 3.0.0.
1 Ethernet/IEEE 802.3 interface(s)
2 Serial network interface(s)
32K bytes of non-volatile configuration memory.
8192K bytes of processor board System flash (Read ONLY)
Configuration register is 0x2102
注意:在show version中,可以显示路由器所有的硬件和软件的信息,比较重要的有IOS的版
本信息,硬件接口信息,FLASH信息和寄存器值信息。
8
2.3 CISCO发现协议
C i s c o发现协议( C D P )是理解网络拓扑结构的最好方法之一。C D P是层2上的和介质和协议无关的协议,它运行在所有C i s c o制造的设备上,包括路由器、交换机和访问服务器。为了使用C D P,设备并不需要一定要配置任何网络层协议,尽管如果配置了这些地址, C D P可以找到它们。每个配置了C D P的设备向一个M A C层的多点传送地址发送周期性的消息。这些宣告包括关于发布宣告的平台的功能和软件版本的信息。
注意:CDP既然是运行在CISCO设备上的工具,也就是说它只能发现CISCO设备,其他厂商的设备它是发现不了的
2.3.1 本节所讨论的命令:
? Show cdp neighbor
? Show cdp neighbor detail
? Cdp enable
2.3.2 实验三 CISCO发现协议
2.3.2.1 所需设备:
1)2500系列路由器二台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
2.3.2.2 拓扑结构:
S0(dce)
1912
S0
R2
R1
E0
2.3.2.3 实验需求:
1)要求R2能够发现运行着的邻居路由器;
2.3.2.4 实验配置:
1)进入到R2,打开R2的E0和S0端口;
R2(config)#interface serial 0
R2(config-if)#no shutdown
R2(config-if)#interface ethernet 0
R2(config-if)#no shutdown
R2(config-if)
2)进入到R1,打开R1的S0端口;
R1(config)#interface serial 0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
3)进入到R2,在超级用户权限模式下使用show ip interface brief命令查看端口状态;
R2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0 unassigned YES unset up up
Ethernet1 unassigned YES unset administratively down down
Serial0 unassigned YES unset up up
Serial1 unassigned YES unset administratively down down 9
5)进入到R2,键入show cdp neighbor和show cdp neighbor detail命令,查看输出信息;
R2#show cdp neighbor
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater
Device ID Local Intrfce Holdtme Capability Platform Port ID
Switch Eth 0 130 T S WS-C2924-XFas 0/4
R1 Ser 0 153 R 2500 Ser 0
R2#show cdp neighbor detail
-------------------------
Device ID: Switch
Entry address(es):
Platform: cisco WS-C2924-XL, Capabilities: Trans-Bridge Switch
Interface: Ethernet0, Port ID (outgoing port): FastEthernet0/4
Holdtime : 175 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) C2900XL Software (C2900XL-C3H2S-M), Version 12.0(5)XU, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Mon 03-Apr-00 16:37 by swati
advertisement version: 2
Protocol Hello: OUI=0x00000C, Protocol ID=0x0112; payload len=27, value=00000000FFFFFFFF010121FF00000000000000036B57D180FF0001
VTP Management Domain: 'test'
-------------------------
Device ID: R1
Entry address(es):
Platform: cisco 2500, Capabilities: Router
Interface: Serial0, Port ID (outgoing port): Serial0
Holdtime : 136 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-JS-L), Version 12.2(12a), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Tue 24-Sep-02 05:44 by pwade
advertisement version: 2
10
注意:试验环境中,因为是两个串行口直接连接,所以必须有一个接口扮演DCE的角色,所以必须在连接V.35 DCE线缆的接口上设置时钟脉冲
Router(config)#interface s0
Router(config-if)#clock rate 64000
2.4 配置启动序列和密码恢复
每个C i s c o路由器具有一个1 6位配置注册表,它存储在N V R A M的一个特殊内存位置内。这个注册表控制了很多功能,其中的一些如下:
• 强制系统进入引导程序。
• 选择一个引导源和默认引导文件名称。
• 启用或禁用控制台B r e a k功能。
• 设置控制台中断波特率。
• 从R O M加载操作软件。
• 启用从T F T P服务器引导。
配置注册表引导字段是这样的一个部分,它决定了路由器是否加载I O S映像,如果加载,则从哪里得到这个映像。配置注册表最小的4位,0位到3位,构成了引导字段。
如果引导字段的值为0 x 0 (所有的4位设置为0 ),则路由器将进入R O M监视器模式。
如果引导字段的值为0 x 1 (二进制0 0 0 1 ),则路由器将从R O M中的映像引导。
如果引导字段的值为0 x 2 ~ 0 x F (二进制0 0 1 0到1111 ),路由器将按照一般的引导顺序,并在N V R A M中的配置文件中查找引导系统命令。
输入SHOW VERSION EXEC命令,以显示当前生效的配置注册表值,以及在下一次加载时使用的值。
2.4.1 本节所讨论的命令:
? Show version
? Show running-config
? Show startup-config
? Configure-register 0x2102/0x2142
2.4.2 实验四 在路由器上实现密码恢复
一个C i s c o路由器要经历一个预定义的顺序的启动过程,在加电检测和装载I O S映像之后,路由器会在N V内存寻找它的配置指令,这些指令不仅包括路由协议和地址信息,而且包括路由器的登录信息。
密码修复包括告诉路由器在启动过程中忽略N V内存中的内容,可以通过修改位于路由器N V内存中的1 6位的配置寄存器来完成这项工作,这样将导致路由器装载一个不包含任何登录密码的空白配置,使用者就可以查看N V内存配置中的密码,并决定是使用、删除还是改它们,路由器然后就可用注册的密码重启了。
2.4.2.1 所需设备:
1)2500系列路由器一台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
2.4.2.2 实验需求
1)现有CISCO2500系列路由器一台,超级权限模式被加密并且密码无法获知;要求通过密码恢复功能进入超级权限模式;
2.4.3.3 实验步骤 11
第一步 在路由器上配置一个密码;
1) 配置console口密码和超级用户权限密码;
Configure terminal
Line console 0
Password cisco
Login //在console接口下使用login命令使密码生效//
Enable password cisco
2) 查看寄存器值;
Router#show version
ROM: System Bootstrap, Version 5.2(8a), RELEASE SOFTWARE
BOOTFLASH: 3000 Bootstrap Software (IGS-RXBOOT), Version 10.2(8a), RELEASE SOFTW
ARE (fc1)
RouterA uptime is 11 minutes
System restarted by power-on
System p_w_picpath file is "flash:c2500-d-l_113-5.bin", booted via flash
Bridging software.
X.25 software, Version 3.0.0.
1 Ethernet/IEEE 802.3 interface(s)
2 Serial network interface(s)
32K bytes of non-volatile configuration memory.
8192K bytes of processor board System flash (Read ONLY)
Configuration register is 0x2102
注意:两个常用的寄存器值,0x2102正常启动,调用NVRAM配置信息;0x2142跳过NVRAM启动路由器;
第二步 启动路由器,进入ROMMON模式
打开路由器,按下ctrl + break键,进入监视模式
System Bootstrap, Version 5.2(5), RELEASE SOFTWARE
Copyright (c) 1986-1994 by cisco Systems
2500 processor with 16384 Kbytes of main memory
Abort at 0x10201A2 (PC)
>
>
第三步 在ROMMON模式下将寄存器值改成0x2142,并且重新启动路由器
>0x42
>i
第四步 查看配置信息中密码是否仍然存在
2.6 在TFTP服务器上备份配置文件和IOS
路由器也具有这样的功能,它可以将配置信息复制到T F T P服务器上,或从T F T P
12
服务器上复制配置信息。这使网络管理员可以将配置信息保存在服务器上,以跟踪配置、监视修改或者灾难恢复。如果配置大于3 2 , 0 0 0字节,则需要将配置保存在T F T P服务器上,因为3 2 , 0 0 0字
节是N V R A M可以保存的最大配置文件。当用T F T P将配置文件传送到路由器时,可以将其放置在闪存、N V R A M 或R A M内存中。当将配置放置在闪存中时,仍然需要将其放置在N V R A M或R A M,目的是路由器可以使用它。COPY TETP命令可以通过控制台或V T Y会话来执行。
2.6.1 本节所讨论的命令:
? Copy running-configuration tftp
? Copy startup-configuration tftp
? Copy flash tftp
? Ping
2.6.2 实验五 将配置文件和IOS导入TFTP服务器
2.6.2.1 所需设备:
1)2501路由器一台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
4)TFTP SERVER软件一个;
2.6.2.2 拓扑结构: E0console
2.6.2.3 配置过程:
1)使用一根反线将路由器和PC机连接起来,配置路由器E0口的IP地址为192.168.1.1,配置PC机网卡的IP地址为192.168.1.2;测试之间的连通性;
2)在PC机上装载TFTP SERVER软件;
3)配置路由器将配置文件导入TFTP服务器;
#configure terminal
#ping 192.168.1.2
#copy running-configuration tftp
#Address or name of remote host [ ] ?
#Destination filename [mdcl-confg]?
4)配置路由器将IOS文件导入TFTP服务器;
#configure terminal
#ping 192.168.1.2
#copy flash tftp
#Address or name of remote host [ ] ? 13
#Destination filename [c1700-k8sy7-mz.122-11.T11.bin]?
第三章 IP寻址
本章主题
? 主类网络
? 子网划分
? 配置IP地址
3.1 配置IP地址
3.1.1 本节所讨论的命令:
? Interface {ethernet | serial }
? Ip address {word}{netmask }
? Ip host hostname address
? Ip domain-name domain name
? No ip domain-lookup
? Ip name-server { name server ip address}
? Show host
? Ping
? telnet
? trace
3.1.2 实验六 配置IP地址
3.1.2.1 所需设备:
1)2500系列路由器三台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
3.1.2.2 拓扑结构: Frame-relaypcE0E0S1S1R1R2R3
3.1.2.3 实验需求:
1)提供网段172.16.0.0/24,要求将该网段划分成30个子网,再将其中的某一个子网划
14
分子网,是得最终的子网掩码为30位,取其中两个子网网段作为本实验的实验网段;
2)将三台路由器分别命名为R1,R2,R3;
3)在R2上使用IP HOST命令配置其他两台机器的主机名到IP 地址的映射;
4)要求使用主机名测试连通性;
5)提供DNS服务器地址为10.0.0.1/24,要求在R2上添加名称服务器的地址;
6)要求关闭R1,R3的名称服务器查找功能;
3.1.2 实验配置
第四章 点到点协议(PPP)
本章主题
? 点到点协议
? 链路控制协议配置选项
? 配置PPP
4.1 PPP配置基础
PPP是一种可以用于异步(拨号)或同步串行(ISDN)介质的数据链路层协议,它使用LCP建立并维护数据链路连接。
4.1.1 本节所讨论的命令
? Encapsulation ppp
? Username name password
? Ppp authentication chap | pap
? Show interface
4.1.2 实验七 配置PPP链路
4.1.2.1 所需设备
1)2500系列路由器两台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
4.1.2.2 拓扑结构
3.0/24
4.1.2.3 配置需求
1)要求在不使用用户认证的情况下使得R4,R3的回环接口能够互相通信;
2)使用PAP认证方式进行链路认证;
3)删除PAP认证方式,改用CHAP认证方式进行认证;
4.1.2.4 配置步骤:
第一步 在CISCO路由器上配置PPP
1)进入接口配置模式,封装二层协议PPP,配置IP地址;
R4#sh run int s1
R4
S1
S0
Lo0
4.4.4.4/32
Lo0
R3
3.3.3.3/32
15
Building configuration...
Current configuration : 81 bytes
!
interface Serial1
ip address 172.16.3.4 255.255.255.0
encapsulation ppp
end
R3#sh run int s0
Building configuration...
Current configuration:
!
interface Serial0
ip address 172.16.3.3 255.255.255.0
no ip directed-broadcast
encapsulation ppp
clockrate 64000
end
2)查看接口的封装情况;
R3#sh int s0
Serial0 is up, line protocol is up
Hardware is HD64570
Internet address is 172.16.3.3/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, loopback not set
Keepalive set (10 sec)
LCP Open
Open: IPCP, CDPCP
Last input 00:00:09, output 00:00:09, output hang never
Last clearing of "show interface" counters 00:05:59
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
60 packets input, 4246 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
83 packets output, 4238 bytes, 0 underruns
16
0 output errors, 0 collisions, 10 interface resets
0 output buffer failures, 0 output buffers swapped out
18 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up
3)使用debug ppp packets 打开调试程序;
R3#
00:47:17: Se0 PPP: I pkt type 0xC021, datagramsize 16
00:47:17: Se0 LCP: I ECHOREQ [Open] id 21 len 12 magic 0x10A273CA
00:47:17: Se0 LCP: O ECHOREP [Open] id 21 len 12 magic 0x00338DBA
第二步 配置可选的PPP认证——使用PAP协议
1)在全局配置模式下配置用户名和密码
注意:用户名是远程路由器的主机名,双方路由器的口令必须相同
R4(config)#username R3 password cisco
R4(config)#
R3(config)#username R4 password cisco
R3(config)#
2)进入接口配置模式,选择PAP认证方式
R3#sh run
Building configuration...
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R3
!
enable password cisco
!
username R4 password 0 cisco
!
!
interface Serial0
ip address 172.16.3.3 255.255.255.0
no ip directed-broadcast
encapsulation ppp
clockrate 64000
ppp authentication pap
ppp pap sent-username R3 password 7 02050D480809
!
17
R4#sh run
Building configuration...
Current configuration : 835 bytes
!
version 12.1
no service single-slot-reload-enable
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R4
!
logging rate-limit console 10 except errors
enable password cisco
!
username R3 password 0 cisco
ip subnet-zero
no ip finger
no ip domain-lookup
!
cns event-service server
!
!
interface Serial1
ip address 172.16.3.4 255.255.255.0
encapsulation ppp
ppp authentication pap
ppp pap sent-username R4 password 7 0822455D0A16
!
4)在R4打开DEBUG PPP AUTHENTICATION命令,先关闭接口,在打开接口;
R4(config)#
00:59:31: Se1 PPP: Treating connection as a dedicated line
00:59:31: Se1 PAP: O AUTH-REQ id 2 len 13 from "R4"
00:59:31: Se1 PAP: I AUTH-REQ id 2 len 13 from "R3"
00:59:31: Se1 PAP: I AUTH-ACK id 2 len 5
00:59:31: Se1 PAP: Authenticating peer R3
00:59:31: Se1 PAP: O AUTH-ACK id 2 len 5
R4(config)#
第三步 配置两种可选的PPP认证——首选CHAP,然后PAP
1)在全局配置模式下配置用户名和密码
注意:用户名是远程路由器的主机名,双方路由器的口令必须相同
2)进入接口配置模式,选择CHAP和PAP认证方式
R4#sh run int s1
18
Building configuration...
Current configuration : 160 bytes
!
interface Serial1
ip address 172.16.3.4 255.255.255.0
encapsulation ppp
ppp authentication chap pap
ppp pap sent-username R4 password 7 13061E010803
end
R3#sh run int s0
Building configuration...
Current configuration:
!
interface Serial0
ip address 172.16.3.3 255.255.255.0
no ip directed-broadcast
encapsulation ppp
clockrate 64000
ppp authentication chap pap
ppp pap sent-username R3 password 7 1511021F0725
end
3)打开DEBUG PPP AUTHENTICATION命令
R4(config)#
01:07:59: Se1 PPP: Treating connection as a dedicated line
01:07:59: Se1 CHAP: O CHALLENGE id 2 len 23 from "R4"
01:07:59: Se1 CHAP: I CHALLENGE id 3 len 23 from "R3"
01:08:00: Se1 CHAP: O RESPONSE id 3 len 23 from "R4"
01:08:00: Se1 CHAP: I RESPONSE id 2 len 23 from "R3"
01:08:00: Se1 CHAP: O SUCCESS id 2 len 4
01:08:00: Se1 CHAP: I SUCCESS id 3 len 4
R4(config)#
第五章 综合业务数据网ISDN
本章主题
? BRI&PRI
? ISDN配置和交换基础
5.1 ISDN配置和基础 19
I S D N是基于电路交换的数字化数据服务。I S D N本来是用来提供增强的语音和数据服务的。近年来I S D N主要用在以下三个方面:
1) 为家庭用户提供高速因特网服务。
2) 用做大规模拨号访问服务器的终端电路。
3) 拨号备份。ISDN BRI和P R I线路都可用来给路由器提供备份数据通路。
5.1.1 本节所讨论的命令:
? Controler t1 number
? Dialer-group group-number
? Dialer idle-timeout
? Dialer-list dialer-group list access-list
? Dialer-list dialer-group protocol protocol-name { permit | deny | list access-list-number | access-group }
? Dialer load-threshold load { outbound | inbound | either }
? Dialer-map protocol next-hop-address [ name hostname ] [broadcast ] [string ]
? Debug isdn q921
? Debug isdn q931
? Interface bri 0
? Isdn switch-type
? Ppp multilink
5.1.2 实验八 基本的ISDN配置
5.1.2.1 所需设备
1)2501路由器两台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
4)ISDN交换机一台;
5.1.2.2 拓扑结构
SPID yyyy
bri0
bri0
8895101
8895201
192.168.1.1
192.168.1.2
ISDNWITCH
5.1.2.3 配置步骤:
第一步 基本的ISDN 配置
机类型

本地线路是否正常
dialer-list 命令配置感兴趣流量
1)在两台路由器上配置交换
2)给路由器的BRI0接口封装PPP协
3)在BRI0接口上配置IP地址
4)在BRI0接口上配置SPID
5)使用#isdn call test 命令测试
6)使用#dialer map 命令为路由器做地址映射
第二步 配置DDR
1) 在全局模式下用
20
2) 将dialer-list绑定到接口上
第三步 扩展配置
1)配置路由器,使得它的 idle-timeout 时间缩短为 60s;
时候,启用第二条链路;
第六章 帧中继
本章主题
器配置成帧中继交换机
分 P V C 网格网络
.1 把一个 CISCO 路由器配成帧中继交换机
vc
ute
p
路由器配成帧中继交换机和配置基本的交换机连接
器三台;
PC 一台;
.1.2.3 实验需求
第四步 配置多链路捆绑,在第一条链路的负载达到50%的
第五步 测试路由器之间的连通性;
? 帧中继技术的概述
? 把一个C i s c o路由
? LMI自动检测
? 可抛弃帧的配置
? 帧中继映射语句
? 具有全链接性的部
? 帧中继子接口
6
6.1.1 本节所讨论的命令:
? Frame-relay switching
? Frame-relay route
? Show frame-relay p
? Show frame-relay lmi
? Frame-relay map
? Show frame-relay ro
? Show frame-relay map
? Frame-relay lmi-type
? Frame-relay intf-type
? Frame-relay inverse ar
6.1.2 实验九 把一个CISCO
6.1.2.1 所需设备:
1)2501路由
2)运行终端仿真程序的
3)一条CISCO扁平线缆;
6.1.2.2 拓扑结构 R1 switch R2
s0
s1 s0
s1
101 102
6
21
1)使用拓扑上标注的 DLCI 值将一台 2500 系列路由器模拟成帧中继交换机;
步骤:
由器设置成交换机模式
64000
nfiguration...
urrent configuration : 958 bytes
rsion 12.1
gle-slot-reload-enable
stname R4
gging rate-limit console 10 except errors
ername R3 password 0 cisco
-lookup
ame-relay switching
terface Serial0
frame-relay
101 int s1 100
2)R1,R2之间的网段为172.16.3.0/24;要求配置帧中继链路,使得R1,R2能够互
相通信; 6.1.2.3 配置
第一步 配置交换机
1) 在全局模式下将路
2) 在接口下面封装二层协议
3) 将该接口配置成DCE
4) 将该接口时钟速率改成
5) 配置本地管理接口类型为cisco
6) 配置DLCI和接口映射的路由
R4#sh run
Building co
C
!
ve
no service sin
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
ho
!
lo
enable password cisco
!
us
ip subnet-zero
no ip finger
no ip domain
!
fr
cns event-service server
!
!
in
no ip address
encapsulation
clockrate 64000
frame-relay route
frame-relay lmi-type cisco
frame-relay intf-type dce
!
22
interface Serial1
me-relay
101
kerberos source-interface any
rver
d
二步 配置路由器
层协议
RP 解析
ation...
urrent configuration:
terface Serial1
6.3.2 255.255.255.0
3 101
3#sh run int s0
ation...
urrent configuration:
terface Serial0
6.3.3 255.255.255.0
2 100
no ip address
clock rate 64000
encapsulation fra
frame-relay route 100 int s0
frame-relay lmi-type cisco
frame-relay intf-type dce
!
ip
ip classless
no ip http se
!
!
En

7) 在接口下面封装二
8) 配置本地管理类型为cisco
9) 配置IP地址
10) 关闭动态INA
11) 配置frame-relay map
R2#sh run int s1
Building configur
C
!
in
ip address 172.1
no ip directed-broadcast
encapsulation frame-relay
frame-relay map ip 172.16.3.
no frame-relay inverse-arp
end
R
Building configur
C
!
in
ip address 172.1
no ip directed-broadcast
encapsulation frame-relay
frame-relay map ip 172.16.3.
23
no frame-relay inverse-arp
end
第三步 测试连接
ype escape sequence to abort.
s to 172.16.3.2, timeout is 2 seconds:
ss rate is 100 percent (5/5), round-trip min/avg/max = 60/60/60 ms
三步 测试帧中继链路
lmi 查看本地管理接口状态;
MI Statistics for interface Serial0 (Frame Relay DCE) LMI TYPE = CISCO
0
t 54
s for interface Serial1 (Frame Relay DCE) LMI TYPE = CISCO
0
t 28
dlci 101(0x65,0x1850), static,
用 show frame-relay pvc 查看 pvc 信息;
VC Statistics for interface Serial0 (Frame Relay DCE)
Active Inactive Deleted Static
R3#ping 172.16.3.2
T
Sending 5, 100-byte ICMP Echo
!!!!!
Succe
R3#

1) 使用show frame-relay
R4#sh frame-relay lmi
L
Invalid Unnumbered info 0 Invalid Prot Disc 0
Invalid dummy Call Ref 0 Invalid Msg Type 0
Invalid Status Message 0 Invalid Lock Shift 0
Invalid Information ID 0 Invalid Report IE Len
Invalid Report Request 0 Invalid Keep IE Len 0
Num Status Enq. Rcvd 54 Num Status msgs Sen
Num Update Status Sent 0 Num St Enq. Timeouts 0
LMI Statistic
Invalid Unnumbered info 0 Invalid Prot Disc 0
Invalid dummy Call Ref 0 Invalid Msg Type 0
Invalid Status Message 0 Invalid Lock Shift 0
Invalid Information ID 0 Invalid Report IE Len
Invalid Report Request 0 Invalid Keep IE Len 0
Num Status Enq. Rcvd 28 Num Status msgs Sen
Num Update Status Sent 0 Num St Enq. Timeouts 0
2)使用show frame-relay map 查看frame-relay和IP的对应表;
R2#sh frame-relay map
Serial1 (up): ip 172.16.3.3
CISCO, status defined, active
R2#
3)使
R4#sh frame-relay pvc
P
Local 0 0 0 0
24
Switched 1 0 0 0
Unused 0 0 0 0
DLCI = 101, DLCI USAGE = SWITCHED, PVC STATUS = ACTIVE, INTERFACE =
input pkts 5 output pkts 5 in bytes 520
s:
tf down 0 no out PVC 0
for interface Serial1 (Frame Relay DCE)
Active Inactive Deleted Static
LCI = 100, DLCI USAGE = SWITCHED, PVC STATUS = ACTIVE, INTERFACE =
input pkts 5 output pkts 5 in bytes 520
s:
tf down 0 no out PVC 0
第七章 IP 路由协议
本章主题
Serial0
out bytes 520 dropped pkts 0 in FECN pkts 0
in BECN pkts 0 out FECN pkts 0 out BECN pkts 0
in DE pkts 0 out DE pkts 0
out bcast pkts 0 out bcast bytes 0
switched pkts 5
Detailed packet drop counter
no out intf 0 out in
in PVC down 0 out PVC down 0 pkt too big 0
shaping Q full 0 pkt above DE 0 policing drop 0
pvc create time 00:17:25, last time pvc status changed 00:08:31
PVC Statistics
Local 0 0 0 0
Switched 1 0 0 0
Unused 0 0 0 0
D
Serial1
out bytes 520 dropped pkts 0 in FECN pkts 0
in BECN pkts 0 out FECN pkts 0 out BECN pkts 0
in DE pkts 0 out DE pkts 0
out bcast pkts 0 out bcast bytes 0
switched pkts 5
Detailed packet drop counter
no out intf 0 out in
in PVC down 0 out PVC down 0 pkt too big 0
shaping Q full 0 pkt above DE 0 policing drop 0
pvc create time 00:16:29, last time pvc status changed 00:08:42
R4#
25
? 静态路由
? RIPv1
? IGRP
? EIGRP
? OSPF
7.1 静态路由
静态路由是这样的一种路由,它通过人工输入到路由选择表中。图5 - 6说明了静态路由的一个例子。静态路由选择有许多优点:
• 不需要动态路由选择协议,这减少了路由器的日常开销。
• 在小型互连网络上很容易配置。
• 可以控制路由选择。
7.1.1 本节所讨论的命令:
? Ip route {destination prefix} {prefix mask} {next-hop-address}
? Show ip route
? Show ip protcocol
7.1.2 实验七 静态路由的配置
7.1.2.1 所需设备:
1)2501路由器五台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
7.1.2.2 拓扑结构: R1R2R5R3R4E0E0S1S1S1S1S0172.16.yy.0/241.0/242.0/243.0/24Lo02.2.2.2/32Lo04.4.4.4/32Lo05.5.5.5/32
103105301501
Lo0
1.1.1.1/32
Lo0
3.3.3.3/32
7.1.2.3 实验需求:
给出五台路由器,划分成三个网段;要求使用静态路由协议,使得路由器之间能够互相通信;
7.1.2.4 实验步骤
1)配置二层链路; 26
R1,R3,R5之间跑frame-relay链路,R4,R3之间跑PPP链路;
2)给各个接口配置IP地址;
3)在各台路由器上配置静态路由;
4)测试路由器之间的连通性;
R1#sh run
Building configuration...
Current configuration : 743 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R1
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Ethernet0
ip address 172.16.1.1 255.255.255.0
!
interface Ethernet1
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 172.16.2.1 255.255.255.0
encapsulation frame-relay
frame-relay map ip 172.16.2.3 103 broadcast
frame-relay map ip 172.16.2.5 105 broadcast
no frame-relay inverse-arp
!
27
ip classless
ip route 172.16.3.0 255.255.255.0 172.16.2.3
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
End
R2#sh run
Building configuration...
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R2
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
no ip directed-broadcast
!
interface Ethernet0
ip address 172.16.1.2 255.255.255.0
no ip directed-broadcast
!
interface Ethernet1
no ip address
no ip directed-broadcast 28
shutdown
!
interface Serial0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1
no ip address
no ip directed-broadcast
shutdown
!
no ip http server
ip classless
ip route 172.16.2.0 255.255.255.0 172.16.1.1
ip route 172.16.3.0 255.255.255.0 172.16.1.1
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
End
R3#sh run
Building configuration...
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R3
!
!
!
!
!
!
29
ip subnet-zero
no ip domain-lookup
!
cns event-service server
!
!
!
!
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
no ip directed-broadcast
!
interface Ethernet0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0
ip address 172.16.3.3 255.255.255.0
no ip directed-broadcast
encapsulation ppp
!
interface Serial1
ip address 172.16.2.3 255.255.255.0
no ip directed-broadcast
encapsulation frame-relay
frame-relay map ip 172.16.2.5 301 broadcast
frame-relay map ip 172.16.2.1 301 broadcast
no frame-relay inverse-arp
!
ip classless
ip route 172.16.1.0 255.255.255.0 172.16.2.1
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
30
End
R4#sh run
Building configuration...
Current configuration : 798 bytes
!
version 12.1
no service single-slot-reload-enable
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R4
!
logging rate-limit console 10 except errors
!
ip subnet-zero
no ip finger
no ip domain-lookup
!
cns event-service server
!
!
!
!
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 172.16.3.4 255.255.255.0
encapsulation ppp
clockrate 64000
!
ip kerberos source-interface any
31
ip classless
ip route 172.16.1.0 255.255.255.0 172.16.3.3
ip route 172.16.2.0 255.255.255.0 172.16.3.3
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
End
R5#sh run
Building configuration...
Current configuration:
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R5
!
!
!
!
!
!
ip subnet-zero
no ip domain-lookup
!
cns event-service server
!
!
!
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface Ethernet0
32
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 172.16.2.5 255.255.255.0
encapsulation frame-relay
frame-relay map ip 172.16.2.3 501 broadcast
frame-relay map ip 172.16.2.1 501 broadcast
no frame-relay inverse-arp
!
ip classless
ip route 172.16.1.0 255.255.255.0 172.16.2.1
ip route 172.16.3.0 255.255.255.0 172.16.2.3
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
end
7.2 RIPv1
7.2.1 本节所讨论的命令:
? Router rip
? Network
? Show ip route
? Show ip protocols
? Show running-configuration
? Ping
? no split-horizon
7.2.2 实验八 配置RIP路由协议
7.2.2.1 所需设备:
1)2501路由器五台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
7.2.2.2 拓扑结构: 33
R1R2R5R3R4E0S1S1S1S1S0172.16.yy.0/242.8/293.0/24Lo02.2.2.2/32Lo04.4.4.4/32Lo05.5.5.5/32S1S04.0/24Lo03.3.3.3/32Lo01.1.1.1/321.0/24E0
103105301501
7.2.2.3 实验需求;
1)使用RIP路由协议,使得所有的环回地址能够互相ping通;
7.2.2.4 实验步骤
1)配制二层链路,确认二层链路配置正确;
2)创建还回地址,为所有接口配置IP地址;
3)配置路由协议,查看路由协议的运行状况;
4)查看路由表;
5)测试路由器之间的连通性;
R1#sh run
Building configuration...
Current configuration : 748 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R1
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
!
interface Loopback0
34
ip address 1.1.1.1 255.255.255.255
!
interface Ethernet0
ip address 172.16.1.1 255.255.255.0
!
interface Ethernet1
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 172.16.2.1 255.255.255.0
encapsulation frame-relay
frame-relay map ip 172.16.2.3 103 broadcast
frame-relay map ip 172.16.2.5 105 broadcast
no frame-relay inverse-arp
!
router rip
network 1.0.0.0
network 172.16.0.0
!
ip classless
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
End
R2#sh run
Building configuration...
Current configuration:
!
version 12.0
service timestamps debug uptime
35
service timestamps log uptime
no service password-encryption
!
hostname R2
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
no ip directed-broadcast
!
interface Ethernet0
ip address 172.16.1.2 255.255.255.0
no ip directed-broadcast
!
interface Ethernet1
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1
no ip address
no ip directed-broadcast
shutdown
!
router rip
network 2.0.0.0
network 172.16.0.0
!
no ip http server
ip classless
!
!
line con 0
36
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
End
R3#sh run
Building configuration...
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R3
!
!
!
!
!
!
ip subnet-zero
no ip domain-lookup
!
cns event-service server
!
!
!
!
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
no ip directed-broadcast
!
interface Ethernet0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0
37
ip address 172.16.3.3 255.255.255.0
no ip directed-broadcast
encapsulation ppp
!
interface Serial1
ip address 172.16.2.3 255.255.255.0
no ip directed-broadcast
encapsulation frame-relay
frame-relay map ip 172.16.2.5 301 broadcast
frame-relay map ip 172.16.2.1 301 broadcast
no frame-relay inverse-arp
!
router rip
network 3.0.0.0
network 172.16.0.0
!
ip classless
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
End
R4#sh run
Building configuration...
Current configuration : 758 bytes
!
version 12.1
no service single-slot-reload-enable
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R4
!
logging rate-limit console 10 except errors
38
!
ip subnet-zero
no ip finger
no ip domain-lookup
!
cns event-service server
!
!
!
!
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 172.16.3.4 255.255.255.0
encapsulation ppp
clockrate 64000
!
router rip
network 4.0.0.0
network 172.16.0.0
!
ip kerberos source-interface any
ip classless
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
39
End
R5#sh run
Building configuration...
Current configuration:
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R5
!
!
!
!
!
!
ip subnet-zero
no ip domain-lookup
!
cns event-service server
!
!
!
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 172.16.2.5 255.255.255.0
encapsulation frame-relay
frame-relay map ip 172.16.2.3 501 broadcast
frame-relay map ip 172.16.2.1 501 broadcast
no frame-relay inverse-arp
!
40
router rip
network 5.0.0.0
network 172.16.0.0
!
ip classless
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
end
7.3 IGRP
7.3.1 本节所讨论的命令:
Clear ip route
? Debug ip igrp events
? Debug ip igrp transaction
? Neighbor
? Network
? Show ip route igrp
? Show ip protocol
? Timers basic
? variance
7.3.2 实验九 配置IGRP路由协议
7.3.2.1 设备需求:
1)2501路由器五台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
7.3.2.2 拓扑结构: 41
R1R2R5R3R4E0E0S1S1S1S1S0172.16.yy.0/241.0/242.0/243.0/24Lo02.2.2.2/32Lo04.4.4.4/32Lo05.5.5.5/32S1S04.0/24Lo03.3.3.3/32Lo01.1.1.1/321912
103105501301
7.3.2.3 配置需求:
1)配置路由器,使得路由器的环回地址可以互相通信;
2)R2,R4之间能够负载均衡;
7.3.2.4 实验步骤
1)配制二层链路,确认二层链路配置正确;
2)创建还回地址,为所有接口配置IP地址;
3)配置路由协议,查看路由协议的运行状况;
4)查看路由表;
5)测试路由器之间的连通性;
6)配置R2,R4之间的负载均衡;
R1#sh run
Building configuration...
06:28:13: %SYS-5-CONFIG_I: Configured from console by console
Current configuration : 763 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R1
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
42
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Ethernet0
ip address 172.16.1.1 255.255.255.0
shutdown
!
interface Ethernet1
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 172.16.2.1 255.255.255.0
encapsulation frame-relay
frame-relay map ip 172.16.2.3 103 broadcast
frame-relay map ip 172.16.2.5 105 broadcast
no frame-relay inverse-arp
!
router igrp 100
network 1.0.0.0
network 172.16.0.0
!
ip classless
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
End
R2#
R2#sh run
Building configuration...
43
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R2
!
!
ip subnet-zero
no ip domain-lookup
!
!
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
no ip directed-broadcast
!
interface Ethernet0
ip address 172.16.1.2 255.255.255.0
no ip directed-broadcast
!
interface Ethernet1
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial1
ip address 172.16.4.2 255.255.255.0
no ip directed-broadcast
!
router igrp 100
variance 6
network 2.0.0.0
network 172.16.0.0
!
no ip http server
44
ip classless
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
End
R3#sh run
Building configuration...
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R3
!
!
!
!
!
!
ip subnet-zero
no ip domain-lookup
!
cns event-service server
!
!
!
!
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
no ip directed-broadcast
!
interface Ethernet0
no ip address 45
no ip directed-broadcast
shutdown
!
interface Serial0
ip address 172.16.3.3 255.255.255.0
no ip directed-broadcast
encapsulation ppp
!
interface Serial1
ip address 172.16.2.3 255.255.255.0
no ip directed-broadcast
encapsulation frame-relay
frame-relay map ip 172.16.2.5 301 broadcast
frame-relay map ip 172.16.2.1 301 broadcast
no frame-relay inverse-arp
!
router igrp 100
network 3.0.0.0
network 172.16.0.0
!
ip classless
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
End
R4#sh run
Building configuration...
Current configuration : 804 bytes
!
version 12.1
no service single-slot-reload-enable
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
46
!
hostname R4
!
logging rate-limit console 10 except errors
!
ip subnet-zero
no ip finger
no ip domain-lookup
!
cns event-service server
!
!
!
!
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface Ethernet0
ip address 172.16.1.4 255.255.255.0
!
interface Serial0
ip address 172.16.4.4 255.255.255.0
clockrate 64000
!
interface Serial1
ip address 172.16.3.4 255.255.255.0
encapsulation ppp
clockrate 64000
!
router igrp 100
network 4.0.0.0
network 172.16.0.0
!
ip kerberos source-interface any
ip classless
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
47
line aux 0
line vty 0 4
!
End
R5#sh run
Building configuration...
Current configuration:
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R5
!
!
!
!
!
!
ip subnet-zero
no ip domain-lookup
!
cns event-service server
!
!
!
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface Ethernet0
no ip address
shutdown
!
interface Serial0
no ip address
shutdown
!
interface Serial1
ip address 172.16.2.5 255.255.255.0
encapsulation frame-relay
frame-relay map ip 172.16.2.3 501 broadcast
48
frame-relay map ip 172.16.2.1 501 broadcast
no frame-relay inverse-arp
!
router igrp 100
network 5.0.0.0
network 172.16.0.0
!
ip classless
no ip http server
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
transport input none
line aux 0
line vty 0 4
!
End
7.4 OSPF
7.4.1 本节所讨论的命令:
? Router ospf process-id
? Network address wildmask area area-id
? Neighbor ip address [priority number] [poll-interval seconds]
? Ip ospf priority unmber
? Ip ospf network {broadcast | non-broadcast | point-to-multipoint }
? Ip ospf hello interval
? Ip ospf dead interval
? Ip ospf cost
? Debug ip ospf events
7.4.2 实验十 配置单区域的OSPF
7.4.2.1 设备需求:
1)2501路由器五台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
7.4.2.2 拓扑结构: 49
R1R2R5R3R4E0E0S1S1S1S1S0172.16.yy.0/241.0/242.8/293.0/24Lo02.2.2.2/32Lo04.4.4.4/32Lo05.5.5.5/32S1S04.0/24Lo03.3.3.3/32Lo01.1.1.1/321912
103105501301
7.4.2.3 配置需求:
1)配置路由器,使得路由器的环回地址可以互相通信;
2)R2,R4之间能够负载均衡;
7.4.2.4 实验步骤
1)配制二层链路,确认二层链路配置正确;
2)创建还回地址,为所有接口配置IP地址;
3)配置路由协议,查看路由协议的运行状况;
4)查看路由表;
5)测试路由器之间的连通性;
7.5 EIGRP
7.5.1 本节所讨论的命令:
? Variance
? Show ip protcocol
? Show ip eigrp topology
? Show ip eigrp interface
? Router eigrp
? Passive-interface
? Network
? Debug ip eigrp
? Ip hello-interval eigrp
? Ip hold-interval eigrp
7.5.2 实验十一 配置EIGRP
7.5.2.1 设备需求:
1)2501路由器五台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
7.5.2.2 拓扑结构: 50
R1R2R5R3R4E0E0S1S1S1S1S0172.16.yy.0/241.0/242.8/293.0/24Lo02.2.2.2/32Lo04.4.4.4/32Lo05.5.5.5/32S1S04.0/24Lo03.3.3.3/32Lo01.1.1.1/321912
103105501301
7.5.2.3 实验需求:
1)配置路由器,使得路由器的环回地址可以互相通信;
2)R2,R4之间能够负载均衡;
7.5.2.4 实验步骤:
1)配制二层链路,确认二层链路配置正确;
2)创建还回地址,为所有接口配置IP地址;
3)配置路由协议,查看路由协议的运行状况;
4)查看路由表;
5)测试路由器之间的连通性;
6)配置R2,R4之间的负载均衡;
第八章 用访问列表管理基本通信量
本章主题
? 标准访问列表
? 扩展访问列表
? 命名访问列表
8.1 配置标准访问列表
8.1.1 本节所讨论的命令:
? Access-list access-list-number {deny | permit } { source [source-wildmask]| any }
? Show access-list
? Ping
? Show running-configuration
? Interface
? Ip access-group access-list-number { in | out }
? Access-class access-list-number { in | out }
8.1.2 实验十二 配置标准访问列表 51
8.1.2.1 设备需求
1)2501路由器5台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
8.1.2.2拓扑结构 R1R2R5R3R4E0E0S1S1S1S1S0172.16.yy.0/241.0/242.8/293.0/24Lo02.2.2.2/32Lo04.4.4.4/32Lo05.5.5.5/32S1S04.0/24Lo03.3.3.3/32Lo01.1.1.1/321912
8.1.2.3 实验需求:
1)在R1,R2,R3,R4,R5上启用loopback接口;
2)要求使用RIP路由协议,使得R1和R2的loopback接口能够互相通信;
3)要求使用标准访问列表,使得:
1)R4的4.0/24和3.0/24网段的主机能够访问到R1的loopback0接口,R4的1.0/24网段不能访问到该接口;
2)R4的4.0/24和1.0/24网段的主机不能访问到R5的loopback接口,其他网段都是可以的;
3)只允许4.0/24网段的主机通过虚拟终端访问R1,不允许其他网段主机通过虚拟终端访问R1;
8.1.2.4 实验步骤:
8.2 配置扩展访问列表
8.2.1 本节所讨论的命令
? {no} access-list access-list-number { deny | permit } protocol source source-wildmask destination destination-wildmask
? Ip access-group access-list-number { in | out }
8.2.2 实验十三 配置扩展访问列表
8.2.2.1 设备需求:
1)2501路由器5台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆; 52
8.2.2.2 拓扑结构 R1R2R5R3R4E0E0S1S1S1S1S0172.16.yy.0/241.0/242.8/293.0/24Lo02.2.2.2/32Lo04.4.4.4/32Lo05.5.5.5/32S1S04.0/24Lo03.3.3.3/32Lo01.1.1.1/321912
8.2.2.3 实验需求:
1)在所有路由器上启用环回接口;
2)要求使用单区域OSPF路由协议,使得所有的网段都能够互相通信;
3)要求使用扩展访问列表,使得:
1)1.0/24网段上的主机能够访问到2.8/29网段上的HTTP,TELNET,ICMP连接;
2)4.0/24网段上的主机不能访问到2.8/29网段上的ICMP连接,其他连接都可以访问;
8.2.2.4 实验步骤
8.3 命名访问列表
8.3.1 本节所讨论的命令:
? I P ACCESS-LIST STANDARD name or IP ACCESS-LIST EXTENDED name
? {DENY | PERMIT} protocol source source-wildcard destination destination wildcard
? Show access-list
? Ip access-group access-list-name
? Sh ip interface
8.3.2 实验十四 配置命名访问列表
8.3.2.1 设备需求:
1)2501路由器5台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
8.3.2.2 拓扑结构 53
R1R2R5R3R4E0E0S1S1S1S1S0172.16.yy.0/241.0/242.8/293.0/24Lo02.2.2.2/32Lo04.4.4.4/32Lo05.5.5.5/32S1S04.0/24Lo03.3.3.3/32Lo01.1.1.1/321912
8.3.2.3 实验需求
1)在所有路由器上启用环回接口;
2)要求使用EIGRP路由协议,使得所有的网段都能够互相通信;
3)要求使用命名访问列表,使得:
1)1.0/24网段上的主机能够访问到2.8/29网段上的HTTP,TELNET,ICMP连接;
2)4.0/24网段上的主机不能访问到2.8/29网段上的ICMP连接,其他连接都可以访问;
8.3.2.4 实验步骤
第九章 虚拟局域网(VLAN)
本章主题
? VLAN
? STP
? VTP
? VLAN间路由
9.1 认识1900系列交换机
本节所讨论的命令:
? Enable
? Disable
? Show version
? Show running-config
? Show interfaces
? Show ip
? Ip address
9.1.1 实验 认识1900系列交换机的基本配置命令
9.1.1.1 所需设备
1)1912交换机一台; 54
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
9.1.1.2 实验需求
1)在VLAN1上配置管理地址为192.168.205.201/24,默认网关为192.168.205.254
2) 要求在catalyst1900系列交换机上创建3个VLAN,分别取名为engineer,account,manager;
3)将ethernet0/1-4划分进engineer,5-8划分进account,9-12划分进manager
4)将fa0/26-27配置成trunk口;
5)创建一个VTP域,命名为sinoteacher,密码为cisco,模式为server;
9.1.1.3 实验步骤
(config)#ip address 192.168.205.201 255.255.255.0
(config)#ip default-gateway 192.168.205.254
(config)#vlan 2 name engineer
(config)#vlan 3 name account
(config)#vlan 4 name manager
(config)#interface ethernet 0/1
(config-if)#vlan-membership static 2
………………..
#sh vlan
VLAN Name Status Ports
--------------------------------------
1 default Enabled AUI, A, B
2 engineer Enabled 1-4
3 account Enabled 5-8
4 manager Enabled 9-12
1002 fddi-default Suspended
1003 token-ring-defau Suspended
1004 fddinet-default Suspended
1005 trnet-default Suspended
--------------------------------------
VLAN Type SAID MTU Parent RingNo BridgeNo Stp Trans1 Trans2
---------------------------------------------------------------------------
1 Ethernet 100001 1500 0 0 0 Unkn 1002 1003
2 Ethernet 100002 1500 0 1 1 Unkn 0 0
3 Ethernet 100003 1500 0 1 1 Unkn 0 0
4 Ethernet 100004 1500 0 1 1 Unkn 0 0
1002 FDDI 101002 1500 0 0 0 Unkn 1 1003
1003 Token-Ring 101003 1500 1005 1 0 Unkn 1 1002
--More--
1004 FDDI-Net 101004 1500 0 0 1 IEEE 0 0
1005 Token-Ring-Net 101005 1500 0 0 1 IEEE 0 0
---------------------------------------------------------------------------
55
#
(config)#interface fastEthernet 0/26
(config-if)#trunk auto
(config-if)#interface fastethernet 0/27
(config-if)#trunk auto
(config-if)#
(config)#vtp domain sinoteacher
(config)#vtp password cisco
(config)#vtp server
(config)#
#sh run
Building configuration...
Current configuration:
!
!
port-channel mode auto
vtp domain "sinoteacher"
vtp password "cisco"
!
vlan 2 name "lab1" sde 100002 state Operational mtu 1500
vlan 3 name "VLAN0003" sde 100003 state Operational mtu 1500
vlan 4 name "VLAN0004" sde 100004 state Operational mtu 1500
vlan 9 name "cisco" sde 100009 state Operational mtu 1500
vlan 100 name "VLAN0100" sde 100100 state Operational mtu 1500
!
ip address 192.168.205.201 255.255.255.0
ip default-gateway 192.168.205.254
!
interface Ethernet 0/1
vlan-membership static 2
!
interface Ethernet 0/2
vlan-membership static 2
!
interface Ethernet 0/3
vlan-membership static 2
!
interface Ethernet 0/4
vlan-membership static 2
!
56
interface Ethernet 0/5
--More--
vlan-membership static 3
!
interface Ethernet 0/6
vlan-membership static 3
!
interface Ethernet 0/7
vlan-membership static 3
!
interface Ethernet 0/8
vlan-membership static 3
!
interface Ethernet 0/9
vlan-membership static 4
!
interface Ethernet 0/10
--More--
vlan-membership static 4
!
interface Ethernet 0/11
vlan-membership static 4
!
interface Ethernet 0/12
vlan-membership static 4
!
interface Ethernet 0/25
!
interface FastEthernet 0/26
!
!
trunk Auto 57
!
interface FastEthernet 0/27
--More--
!
!
trunk Auto
!
line console
end
9.2 认识2950系列交换机
Catalyst 2950系列包括Catalyst 2950T-24、2950-24、2950-12和2950C-24交换机。Catalyst 2950-24交换机有24个10/100端口;2950-12有12个10/100端口;2950T-24有24个10/100端口和2个固定10/100/1000 BaseT上行链路端口; 2950C-24有24个10/100端口和2个固定100 BaseFX上行链路端口。每个交换机占用一个机柜单元(RU),这样它们方便地配置到桌面和安装在配线间内。
9.2.1 实验 交换机console口的基本配置
用Console口对交换机进行配置是最标准最常见的配置方法。用Console口配置交换机时需要专用的串口配置电缆连接交换机的Console口和主机的串口,实验室都已经配备好。实验前我们要检查配置电缆是否连接正确并确定使用主机的第几个串口。在创建超级终端时需要此参数。完成物理连线后,我们来创建超级终端。Windows系统一般都在附件中附带超级终端软件。在创建过程中我们要注意如下参数:选择对应的串口(com1或com2);配置串口参数。
串口的配置参数如下: 58
单击确定按钮即可正常建立与交换机的通信。如果交换机已经启动,按Enter键即可进入交换机的普通用户模式。若还没有启动,打开交换机电源我们会看到交换机的启动过程,启动完成后同样进入普通用户模式。
新一代交换机的几种配置模式:
? 普通用户模式:开机直接进入普通用户模式,在该模式下我们只能查询交换机的一些基础信息,如版本号(show version)。
? 特权用户模式:在普通用户模式下输入enable命令即可进入特权用户模式,在该模式下我们可以查看交换机的配置信息和调试信息等等。
? 全局配置模式:在特权用户模式下输入configure terminal命令即可进入全局配置模式,在该模式下主要完成全局参数的配置,具体配置在后面详细介绍。
? 接口配置模式:在全局配置模式下输入interface interface-list即可进入接口配置模式,在该模式下主要完成接口参数的配置,具体配置在后面详细介绍。
? VLAN配置模式:在全局配置模式下输入vlan database即可进入VLAN配置模式下该配置模式下可以完成VLAN的一些相关配置。
在使用命令行进行配置的时候,我们不可能完全记住所有的命令格式和参数,所以思科交换机为我们维护和工程人员提供了强有力的帮助功能,在任何模式下均可以使用“?”来帮助我们完成配置。使用“?”可以查询任何模式下可以使用的命令,或者某参数后面可以输入的参数,或者以某字母开始的命令。如在全局配置模式下输入“?”或“show ?”或“s?”,您看看它们分别有什么帮助信息显示。
9.3 配置2950系列交换机
9.3.1本节所讨论的命令:
? Vlan database
? Vlan number name
? Apply
? Vlan-membership static number
? Switchport mode { access | trunk }
? Switchport access vlan number
? Trunk on
? Vtp server
? Vtp domain domain-name
59
? Vtp password pass
? Vtp mode
? Show vtp
? Show vlan
9.3.2 实验 在2900系列交换机上配置VLAN
9.32.1 所需设备
1)2900系列交换机一台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
9.3.2.2 实验配置
1)配置一个管理地址为192.168.205.200/24,所属VLAN为VLAN1,缺省网管为192.168.205.254;
Switch(config)#int vlan 1
Switch(config-if)#no sh
Switch(config-if)#ip address 192.168.205.200 255.255.255.0
Switch(config-if)#ip default-gateway 192.168.205.254
2)在2924上起三个VLAN,分别取名为engineer , account, manager;
Switch#vlan database
Switch(vlan)#vlan 3 name engineer
VLAN 3 added:
Name: engineer
Switch(vlan)#vlan 4 name account
VLAN 4 added:
Name: account
Switch(vlan)#vlan 5 name manager
VLAN 5 added:
Name: manager
Switch(vlan)#apply
3)将端口12-15加入到engineer当中,端口16-18加入到account当中,端口19-22加入到manager当中;
Switch(config)#interface range fastEthernet 0/12 -0/15
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 3
Switch(config-if)#interface range fastethernet 0/16 -0/18
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 4
Switch(config-if)#interface range fastethernet 0/19 -0/22
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 5
4)将端口23和24配置成干道端口,并且帮定为一个以太通道;
Switch(config)#interface port-channel 1
Switch(config)#interface range fastethernet 0/23 -0/24
60
Switch(config-if)#channel-group 1
9.3.3 实验 在2950交换机上配置VTP
9.3.3.1 实验设备
1)2950-24系列交换机两台;
2)运行终端仿真程序的PC一台;
3)一条CISCO扁平线缆;
9.3.3.2 拓扑结构
Switch A
Switch B
9.3.3.3 实验需求
1)要求将switchA的VTP设置成server模式,switchB设置成client模式;
2)要求给两台交换机的VTP加密,加密密码为CISCO
3)在switchA上设置两个VLAN,分别命名为engineer,account;查看switchB上是否也存在这两个VLAN;
9.3.3.4 实验步骤
SwitchA#vlan database
SwitchA(vlan)#vtp domain sinoteacher
Domain name already set to sinoteacher .
SwitchA(vlan)#vtp password cisco
Password already set to cisco.
SwitchA(vlan)#vtp server
Device mode already VTP SERVER.
SwitchA(vlan)#
SwitchB(vlan)#vtp domain sinoteacher password cisco
Domain name already set to sinoteacher .
Password already set to cisco.
SwitchB(vlan)#vtp client
Setting device to VTP CLIENT mode.
SwitchB(vlan)#
61