62
第第第 第第第第第 Cisco IOS

第6讲 操作与配置Cisco Ios

  • Upload
    fl-yu

  • View
    2.280

  • Download
    4

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: 第6讲 操作与配置Cisco Ios

第六讲操作与配置Cisco IOS

Page 2: 第6讲 操作与配置Cisco Ios

www.cisco.com

本章目标本章目标

通过本章的学习,您应该掌握以下内容 :

• 开启交换机和路由器并观察其启动过程• 注意交换机的出厂初始配置情况,完成路由器的初

始参数配置• 在网络设备上进入并辨识不同的命令模式• 在不同的用户界面下应用各种帮助和命令行编辑功

能• 查看并确认各网络设备的基本信息

Page 3: 第6讲 操作与配置Cisco Ios

www.cisco.com

Cisco IOS 软件提供多种网络服务进而支持各种网络应用 .

Cisco 互连网操作系统 (IOS) 软件

Cisco 互连网操作系统 (IOS) 软件

Page 4: 第6讲 操作与配置Cisco Ios

www.cisco.com

• 硬件自检

• 查找并加载 Cisco IOS 映象文件

• 查找并运行配置文件

Cisco 设备的简单启动过程Cisco 设备的简单启动过程

Page 5: 第6讲 操作与配置Cisco Ios

www.cisco.com

• 可以通过多种途径来配置• 配置直接在设备的内存中生

控制端口

Aux 端口

端口

PC or Unix 服务器

Web 或网络管理服务器

虚拟终端

多种途径的配置多种途径的配置

Telnet

TFTP

Page 6: 第6讲 操作与配置Cisco Ios

www.cisco.com

• 提供命令行界面• 在不同的网络设备上运行时有差别 • 在命令模式下可以键入或粘贴命令

• 键入命令后回车,设备立即解析和执行所键入的命令

• 两个主要命令模式是用户模式和特权模式

• 不同的命令模式有不同的提示符

CiscoIOS

Cisco IOS 用户界面的基本特性Cisco IOS 用户界面的基本特性

Page 7: 第6讲 操作与配置Cisco Ios

www.cisco.com

用户模式• 对交换机和路由器的有限操作• 命令提示符为 主机名 >

主要有两个命令模式提供命令键入 .

模式一 :

Cisco IOS 的主要命令模式Cisco IOS 的主要命令模式

Page 8: 第6讲 操作与配置Cisco Ios

www.cisco.com

特权 ( 或 enabled) 模式• 对交换机和路由器更深入的操作• 有配置和监视权力• 是进入其它配置模式的前提• 命令提示符为

主机名 #

模式二 ( 也是最常用的模式 ):

Cisco IOS 的主要命令模式 ( 续 )Cisco IOS 的主要命令模式 ( 续 )

Page 9: 第6讲 操作与配置Cisco Ios

www.cisco.com

• 系统启动例程会初始化交换机• 初始启动利用缺省配置参数

1. 启动前确认正确连接线缆和控制线

2. 接入电源

3. 观察启动顺序– 面板上的指示灯 LEDs

– Cisco IOS 输出到控制台上的内容

交换机的初始启动交换机的初始启动

Page 10: 第6讲 操作与配置Cisco Ios

www.cisco.com

检查交换机指示灯 (LEDs)检查交换机指示灯 (LEDs)

Page 11: 第6讲 操作与配置Cisco Ios

www.cisco.com

交换机自检期间的端口指示灯 交换机自检期间的端口指示灯

1. 启动时,所有端口指示灯变绿 .

2. 每个端口自检完毕,对应的指示灯熄灭 .

3. 如果端口自检失败 , 对应指示灯呈黄色 .

4. 如果有任何自检失败情况,系统指示灯呈现黄色 .

5. 如果没有自检失败 , 自检过程完成 .6. 随着自检过程的完成 , 指示灯闪亮后熄灭 .

Page 12: 第6讲 操作与配置Cisco Ios

www.cisco.com

交换机初次启动时的显示信息交换机初次启动时的显示信息

控制台连接

Catalyst 1900 Management ConsoleCopyright (c) Cisco Systems, Inc. 1993-1998All rights reserved.Enterprise Edition SoftwareEthernet Address: 00-50-BD-73-E2-C0

PCA Number: 73-3121-01PCA Serial Number: FAA0252A0QXModel Number: WS-C1924-ENSystem Serial Number: FAA0304S0U3Power Supply S/N: PHI025101F3-------------------------------------------------

1 user(s) now active on Management Console.

User Interface Menu

[M] Menus [K] Command Line [I] IP Configuration

Enter Selection:

Page 13: 第6讲 操作与配置Cisco Ios

www.cisco.com

控制台

登入交换机并键入特权模式密码登入交换机并键入特权模式密码

>> enableEnter password:## disable> quit

用户模式提示用户模式提示

特权模式提示特权模式提示

Page 14: 第6讲 操作与配置Cisco Ios

www.cisco.com

Switch#show interfacesSwitch#show interfaces

Switch#show versionSwitch#show version

显示交换机初始启动的状态显示交换机初始启动的状态

Switch#show running-config

显示交换机的各种运行状态

Page 15: 第6讲 操作与配置Cisco Ios

www.cisco.com

wg_sw_c#show version

Cisco Catalyst 1900/2820 Enterprise Edition SoftwareVersion V8.01.01 written from 171.068.229.225Copyright (c) Cisco Systems, Inc. 1993-1998wg_sw_c uptime is 15day(s) 21hour(s) 53minute(s) 11second(s) cisco Catalyst 1900 (486sxl) processor with 2048K/1024K bytes of memoryHardware board revision is 5Upgrade Status: No upgrade currently in progress. Config File Status: No configuration upload/download is in progress 27 Fixed Ethernet/IEEE 802.3 interface(s)Base Ethernet Address: 00-50-BD-73-E2-C0

交换机之 show version 命令交换机之 show version 命令

Page 16: 第6讲 操作与配置Cisco Ios

www.cisco.com

wg_sw_c#show run

Building configuration...Current configuration:!hostname "wg_sw_c"!ip address 10.1.1.33 255.255.255.0ip default-gateway 10.3.3.3!interface Ethernet 0/1<text omitted>interface Ethernet 0/24!Interface Ethernet 0/25!interface FastEthernet 0/26!interface FastEthernet 0/27

wg_sw_c#show run

Building configuration...Current configuration:!hostname "wg_sw_c"!ip address 10.1.1.33 255.255.255.0ip default-gateway 10.3.3.3!interface Ethernet 0/1<text omitted>interface Ethernet 0/24!Interface Ethernet 0/25!interface FastEthernet 0/26!interface FastEthernet 0/27

交换机之 show running-configuration 命令

交换机之 show running-configuration 命令

wg_sw_c#show run

Building configuration...Current configuration:!hostname "wg_sw_c"!ip address 10.1.1.33 255.255.255.0ip default-gateway 10.3.3.3!interface Ethernet 0/1<text omitted>interface Ethernet 0/12!Interface Ethernet 0/25!interface FastEthernet 0/26!interface FastEthernet 0/27

wg_sw_c#show run

Building configuration...Current configuration:!hostname "wg_sw_c"!ip address 10.1.1.33 255.255.255.0ip default-gateway 10.3.3.3!interface Ethernet 0/1<text omitted>interface Ethernet 0/12!Interface Ethernet 0/25!interface FastEthernet 0/26!interface FastEthernet 0/27

Catalyst 1924Catalyst 1912

Page 17: 第6讲 操作与配置Cisco Ios

www.cisco.com

wg_sw_c#show interfaces ethernet 0/1

Ethernet 0/1 is Enabled Hardware is Built-in 10Base-TAddress is 0050.BD73.E2C1MTU 1500 bytes, BW 10000 Kbits802.1d STP State: Forwarding Forward Transitions: 1Port monitoring: DisabledUnknown unicast flooding: Enabled Unregistered multicast flooding: Enabled Description: Duplex setting: Half duplex Back pressure: Disabled--More--

交换机之 show interfaces 命令交换机之 show interfaces 命令

Page 18: 第6讲 操作与配置Cisco Ios

www.cisco.com

配置模式 :• 全局配置模式

– wg_sw_a# conf term

– wg_sw_a(config)#

• 端口配置模式– wg_sw_a(config)# interface e0/1

– wg_sw_a(config-if)#

配置交换机配置交换机

Page 19: 第6讲 操作与配置Cisco Ios

www.cisco.com

配置交换机的各种标识配置交换机的各种标识

为交换机设置本地标识

交换机名(config)#hostname wg_sw_cwg_sw_c(config)#

Page 20: 第6讲 操作与配置Cisco Ios

www.cisco.com

• 系统启动例程会初始化路由器• 如果需要,路由器可以有选择性地回退启动

Check hardware

Find and load Cisco IOSsoftware image

Find and apply routerconfiguration information

Load Bootstrap1. 启动前确认正确连接线缆和控制线2. 按下电源开关3. 观察启动顺序

Cisco IOS 输出到控制台上的内容

Cisco 路由器的初始启动Cisco 路由器的初始启动

Page 21: 第6讲 操作与配置Cisco Ios

www.cisco.com

没有配置文件与有配置文件的路由器启动对比

--- System Configuration Dialog ---

Continue with configuration dialog? [yes/no]:yes 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 '[ ]'.

Setup 模式Setup 模式

wg_ro_c con0 is now available

Press RETURN to get started.

用户模式提示

用户模式提示wg_ro_c>

路由器启动时在控制台上的输出内容

路由器启动时在控制台上的输出内容

控制台

Page 22: 第6讲 操作与配置Cisco Ios

www.cisco.com

Setup: 初始配置对话框 Setup: 初始配置对话框

Router#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 connectivityfor management of the system, extended setup will ask youto configure each interface on the system

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

Page 23: 第6讲 操作与配置Cisco Ios

www.cisco.com

预先浏览端口配置情况预先浏览端口配置情况

First, would you like to see the current interface summary? [yes]:

Interface IP-Address OK? Method Status Protocol

BRI0 unassigned YES unset administratively down down

BRI0:1 unassigned YES unset administratively down down

BRI0:2 unassigned YES unset administratively down down

Ethernet0 unassigned YES unset administratively down down

Serial0 unassigned YES unset administratively down down

First, would you like to see the current interface summary? [yes]:

Interface IP-Address OK? Method Status Protocol

BRI0 unassigned YES unset administratively down down

BRI0:1 unassigned YES unset administratively down down

BRI0:2 unassigned YES unset administratively down down

Ethernet0 unassigned YES unset administratively down down

Serial0 unassigned YES unset administratively down down

• 自检过程中所找到的端口

Page 24: 第6讲 操作与配置Cisco Ios

www.cisco.com

设置全局参数设置全局参数

初始化全局参数

Configuring global parameters:

Enter host name [Router]:wg_ro_c

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: sanfran

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

Configuring global parameters:

Enter host name [Router]:wg_ro_c

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: sanfran

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

Page 25: 第6讲 操作与配置Cisco Ios

www.cisco.com

设置全局参数 ( 续 )设置全局参数 ( 续 )

初始化协议配置

Configure LAT? [yes]: n Configure AppleTalk? [no]: Configure DECnet? [no]: Configure IP? [yes]: Configure IGRP routing? [yes]: n Configure RIP routing? [no]: Configure CLNS? [no]: Configure IPX? [no]: Configure Vines? [no]: Configure XNS? [no]: Configure Apollo? [no]:

Page 26: 第6讲 操作与配置Cisco Ios

www.cisco.com

设置端口参数设置端口参数BRI interface needs isdn switch-type to be configured Valid switch types are : [0] none..........Only if you don't want to configure BRI. [1] basic-1tr6....1TR6 switch type for Germany [2] basic-5ess....AT&T 5ESS switch type for the US/Canada [3] basic-dms100..Northern DMS-100 switch type for US/Canada [4] basic-net3....NET3 switch type for UK and Europe [5] basic-ni......National ISDN switch type [6] basic-ts013...TS013 switch type for Australia [7] ntt...........NTT switch type for Japan [8] vn3...........VN3 and VN4 switch types for France Choose ISDN BRI Switch Type [2]:

Configuring interface parameters:

Do you want to configure BRI0 (BRI d-channel) interface? [no]:

Do you want to configure Ethernet0 interface? [no]: y Configure IP on this interface? [no]: y IP address for this interface: 10.1.1.33 Subnet mask for this interface [255.0.0.0] : 255.255.255.0 Class A network is 10.0.0.0, 24 subnet bits; mask is /24

Do you want to configure Serial0 interface? [no]:

BRI interface needs isdn switch-type to be configured Valid switch types are : [0] none..........Only if you don't want to configure BRI. [1] basic-1tr6....1TR6 switch type for Germany [2] basic-5ess....AT&T 5ESS switch type for the US/Canada [3] basic-dms100..Northern DMS-100 switch type for US/Canada [4] basic-net3....NET3 switch type for UK and Europe [5] basic-ni......National ISDN switch type [6] basic-ts013...TS013 switch type for Australia [7] ntt...........NTT switch type for Japan [8] vn3...........VN3 and VN4 switch types for France Choose ISDN BRI Switch Type [2]:

Configuring interface parameters:

Do you want to configure BRI0 (BRI d-channel) interface? [no]:

Do you want to configure Ethernet0 interface? [no]: y Configure IP on this interface? [no]: y IP address for this interface: 10.1.1.33 Subnet mask for this interface [255.0.0.0] : 255.255.255.0 Class A network is 10.0.0.0, 24 subnet bits; mask is /24

Do you want to configure Serial0 interface? [no]:

Page 27: 第6讲 操作与配置Cisco Ios

www.cisco.com

设置脚本的确认与应用设置脚本的确认与应用The following configuration command script was created:

hostname Routerenable secret 5 $1$/CCk$4r7zDwDNeqkxFO.kJxC3G0enable password sanfranline vty 0 4password sanjoseno snmp-server!no appletalk routingno decnet routingip routingno clns routingno ipx routingno vines routingno xns routingno apollo routingisdn switch-type basic-5ess

interface BRI0shutdownno ip address!interface Ethernet0no shutdownip address 10.1.1.31 255.255.255.0no mop enabled!interface Serial0shutdownno ip address<text omitted>end

[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]:

Page 28: 第6讲 操作与配置Cisco Ios

www.cisco.com

Console

wg_ro_c>wg_ro_c>enablewg_ro_c#wg_ro_c#disablewg_ro_c>wg_ro_c>logout

wg_ro_c con0 is now availablePress RETURN to get started.

用户模式提示用户模式提示

特权模式提示特权模式提示

登入路由器登入路由器

Page 29: 第6讲 操作与配置Cisco Ios

www.cisco.com

只要所输命令串在全部命令中是唯一的,可以将一个命令尽可能地简写,

路由器在用户模式下的命令清单路由器在用户模式下的命令清单

wg_ro_c>?Exec commands: access-enable Create a temporary Access-List entry atmsig Execute Atm Signalling Commands cd Change current device clear Reset functions connect Open a terminal connection dir List files on given device disable Turn off privileged commands disconnect Disconnect an existing network connection enable Turn on privileged commands exit Exit from the EXEC help Description of the interactive help system lat Open a lat connection lock Lock the terminal login Log in as a particular user logout Exit from the EXEC-- More --

Page 30: 第6讲 操作与配置Cisco Ios

www.cisco.com

wg_ro_c#?Exec commands: access-enable Create a temporary Access-List entry access-profile Apply user-profile to interface access-template Create a temporary Access-List entry bfe For manual emergency modes setting cd Change current directory clear Reset functions clock Manage the system clock configure Enter configuration mode connect Open a terminal connection copy Copy from one file to another debug Debugging functions (see also 'undebug') delete Delete a file dir List files on a filesystem disable Turn off privileged commands disconnect Disconnect an existing network connection enable Turn on privileged commands erase Erase a filesystem exit Exit from the EXEC help Description of the interactive help system-- More --

路由器在特权模式下的命令清单路由器在特权模式下的命令清单

只要输入部分命令串 (唯一表示某个命令 ) ,紧接着按 tab 键就可以完整地输入一个命令

Page 31: 第6讲 操作与配置Cisco Ios

www.cisco.com

路由器命令行帮助机制路由器命令行帮助机制

上下文关联帮助 错误信息提示

指出所输入交换机命令的错误所在,以便于修改或纠正 .

可以重新调出一个较长或较复杂的命令或其它内容,用来再次运行、查看或修改 .

之前命令保存区

提供命令清单和与特定命令相关联的参数 .

Page 32: 第6讲 操作与配置Cisco Ios

www.cisco.com

路由器的上下文相关联帮助路由器的上下文相关联帮助

Router# clok

Translating "CLOK"

% Unknown command or computer name, or unable to find computer address

Router# cl?

clear clock

Router# clock

% Incomplete command.

Router# clock ?

set Set the time and date

Router# clock set

% Incomplete command.

Router# <Ctrl-P>clock set ?

hh:mm:ss Current Time

• 符号解析•命令提示•调出最近用过的内容

Page 33: 第6讲 操作与配置Cisco Ios

www.cisco.com

路由器的上下文相关联帮助 ( 续 )路由器的上下文相关联帮助 ( 续 )

Router# clok

Translating "CLOK"

% Unknown command or computer name, or unable to find computer address

Router#

clear clock

Router#

% Incomplete command.

Router#

set Set the time and date

Router#

% Incomplete command.

Router#

hh:mm:ss Current Time

Router# clock set 19:56:00

% Incomplete command.

Router# clock set 19:56:00 ?

<1-31> Day of the month

MONTH Month of the year

Router# clock set 19:56:00 04 8

^% Invalid input detected at the '^' marker

Router# clock set 19:56:00 04 August

% Incomplete command.

Router# clock set 19:56:00 04 August ?

<1993-2035> Year

• 命令提示• 语法检查• 命令提示

Page 34: 第6讲 操作与配置Cisco Ios

www.cisco.com

Router>Shape the future of internetworking by creating unpreced

使用增强的编辑命令使用增强的编辑命令

“Shape the future of internetworking by creating unprecedented value for customers, employees, and partners.”上述文字段在输入时会超出一行

Page 35: 第6讲 操作与配置Cisco Ios

www.cisco.com

Router>$ future of internetworking by creating unprecedented op

使用增强的编辑命令使用增强的编辑命令

( 一行中长字串会自动滚卷 ).

Page 36: 第6讲 操作与配置Cisco Ios

www.cisco.com

Router>Shape the value of internetworking by creating unpreced

使用增强的编辑命令使用增强的编辑命令

( 一行中长字串会自动滚卷 ).

<Ctrl-A> 光标移动到命令行的开始位置 .

Page 37: 第6讲 操作与配置Cisco Ios

www.cisco.com

Router>$ value for customers, employees, and partners.

使用增强的编辑命令使用增强的编辑命令

( 一行中长字串会自动滚卷 ).

<Ctrl-A> 光标移动到命令行的开始位置 .

<Ctrl-E> 光标移动到命令行的结束位置 .

Page 38: 第6讲 操作与配置Cisco Ios

www.cisco.com

使用增强的编辑命令使用增强的编辑命令

( 一行中长字串会自动滚卷 ).

<Ctrl-A> 光标移动到命令行的开始位置 .

<Ctrl-E> 光标移动到命令行的结束位置 .

<Esc-B> 回移一个单词

Router>$ value for customers, employees, and partners.

Page 39: 第6讲 操作与配置Cisco Ios

www.cisco.com

使用增强的编辑命令使用增强的编辑命令

( 一行中长字串会自动滚卷 ).

<Ctrl-A> 光标移动到命令行的开始位置 .

<Ctrl-E> 光标移动到命令行的结束位置 .

<Esc-B> 回移一个单词 .

<Ctrl-F> 下移一个字符 .

Router>$ value for customers, employees, and partners.

Page 40: 第6讲 操作与配置Cisco Ios

www.cisco.com

使用增强的编辑命令使用增强的编辑命令

( 一行中长字串会自动滚卷 ).

<Ctrl-A> 光标移动到命令行的开始位置 .

<Ctrl-E> 光标移动到命令行的结束位置 .

<Esc-B> 回移一个单词

<Ctrl-F> 下移一个字符 .

<Ctrl-B> 回移一个字符 .

Router>$ value for customers, employees, and partners.

Page 41: 第6讲 操作与配置Cisco Ios

www.cisco.com

使用增强的编辑命令使用增强的编辑命令

( 一行中长字串会自动滚卷 ).

<Ctrl-A> 光标移动到命令行的开始位置 .

<Ctrl-E> 光标移动到命令行的结束位置 .

<Esc-B> 回移一个单词

<Ctrl-F> 下移一个字符 .

<Ctrl-B> 回移一个字符 .

<Esc-F> 下移一个单词

Router>$ value for customers, employees, and partners.

Page 42: 第6讲 操作与配置Cisco Ios

www.cisco.com

( 一行中长字串会自动滚卷 ).

<Ctrl-A> 光标移动到命令行的开始位置 .

<Ctrl-E> 光标移动到命令行的结束位置 .

<Esc-B> 回移一个单词

<Ctrl-F> 下移一个字符 .

<Ctrl-B> 回移一个字符 .

<Esc-F> 下移一个单词

使用增强的编辑命令使用增强的编辑命令

<Ctrl-D> 删除当前字符

Router>$ value for customers, employees, and partners.

Page 43: 第6讲 操作与配置Cisco Ios

www.cisco.com

Ctrl-P or Up arrow 调出最近 ( 前一 )使用过的命令

Ctrl-N or Down arrow 调出更近使用过的命令

Router> show history 显示命令保存区内容

Router> terminal history size lines 设置命令保存区大小

回览之前用过的命令回览之前用过的命令

Page 44: 第6讲 操作与配置Cisco Ios

www.cisco.com

show version 命令show version 命令

wg_ro_a#show versionCisco Internetwork Operating System Software IOS (tm) 2500 Software (C2500-JS-L), Version 12.0(3), RELEASE SOFTWARE (fc1)Copyright (c) 1986-1999 by cisco Systems, Inc.Compiled Mon 08-Feb-99 18:18 by phanguyeImage text-base: 0x03050C84, data-base: 0x00001000

ROM: System Bootstrap, Version 11.0(10c), SOFTWAREBOOTFLASH: 3000 Bootstrap Software (IGS-BOOT-R), Version 11.0(10c), RELEASE SOFTWARE(fc1)

wg_ro_a uptime is 20 minutesSystem restarted by reloadSystem image file is "flash:c2500-js-l_120-3.bin"(output omitted)--More--

Configuration register is 0x2102

Page 45: 第6讲 操作与配置Cisco Ios

www.cisco.com

查看配置情况查看配置情况

控制台

IOS

Setup utility

showstartup-config

showrunning-config

将配置参数保存到 NVRAM 中

ConfigConfig

RAM NVRAM

Page 46: 第6讲 操作与配置Cisco Ios

www.cisco.com

show running 和 show startup 命令

show running 和 show startup 命令

wg_ro_c#show startup-configUsing 1359 out of 32762 bytes!version 12.0!

-- More --

wg_ro_c#show running-configBuilding configuration...

Current configuration:!version 12.0!

-- More --

保存在 NVRAM 中保存在 RAM 中

显示当前运行的和保存的配置情况

Page 47: 第6讲 操作与配置Cisco Ios

www.cisco.com

路由器模式一览路由器模式一览

Router(config)#

Router>enable

Router#config term

Exit

Ctrl-Z (end)用户模式

特权模式

全局配置模式

配置模式 模式提示

Interface Router(config-if)#Subinterface Router(config-subif)#Controller Router(config-controller)#Line Router(config-line)#Router Router(config-router)#

Page 48: 第6讲 操作与配置Cisco Ios

www.cisco.com

保存配置保存配置

wg_ro_c#wg_ro_c#copy running-config startup-configDestination filename [startup-config]?Building configuration…

wg_ro_c#

wg_ro_c#wg_ro_c#copy running-config startup-configDestination filename [startup-config]?Building configuration…

wg_ro_c#

将当前运行的配置复制到 NVRAM 中

Page 49: 第6讲 操作与配置Cisco Ios

www.cisco.com

配置路由器的各种标识配置路由器的各种标识

为路由器或其端口设置标识或信息

路由器名Router(config)#hostname wg_ro_cwg_ro_c(config)#

开机时的固定显示信息wg_ro_c(config)#banner motd #

Accounting Department You have entered a secured system. Authorized access only! #

端口描述wg_ro_c(config)#interface ethernet 0wg_ro_c(config-if)#description Engineering LAN, Bldg. 18

Page 50: 第6讲 操作与配置Cisco Ios

www.cisco.com

Router(config)#line console 0Router(config-line)#loginRouter(config-line)#password cisco

控制台密码

虚拟终端密码Router(config)#line vty 0 4Router(config-line)#login Router(config-line)#password sanjose

路由器密码配置路由器密码配置

Page 51: 第6讲 操作与配置Cisco Ios

www.cisco.com

Router(config)#line console 0Router(config-line)#loginRouter(config-line)#password cisco

控制台密码

虚拟终端密码Router(config)#line vty 0 4Router(config-line)#login Router(config-line)#password sanjose

特权模式明文密码Router(config)#enable password cisco

特权模式加密密码Router(config)#enable secret sanfran

路由器密码配置路由器密码配置

Page 52: 第6讲 操作与配置Cisco Ios

www.cisco.com

其它控制台命令其它控制台命令

Router(config)#line console 0Router(config-line)#exec-timeout 0 0

Router(config)#line console 0Router(config-line)#logging synchronous

• 禁止控制台会话自动退出

• 重显被打乱的控制台输入

Page 53: 第6讲 操作与配置Cisco Ios

www.cisco.com

Router(config)#interface type numberRouter(config-if)#

端口配置端口配置

• type 包括 serial, ethernet, token ring, fddi, loopback, dialer, null, async, atm, bri, and tunnel

• number 用来识别具体的单个端口

Router(config-if)#exit

• 从当前端口配置模式退出

Router(config)#interface type slot/portRouter(config-if)#

• 模块化端口的表示法

Page 54: 第6讲 操作与配置Cisco Ios

www.cisco.com

配置串口配置串口

进入全局配置模式

Router(config)#interface serial 0 Router(config-if)#

Router#configure termRouter(config)#

指定某个端口

Page 55: 第6讲 操作与配置Cisco Ios

www.cisco.com

配置串口配置串口

进入全局配置模式

Router(config-if)#clock rate 64000Router(config-if)#

Router(config)#interface serial 0 Router(config-if)#

Router#configure termRouter(config)#

指定某个端口

设置时钟频率 ( 只在 DCE 端 )

设置带宽 Router(config-if)#bandwidth 64Router(config-if)#exit

Page 56: 第6讲 操作与配置Cisco Ios

www.cisco.com

Router#show interface serial 0Serial0 is up, line protocol is up Hardware is HD64570 Internet address is 10.140.4.2/24 MTU 1500 bytes, BW 64 Kbit, DLY 20000 usec, rely 255/255, load 1/255 Encapsulation HDLC, loopback not set, keepalive set (10 sec) Last input 00:00:09, output 00:00:04, output hang never Last clearing of "show interface" counters never 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(output omitted)

确认参数修改情况确认参数修改情况

Page 57: 第6讲 操作与配置Cisco Ios

www.cisco.com

开启或关闭端口开启或关闭端口

Router#configure termRouter(config)#interface serial 0 Router(config-if)#no shutdown%LINK-3-UPDOWN: Interface Seria0, changed state to up%LINEPROTO-5-UPDOWN: Line Protocol on Interface Serial0, changed state to up

开启已经关闭的端口

Router#configure termRouter(config)#interface serial 0 Router(config-if)#shutdown%LINK-5-CHANGED: Interface Serial0, changed state to administratively down %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down

人工关闭端口

Page 58: 第6讲 操作与配置Cisco Ios

www.cisco.com

路由器的 show interfaces 命令路由器的 show interfaces 命令Router#show interfacesEthernet0 is up, line protocol is up Hardware is Lance, address is 00e0.1e5d.ae2f (bia 00e0.1e5d.ae2f) Internet address is 10.1.1.11/24 MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec, rely 255/255, load 1/255 Encapsulation ARPA, loopback not set, keepalive set (10 sec) ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:07, output 00:00:08, output hang never Last clearing of "show interface" counters never Queueing strategy: fifo Output queue 0/40, 0 drops; input queue 0/75, 0 drops 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 81833 packets input, 27556491 bytes, 0 no buffer Received 42308 broadcasts, 0 runts, 0 giants, 0 throttles 1 input errors, 0 CRC, 0 frame, 0 overrun, 1 ignored, 0 abort 0 input packets with dribble condition detected 55794 packets output, 3929696 bytes, 0 underruns 0 output errors, 0 collisions, 1 interface resets 0 babbles, 0 late collision, 4 deferred 0 lost carrier, 0 no carrier 0 output buffer failures, 0 output buffers swapped out

Page 59: 第6讲 操作与配置Cisco Ios

www.cisco.com

Router#show interfaces serial 1

Serial1 is up, line protocol is up

Hardware is HD64570 Description: 64Kb Line to San Jose :: :: :: :: :: :: :: :: ::

Operational..................Connection problem...Interface problem........Disabled ......................

Serial1 is up, line protocol is upSerial1 is up, line protocol is downSerial1 is down, line protocol is downSerial1 is administratively down, line protocol is down

存活信息载波监测

解读端口状态解读端口状态

Page 60: 第6讲 操作与配置Cisco Ios

www.cisco.com

串口上用 show controller 命令串口上用 show controller 命令

Router#show controller serial 0HD unit 0, idb = 0x121C04, driver structure at 0x127078buffer size 1524 HD unit 0, V.35 DTE cable

.

.

.

Router#show controller serial 0HD unit 0, idb = 0x121C04, driver structure at 0x127078buffer size 1524 HD unit 0, V.35 DTE cable

.

.

.

显示串口线的线缆类型

Page 61: 第6讲 操作与配置Cisco Ios

www.cisco.com

通过本章的学习,您应该掌握以下内容 :• 开启交换机和路由器并观察其启动过程• 注意交换机的出厂初始配置情况,完成路由器的初始

参数配置• 在网络设备上进入并辨识不同的命令模式• 在不同的用户界面下应用各种帮助和命令行编辑功能• 查看并确认并于各网络设备的基本信息

本章总结本章总结

Page 62: 第6讲 操作与配置Cisco Ios

www.cisco.com

问题回顾问题回顾

1. 交换机开机自检时出现什么现象 ? 2. 路由器在什么情况下和怎样用到 Setup 配置模式?3. 运行 Cisco IOS 软件的设备在特权模式下提示符是怎样的 ?4. 掌握在交换机和路由器上的 Cisco IOS 软件的所能提供的帮助机制内容 .