网络互联技术实验手册第一部分 - 图文

更新时间:2024-04-25 12:10:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

第一篇 网络设备基础

第一章 路由器的访问配置方法

路由器是一种最常见的用于网络连接的设备,它实际上也是一台特定用途的计算机,但是它没有常见计算机的键盘、鼠标、显示器这样的输入输出设备,要配置路由器必须进入路由器的操作系统。路由器和计算机一样具有人机互动的操作系统,cisco路由器的操作系统叫做IOS,登陆上IOS上的方法有很多,如通过console口、通过AUX口、通过telnet程序、通过HTTP、网络管理软件等等。下面我们以最常见的console和telnet两种方法介绍路由器的访问配置方法。

实训1-1:通过console口访问路由器

实验目的:计算机的串口与路由器的console口连接的方法; 如何通过windows的超级终端连接到路由器; 路由器的开机自检过程和界面。

实验要求:掌握cisco的常见路由器型号及主要接口和功能。

掌握cisco主要连接线缆及连接方法。 掌握IOS的作用、启动顺序和常用的命令

实验拓扑:

实验步骤:

任务一:使用console线缆连接路由器的console口和计算机的串行口

1. 选择Console线缆;

第一种:DB9 转RJ45或DB25 转RJ45+反转线

第二种:console线

第三种:console线+USB转DB9

2. 物理连接好后,分别开启PC和路由器,路由器的开启方式是接通电源并按下开关键。(开启

路由器也可以在超级终端设置完成之后,更容易看到路由器的启动过程)

220伏交流电源接口 任务二:使用超级终端连接到路由器的配置界面

步骤1:打开Windows的超级终端程序

启动windows 2000 下【开始】→【程序】→【附件】→【通讯】下的“超级终端”程序,屏幕上出现如图对话框。

手动开关 “1”为开, “0”为关

在对话框的“名称”一栏中输入“cisco”(可任取),并在图标一栏中选择一个图标,然后单击【确定】按钮。此时出现了一个新的对话框,如图:

在“连接时使用”一栏的下拉列表中选择“COM1或COM2”, 然后单击【确定】按钮。 步骤2:配置端口属性

步骤1完成后,出现如图所示的“COM1属性”对话窗口。

在上述端口设置中,作修改属性 “9600 8 无 1 无 ”或点击“还原为默认值”

步骤3: 测试超级终端与路由器之间的连接,并观察路由器的启动过程 完成前2步设置之后,打开路由器电源开关,启动路由器。

System Bootstrap, Version 12.2(6r), RELEASE SOFTWARE (fc1) TAC Support: http://www.cisco.com/tac Copyright (c) 2001 by cisco Systems, Inc. C2600 platform with 32768 Kbytes of main memory

program load complete, entry point: 0x80008000, size: 0x52a07c

Self decompressing the image : ################################################# ################################################################################ ################################################################################ ################################################################################ ################################################################################ ################################################################################ ################################################################################ ################################################################################ ####################### [OK] //以上是IOS解压过程

Smart Init is enabled smart init is sizing iomem

ID MEMORY_REQ TYPE 000094 0X000BA600 C2600 Single Fast Ethernet 0X000F3BB0 public buffer pools 0X00211000 public particle pools TOTAL: 0X003BF1B0

If any of the above Memory Requirements are \configuration or there is a software problem and system operation may be compromised. Rounded IOMEM up to: 4Mb.

Using 12 percent iomem. [4Mb/32Mb]

Restricted Rights Legend

Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c) of the Commercial Computer Software - Restricted Rights clause at FAR sec. 52.227-19 and subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS sec. 252.227-7013.

cisco Systems, Inc. 170 West Tasman Drive

San Jose, California 95134-1706

Cisco Internetwork Operating System Software

IOS (tm) C2600 Software (C2600-C-M), Version 12.2(4)T1, RELEASE SOFTWARE (fc1)

//以上是IOS版本信息

TAC Support: http://www.cisco.com/tac

Copyright (c) 1986-2001 by cisco Systems, Inc. Compiled Fri 26-Oct-01 00:19 by ccai

Image text-base: 0x80008088, data-base: 0x809B0C1C

cisco 2620 (MPC860) processor (revision 0x00) with 28672K/4096K bytes of memory.

Processor board ID JAD06080AE8 (824176546) M860 processor: part number 0, mask 49 Bridging software.

SuperLAT software (copyright 1990 by Meridian Technology Corp). X.25 software, Version 3.0.0. TN3270 Emulation software.

1 FastEthernet/IEEE 802.3 interface(s) //该路由器有1个快速以太网接口 2 Serial(sync/async) network interface(s) //该路由器有2个串口(同步/异步) 32K bytes of non-volatile configuration memory. //该路由器有32KB的NVRAM

8192K bytes of processor board System flash (Read/Write) //该路由器有8192KB的FLASH

实验问答: 1. What is the model number? 2. Do you see a console port? (Y/N) 3. What port is it connected to on the console terminal (PC workstation)? 4. What type of cable is the console cable, and is it a roll-over, cross-connect or straight-through cable? 5.如果超级终端上显示的字符为乱码一般是什么问题? 实训1-2:通过telnet访问路由器

实验目的:路由器接口IP地址的配置; 路由器的密码配置; VTY线路配置;

通过Telnet配置路由器 实验要求: 实验拓扑:

实验步骤:

任务一:分别对路由器的接口和PC设置IP地址

步骤1.设置PC的网卡的IP地址设为192.168.1.100,掩码为255.255.255.0

步骤2.通过console口设置路由器的接口地址为192.168.1.1,掩码为255.255.255.0

R1>ena

Password:******* //如果路由器设置了特权密码,在此输入密码,如果没有特 R1#conf t 权密码,此处不会出现要求输入密码的对话 R1(config)#int e0

R1(config-if)#ip add 192.168.1.1 255.255.255.0 R1(config-if)#no sh R1(config-if)#end R1#

任务二:配置VTY

R1#conf t

R1(config)#line vty 0 4 // 同时允许0-4共5个连接

R1(config-line)#login //必须使用login命令,使telnet用户登陆时密码生效 R1(config-line)#password cisco1 //此处设置的为telnet登陆密码 R1(config-line)#exit

R1(config)#enable password cisco2 //如果不设置enable密码,telnet登陆后在用户模式进入特权模式

时将拒绝进入,并提示配置此密码

R1(config)#exit R1#

任务三:通过PC的telnet应用成寻登陆到路由器

在PC机上启动Telnet程序,开始---运行---CMD 输入telnet 192.168.1.2 登录到路由器

输入VTY密码进入,并对路由器进行查看和配置

如果需要退出telnet连接,在用户模式下输入exit即可。 实验问答: 1. 如果用一台pc 机使用telnet 的方式连接到路由器,此时将路由器该接口的ip 地址改变,会出现怎样的情况? 2. 除了telnet程序还有哪些软件或程序可以远程登陆? 3. 如果在VTY线路模式下不配置命令login,而配置命令no login会出现什么情 况? 4. 一般的telnet登陆到路由器需要输入路由器设置的VTY密码,如何让用户 telnet时即要输入用户名又要输入密码? 5. 如果用户在telnet到路由器时发现无法连接到路由器,应该如何排查故障? 6. 如果配置的VTY密码忘了应该怎么办? 7. 在路由器上如何查看当前登陆到本路由器的用户情况?

第二章 路由器的基本配置管理

实训2-1:CLI的模式与IOS基本配置命令

实验目的:路由器的set up配置模式;

路由器的CLI的各种模式与切换;

IOS的基本命令与“?”和【TAB】键的使用; 常用的查看路由器信息的命令; 路由器的几种密码的配置; 实验要求: 实验拓扑:

实验步骤:

任务一:Setup模式的基本配置 1.进入SETUP模式 路由器启动时,如果路由器是一台刚买回来的,或者NVRAM中没有保存启动配置文件的路由器,路由器检测到无法加载startup-config,会提示用户是否进入初始化配置对话模式(Setup模式),如下图所示,输入“Y”或“YES”即可进入SETUP模式。

如果已经进入了CLI配置模式可以在特权模式下输入setuup命令进入这种配置模式。

2. SETUP模式的基本配置

--- System Configuration Dialog ---

Continue with configuration dialog? [yes/no]: y

At any point you may enter a question mark '?' for help. Use ctrl-c to abort configuration dialog at any prompt. Default settings are in square brackets '[]'.

Basic management setup configures only enough connectivity for management of the system, extended setup will ask you to configure each interface on the system

Would you like to enter basic management setup? [yes/no]:

Would you like to enter basic management setup? [yes/no]: y Configuring global parameters: Enter host name [Router]: Router1

The enable secret is a password used to protect access to

privileged EXEC and configuration modes. This password, after entered, becomes encrypted in the configuration. Enter enable secret: cisco

The enable password is used when you do not specify an

enable secret password, with some older software versions, and some boot images.

Enter enable password: cisco1

The virtual terminal password is used to protect access to the router over a network interface. Enter virtual terminal password: cisco2 Configure SNMP Network Management? [no]:n

接下来询问是否要设置路由器支持的各种网络协议: Configure SNMP Network Management? [yes]: Configure DECnet? [no]: Configure AppleTalk? [no]: Configure IPX? [no]: Configure IP? [yes]:

Configure IGRP routing? [yes]: Configure RIP routing? [no]: ???

如果配置的是拨号访问服务器,系统还会设置异步口的参数: Configure Async lines? [yes]: 1) 设置线路的最高速度: Async line speed [9600]: 2) 是否使用硬件流控:

Configure for HW flow control? [yes]: 3) 是否设置modem:

Configure for modems? [yes/no]: yes 4) 是否使用默认的modem命令:

Configure for default chat script? [yes]: 5) 是否设置异步口的PPP参数:

Configure for Dial-in IP SLIP/PPP access? [no]: yes 6) 是否使用动态IP地址:

Configure for Dynamic IP addresses? [yes]: 7) 是否使用缺省IP地址:

Configure Default IP addresses? [no]: yes 8) 是否使用TCP头压缩:

Configure for TCP Header Compression? [yes]: 9) 是否在异步口上使用路由表更新:

Configure for routing updates on async links? [no]: y 10) 是否设置异步口上的其它协议。

接下来,系统会对每个接口进行参数的设置。 Configuring interface Ethernet0: 11) 是否使用此接口:

Is this interface in use? [yes]: 12) 是否设置此接口的IP参数:

Configure IP on this interface? [yes]: 13) 设置接口的IP地址:

IP address for this interface: 14) 设置接口的IP子网掩码:

Number of bits in subnet field [0]:

后面的不在详细介绍。在配置结束后,系统显示已配置的配置文件内容,并显示

[0] Go to the IOS command prompt without saving this config. [1] Return back to the setup without saving this config. [2] Save this configuration to nvram and exit.

Enter your selection [2]:

技巧提示: 1.在setup配置模式下,如果不想继续向导式配置,可以“Ctrl+C”强行退出至 CLI界面。 2. 3.

任务二:Cisco CLI 模式的基本配置

步骤1:Cisco IOS的几种模式与相互切换

Router>enable

Router# //进入特权模式 Router#disable //退出特权模式 Router>

Router#configure terminal //进入全局配置模式 Router(config)#interface fastEthernet 0/0 //进入接口配置模式 Router(config-if)#

路由器模式详解 路由器模式 操作提示符 用户模式 Router>

特权模式 Router#

说明

用户模式是路由器启动时的缺省模式,提供有限的路由问权限,允许执行一些非破坏性的操作,如查看路由器置参数,测试路由器的连通性等,但不能对路由器配置何改动。

特权模式,也叫使能(enable)模式,可对路由器进行的操作,使用的命令集比用户模式多,可对路由器进行

级的测试,如使用debug、reload、copy命令等。

全局配置模式 Router(config)# 可以设置路由器上的运行的硬件和软件的相关参数;配

由协议、主机名等全局参数;设置用户和访问密码等。

接口模式 Router(config-if)# 可以设置路由器上的某接口的相关属性;IP地址、带宽这四种模子接口模式 Router(config-subif)# 设置一个物理接口上的多个逻辑子接口

统称为“线路配置模式 Router(config-line)# VTY线路、console线路等

式”,都必路由配置模式 Router(config-router)# 路由协议相关配置

入全局配

后才能进全局设置模式和接口设置模式切换

式 说 明 操作提示符 用户模式 Router>enable #提示符表示交换机已处于特权执行模式 Router# 从特权执行模式切换到全局配置模式 Router#configure terminal (config)#提示符表示交换机已处于全局配置模式 Router(config)# 从全局配置模式切换到快速以太网接口0/1的接口配置模式Router(config)#interface fastetherne(config-if)#提示符表示交换机已处于接口配置模式 Router(config-if)# 从接口配置模式切换到全局配置模式 Router(config-if)#exit (config)#提示符表示交换机已处于全局模式 Router(config)# 从全局配置模式切换到特权执行模式 Router(config)#exit #提示符表示交换机已处于特权执行模式 Router# 从特权模式切换到用户模式 Router#disable

技巧提示: 1.在全局配置模式下或其他“子模式”下可以直接使用命令end,直接切换到特 权模式。 2.子模式直接的相互切换可以不需要回到全局配置模式,如 Router(config-if)#line vty 0 4 可直接进入Router(config-line)# 3.可以在每种模式下输入“?”,可以发现每种模式下可使用的命令都不一样。

任务三:“?”和[Tab]键的使用及其他IOS操作技巧 步骤1:“?”技巧的应用

以查看路由器的版本信息为例,在特权模式下输入show version,有的时候我们不能完全记清楚命令的完整写法,故可能出现操作困难的问题。

Router> Router>enable Router#show verison ^

% Invalid input detected at '^' marker. Router#

Router#show v?

version vlan-switch vtp

Router#show ?

aaa Show AAA values access-lists List access lists arp Arp table cdp CDP information class-map Show QoS Class Map clock Display the system clock ???? //以下省略

实验问答: 1. 在键入“?”前是否加空格有什么区别? 2. 当在一个命令后面输入了“?”后出现了的提示,这是什么意思? 步骤2:[Tab]键的应用

当在输入命令时,某一个命令我们无法记忆完整,但我们已经确信命令的前一部分是什么,可以在不完整的命令后直接按[Tab]键补齐命令。

如:在对路由器设置系统时间的时候我们想要输入clock set 11:11:11 1 SEP 2010,但clock这个命令记不清楚了,但知道是cl开头的命令,可以在clo后直接按下[Tab]键。

Router#clo

Router#clock //补齐后的命令

实验问答: 1.但是当我们只输入“cl ”然后按下[Tab]键就发现系统无法自动补齐命令,这 是什么原因? 步骤3:命令的简写:

Cisco IOS支持命令的简写,以简化工程师的操作,当然这种简写在熟练的情况下会大大加快我们的配置效率,如下:

Router#clo se 11:11:11 1 sep 2010 实验问答: 1.我们直接使用Router#cl se 11:11:11 1 sep 2010命令设置系统时间却出现一下问题: Router#cl set 11:11:11 1 sep 2010 % Ambiguous command: \这是为什么? 技巧提示: 1.当我们在输入命令参数的前一部分然后按[Tab]键可以补齐的命令,也可以不补 齐直接执行,也就是命令简写,然后不能补齐的命令意味着以前一部分字母开 头的命令在当前模式下不止一个命令参数,这时候最好是使用“?”键完成选 择。 2.命令参数对大小写不敏感,但是密码对大小写是敏感的。

任务三:常用的查看路由器信息的命令 步骤1:显示命令

任务 查看版本及引导信息 查看运行设置 查看开机设置 显示端口信息 显示路由信息 命令 show version show running-config show startup-config show interface type slot/number show ip router 步骤2:基本设置命令

任务 全局设置 设置访问用户及密码 设置特权密码 设置路由器名 设置静态路由 启动IP路由 启动IPX路由 端口设置 设置IP地址 设置IPX网络 激活端口 物理线路设置 启动登录进程 设置登录密码 命令 config terminal username username password password enable secret password hostname name ip route destination subnet-mask next-hop ip routing ipx routing interface type slot/number ip address address subnet-mask ipx network network no shutdown line type number login [local|tacacs server] password password 步骤3:网络命令

任务 登录远程主机 网络侦测 路由跟踪 命令 telnet hostname|IP address ping hostname|IP address trace hostname|IP address

实验问答: 1.路由器的全局配置模式下的命令banner 是什么作用,以及banner 的几种类 型和特点,如果想做一个banner 是以MMM开头的字符串,应该如何做? 完成一个banner配置命令介绍的说明文档:

实训2-2:通过TFTP对配置文件和IOS的管理

实验目的:配置TFTP服务器;

使用copy命令复制和备份配置文件; 使用copy命令备份和恢复升级IOS; IOS的灾难恢复; 实验要求: 实验拓扑:

实验步骤:

TFTP(trivial file transfer protocol)即简单文件传输协议,是允许文件在网络中从一台主机传输到另一台主机的简化的FTP 版本,大多数网络设备的软件升级采用TFTP方式。

任务一:配置TFTP服务器

在工作站上执行TFTP服务端软件,使之成为TFTP服务器。用交叉线将工作站网卡和路由器以太网口相连,将此以太网口IP 设置为与PC 机同一网段。(其实在显示中保证TFTP服务器与网络设备之间是可达的就可以进行copy操作)。

步骤一:选择安装TFTP Server 软件与安装

TFTP Server是一个安装在计算机上的软件,其软件也有多种,基本每个网络设备厂商都有自己的TFTP Server软件,其实TFTP Server基本上也都是通用的。我们以一款Cisco TFTP软件为例介绍,软件安装和其他软件安装一样,不多介绍了。

步骤二:TFTP Server的基本配置 日志文件的位置与日志文件名 TFTP备份或恢复文件的主目录

任务二:备份和恢复配置文件

步骤1:备份运行配置文件(running-config)和启动配置文件(startup-config)

Router#copy running-config tftp

Address or name of remote host []? 192.168.1.1 //输入TFTP服务器的IP地址或主机名 Destination filename [Router-confg]? 2811running-configbak //备份在TFTP服务器上生成的文件名 .!!

[OK - 463 bytes]

463 bytes copied in 3.078 secs (0 bytes/sec)

Router#copy startup-config tftp

Address or name of remote host []? 192.168.1.1

Destination filename [Router-confg]? 2811startup-configbak !!!

[OK - 463 bytes]

463 bytes copied in 3.078 secs (0 bytes/sec)

步骤2:恢复运行配置文件(running-config)和启动配置文件(startup-config)

Router#copy tftp running-config

Address or name of remote host []? 192.168.1.1 Source filename []? 2811running-configbak

Destination filename [running-config]?

Accessing tftp://192.168.1.1/2811running-configbak... Loading 2811running-configbak from 192.168.1.1: ! [OK - 463 bytes]

463 bytes copied in 0.031 secs (14935 bytes/sec)

Router#copy tftp startup-config

Address or name of remote host []? 192.168.1.1 Source filename []? 2811startup-configbak Destination filename [startup-config]?

Accessing tftp://192.168.1.1/2811startup-configbak... Loading 2811 startup -configbak from 192.168.1.1: ! [OK - 463 bytes]

463 bytes copied in 0.031 secs (14935 bytes/sec)

步骤3:备份和升级IOS文件

Router#copy flash: tftp

Source filename []? c2800nm-advipservicesk9-mz.124-15.T1.bin Address or name of remote host []? 192.168.1.1

Destination filename [c2800nm-advipservicesk9-mz.124-15.T1.bin]?

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 50938004 bytes]

50938004 bytes copied in 28.141 secs (1810000 bytes/sec)

Router#copy tftp flash:

Address or name of remote host []? 192.168.1.1

Source filename []? c2800nm-advipservicesk9-mz.124-15.T1.bin Destination filename [c2800nm-advipservicesk9-mz.124-15.T1.bin]? %Warning:There is a file already existing with this name Do you want to over write? [confirm]

Accessing tftp://192.168.1.1/c2800nm-advipservicesk9-mz.124-15.T1.bin...

Erase flash: before copying? [confirm]

Erasing the flash filesystem will remove all files! Continue? [confirm] Erasing

eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased

Erase of flash: completeAccessing tftp://192.168.1.1/c2800nm-advipservicesk9-mz.124-15.T1.bin... Loading

c2800nm-advipservicesk9-mz.124-15.T1.bin

from

192.168.1.1: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 50938004 bytes]

50938004 bytes copied in 27.843 secs (132649 bytes/sec)

device...

eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

步骤4:IOS的灾难恢复

如果IOS被损坏,例如升级IOS过程中断电等。可以在ROM monitor commands模式下通过2种方法恢复:xmodem 或者 tftpdnld,这里以tftpdnld方式介绍

1、用Cisco原配的线缆连接路由器的console口与PC机的COM1,使用PC机的超级终端软件访问路由器;用一根双绞线连接路由器的F0/0口与PC机的网卡。

2、将路由器的F0/0口IP地址设为192.168.1.2;PC机的IP地址设为192.168.1.1.将要升级的IOS映象文件拷贝到相关的目录中,并运行TFTP服务器软件,通过菜单设置Root目录为拷贝IOS映象文件所在目录。

rommon 1 >IP_ADDRESS=192.168.1.2 (路由器的ip地址)

rommon 2 >IP_SUBNET_MASK=255.255.255.0 (路由器的掩码)

rommon 3 >DEFAULT_GATEWAY=192.168.1.1 (缺省网关,是pc机的ip地址) rommon 4 >TFTP_SERVER=192.168.1.1 (是pc机的ip地址)

rommon 5 >TFTP_FILE=C2600-I-MZ.122-11.BIN (上传ios文件的名称)

rommon 6 >tftpdnld

执行tftpdnld命令进行ios升级,有时可能会报错或命令不执行, rommon 6 >tftpdnld(传送文件)出现提示选择y

IP_ADDRESS: 192.168.1.2

IP_SUBNET_MASK: 255.255.255.0 DEFAULT_GATEWAY: 192.168.1.1 TFTP_SERVER: 192.168.1.1

TFTP_FILE: C2600-I-MZ.122-11.BIN

Invoke this command for disaster recovery .ly.

WARNING: all existing data in all partitions . flash will be lost!

Do you wish to continue? y/n: [n]: y

Receiving C2600-I-MZ.122-11.BIN from 10.32.10.32!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! …

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! File reception completed.

Copying file C2600-I-MZ.122-11.BIN to flash. Erasing flash at 0x607c0000 program flash location 0x605b0000 rommon 6 >

在rommon 6 >提示符下键入reset,或重新启动路由器(power-cycle),进入正常引导状态。

实训2-3:Cisco密码设置与密码恢复

实验目标:路由器的几种常见密码的配置; 遗忘密码时密码恢复方法; 实验拓扑:

实验步骤:

任务一:路由器的几种常见密码的配置 步骤1:console密码

Router(config)#line console 0

Router(config-line)#password consolepass Router(config-line)#login

步骤2:AUX密码

Router(config)#line aux 0

Router(config-line)#password auxpass Router(config-line)#login

步骤3:enable密码

Router(config)#enable password cisco Router(config)#enable secret cisco1

步骤4:VTY密码

Router(config)#line vty 0 4

Router(config-line)#password vtypass Router(config-line)#login

步骤5:密码加密

Router(config)#service password-encryption

任务二:密码恢复

重新开机后按Ctrl+Break键

rommon 1 > confreg 0x2142 rommon 2 > reset

Router#copy startup-config running-config

Router(config)#no enable secrect //可以删除密码也可以更改,这里为删除 Router(config-line)#no enable password Router(config)# config-register 0x2102

实训2-4:CDP协议的基本配置

实验目标:通过cdp协议发现邻居设备信息; cdp协议的几种计时器; 实验拓扑:

实验步骤:

CISCO发现协议(cisco discovery protocol)是由cisco设计的专用协议,能够帮助管理员收集关于本地连接和远程连接设备的相关信息。通过使用CDP可以收集相邻设备的硬件和协议信息,此信息对于故障诊断和网络文件归档非常有用。

CDP协议是一种数据链路层协议,可以工作在不同的网络层协议之下。

任务一:通过CDP协议发现邻居信息

首先在如图所示的网络环境中,确保所有链路的二层都是连通的情况在,可以在某个设备上利用CDP协议发现邻居的相关信息。 步骤1:show cdp

Router#show cdp ?

entry Information for specific neighbor entry //CDP邻居的详细信息 interface CDP interface status and configuration //CDP协议的接口状态和配置 neighbors CDP neighbor entries //CDP邻居

Router#show cdp //此设备的CDP运行情况 Global CDP information:

Sending CDP packets every 60 seconds Sending a holdtime value of 180 seconds Sending CDPv2 advertisements is enabled 步骤2:show cdp neighbors

Router#show cdp neighbors

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone Device ID Local Intrfce Holdtme Capability Platform Port ID Switch Fas 0/0 159 S 2960 Fas 0/1 Router Ser 0/0/0 172 R C2800 Ser 0/0/0

Router#show cdp neighbors detail

Device ID: Switch Entry address(es):

Platform: cisco 2960, Capabilities: Switch

Interface: FastEthernet0/0, Port ID (outgoing port): FastEthernet0/1 Holdtime: 158

Version :

Cisco IOS Software, C2960 Software (C2960-LANBASE-M), Version 12.2(25)FX, RELEASE SOFTWARE (fc1) Copyright (c) 1986-2005 by Cisco Systems, Inc. Compiled Wed 12-Oct-05 22:05 by pt_team

advertisement version: 2 Duplex: full

---------------------------

Device ID: Router Entry address(es):

Platform: cisco C2800, Capabilities: Router

Interface: Serial0/0/0, Port ID (outgoing port): Serial0/0/0

Holdtime: 170

Version :

Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)

Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2007 by Cisco Systems, Inc. Compiled Wed 18-Jul-07 06:21 by pt_rel_team

advertisement version: 2 Duplex: full

步骤3:show cdp entry

Router# show cdp entry ?

* all CDP neighbor entries //所有邻居信息 WORD Name of CDP neighbor entry //某个邻居信息

步骤4:show cdp interface

Router#show cdp interface ? Ethernet IEEE 802.3

FastEthernet FastEthernet IEEE 802.3 GigabitEthernet GigabitEthernet IEEE 802.3z Serial Serial

Router#show cdp interface

Vlan1 is administratively down, line protocol is down Sending CDP packets every 60 seconds Holdtime is 180 seconds

FastEthernet0/0 is up, line protocol is up Sending CDP packets every 60 seconds Holdtime is 180 seconds

FastEthernet0/1 is administratively down, line protocol is down Sending CDP packets every 60 seconds Holdtime is 180 seconds

Serial0/0/0 is up, line protocol is up Sending CDP packets every 60 seconds Holdtime is 180 seconds

Serial0/0/1 is administratively down, line protocol is down Sending CDP packets every 60 seconds Holdtime is 180 seconds

任务二:CDP协议的计时器 步骤1:CDP的关闭与开启 在整台路由器上关闭CDP:

R1(config)#no cdp run 检查: R1#sh cdp

% CDP is not enabled 在某个接口上关闭CDP:

R1(config)#int f0/1 R1(config-if)#no cdp enable 检查:

R1#sh cdp int f0/1 R1#

步骤2:CDP协议的计时器

R1(config)#cdp ?

advertise-v2 CDP sends version-2 advertisements

holdtime Specify the holdtime (in sec) to be sent in packets

timer Specify the rate at which CDP packets are sent (in sec) run

技巧提示: 1.CDP协议是二层协议,所有当设备没有配置IP地址时也可以通过CDP协议发现邻居信 息。 2.CDP协议的holdtime时间是CDP组播周期的3倍。

本文来源:https://www.bwwdw.com/article/4h7p.html

Top