使用Cisco IOS CLI配置基本软件
Table Of Contents
目录
Basic Software Configuration Using the Cisco IOS Command-Line Interface
使用Cisco IOS CLI配置基本软件
Contents
内容
Platforms Supported by This Document
文档支持的平台
Prerequisites for Basic Software Configuration Using the Cisco IOS CLI
使用Cisco IOS CLI基本软件配置的首要条件
Restrictions for Basic Software Configuration Using the Cisco IOS CLI
使用Cisco IOS CLI基本软件配置的限制
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
怎么使用Cisco IOS CLI完成一个基本软件配置
Configuring the Router Hostname
设置主机名
Configuring the Enable and Enable Secret Passwords
设置enable与enable secret密码
Configuring the Console Idle Privileged EXEC Timeout
设置控制台实行特权置闲的超时时间
Configuring Fast Ethernet and Gigabit Ethernet Interfaces
设置快速以太网接口与千兆以太网接口
Specifying a Default Route or Gateway of Last Resort
指定一个默认路由或网关的方法(??)
Configuring Virtual Terminal Lines for Remote Console Access
为远程控制访问设置虚拟终端线路
Configuring the Auxiliary Line
配置aux
Verifying Network Connectivity
检验网络连通性
Saving Your Router Configuration
保存路由器配置
Saving Backup Copies of Your Configuration and System Image
保存备份你的配置与系统镜像
Related Documents—Basic Software Configuration
相关文档—基本软件配置
Related Documents—Additional Configuration
相关文档—其他配置
Basic Software Configuration Using the Cisco IOS Command-Line Interface
This document describes how to use the Cisco IOS command-line interface (CLI) to perform a basic software configuration for your router.
这个文档描述怎么在你的路由器使用Cisco IOS CLI去完成基本软件配置。
• Platforms Supported by This Document
文档支持的平台
•
使用Cisco IOS CLI基本软件配置的首要条件
•
使用Cisco IOS CLI基本软件配置的限制
•
怎么使用Cisco IOS CLI完成一个基本软件配置
接下来
•
另附参考
Platforms Supported by This Document
文档支持的平台
Use this document with the following platforms:
下列的平台支持使用本文档
•
•Cisco 1800系列路由器
•
•Cisco 2800 系列路由器
•
•Cisco 3800 系列路由器
Prerequisites for Basic Software Configuration Using the Cisco IOS CLI
使用Cisco IOS CLI基本软件配置的首要条件
Follow the instructions in the quick start guide that shipped with your router to install the chassis, connect cables, and power up the router.
依照快速向导的指示来进行路由器的安装、电缆连接和打开电源
Timesaver
在打开路由器电源前,断开所有WAN电缆抑制它设法运行自动安装程序。当在两端都连接到WAN 并且路由器的NVRAM中没有存储有效的配置文件时,路由器可能试图运行自动安装 (例如在添加新的接口的时候)。路由器需要几分钟来发现自动安装程序没有连接到一个远程的TCP/IP主机。
Restrictions for Basic Software Configuration Using the Cisco IOS CLI
使用Cisco IOS CLI基本软件配置的限制
If Cisco Router and Security Device Manager (SDM) is installed on your router, we recommend that you use Cisco SDM instead of the Cisco IOS CLI to perform the initial software configuration. To access SDM, see the quick start guide that shipped with your router.
如果路由器上安装了Cisco Router和SDM,我们推荐你使用Cisco SDM代替Cisco IOS CLI去完成初始化软件配置。如何访问SDM请看装在路由器上的快速开始指导。
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
如何使用Cisco IOS CLI完成一个基本软件配置
This section contains the following procedures:
这部分包含以下的步骤
•
• 设置路由器主机名(可选)
•
• 设置enable和enable Secret密码(必须)
•
• 设置控制台特权实行超时(可选)
•
• 设置快速以太网接口与吉比特以太网接口(必须)
•
•指定最近请求的默认路由和网关(必须)
•
• 为远程控制访问设置虚拟终端线路(必须)
•
• 设置Aux线路(可选)
•
• 检查网络连接(必须)
•
• 保存路由器配置(必须)
•
•保存备份你的配置与系统镜像(可选)
Configuring the Router Hostname
设置路由器主机名
The hostname is used in CLI prompts and default configuration filenames. If you do not configure the router hostname, the router uses the factory-assigned default hostname "Router."
在CLI提示符和默认配置文件名中使用主机名。如果你不配置路由器主机名,路由器使用出厂设置的默认主机名”Router”。
Do not expect capitalization and lowercasing to be preserved in the hostname. Uppercase and lowercase characters are treated as identical by many Internet software applications. It may seem appropriate to capitalize a name as you would ordinarily do, but conventions dictate that computer names appear in all lowercase characters. For more information, see RFC 1178, Choosing a Name for Your Computer.
在主机名中不会保留大小写。在许多网络应用软件中,是不区分大小写的。使用大写字母拼写名字,就像你平时所做的,似乎比较合适,但是习惯上计算机名都采用小写字母拼写。更多的信息请参看RFC 1178,,Choosing a Name for Your Computer。
The name must also follow the rules for Advanced Research Projects Agency Network (ARPANET) hostnames. They must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphens. Names must be 63 characters or fewer. For more information, see RFC 1035, Domain Names—Implementation and Specification.
所起的名字也必须遵循ARPANET规则。必须以字母开始,以字母或数字结束,中间的字符只包含字母,数字和连接符。名字不得超过63个字符。更多信息请参看RFC 1035,Domain Names—Implementation and Specification。
4.
5.
详细步骤
What to Do Next
下一步
Proceed to the "Configuring the Enable and Enable Secret Passwords" section.
进入“配置Enable和Enable Secret 密码”部分。
Configuring the Enable and Enable Secret Passwords
设置Enable和Enable Secret密码
To provide an additional layer of security, particularly for passwords that cross the network or are stored on a TFTP server, you can use either the enable password command or enable secret command. Both commands accomplish the same thing—they allow you to establish an encrypted password that users must enter to access privileged EXEC (enable) mode.
为了产生一个附加的安全层,尤其是跨网络的或者是存储在TFTP服务器上的密码,你可以使用enable password 命令或者enable secret命令。两个命令都实现了一个功能——允许设定加密密码,用户必须输入这个密码才能访问特权允许模式。
We recommend that you use the enable secret command because it uses an improved encryption algorithm. Use the enable password command only if you boot an older image of the Cisco IOS software or if you boot older boot ROMs that do not recognize the enable secret command.
我们建议你使用enable secret命令,因为它使用了改进的密码编码规则。只有在你启动一个旧的Cisco IOS软件镜像或者启动一个无法识别enable secret命令的旧的启动ROM时才使用enable password。
For more information, see the "Configuring Passwords and Privileges" chapter in the Cisco IOS Security Configuration Guide. Also see the Cisco IOS Password Encryption Facts tech note and the Improving Security on Cisco Routers tech note.
更多的信息参看Cisco IOS Security Configuration Guide中"Configuring Passwords and Privileges"一章。同时可参看Cisco IOS Password Encryption Facts 技术笔记和Improving Security on Cisco Routers技术笔记。
If you configure the enable secret command, it takes precedence over the enable password command; the two commands cannot be in effect simultaneously.
如果你配置了enable secret命令,它比enable password命令有更高的优先权;这两个命令不能同时生效。
|
(Optional) Sets a local password to control access to various privilege levels. • | ||
|
Specifies an additional layer of security over the enable password command. • | ||
|
Enables privileged EXEC mode. • | ||
Troubleshooting Tips
故障检测技巧
If you forget the password that you configured, or if you cannot access privileged EXEC (enable) mode, see the Password Recovery Procedures for your router, available at http://www.cisco.com/warp/public/474.
如果你忘记了密码,或者无法进入特权模式,参考路由器上的Password Recovery Procedures ,可以在http://www.cisco.com/warp/public/474找到。
What to Do Next
下一步
If you want to set the console interface privileged EXEC timeout to a value other than 10 minutes (the default), proceed to the "Configuring the Console Idle Privileged EXEC Timeout" section.
如果想设置控制台接口的特权允许的超时时间值大于10分钟(默认),进入"Configuring the Console Idle Privileged EXEC Timeout"一节。
If you do not wish to change the privildged EXEC timeout, proceed to the "Specifying a Default Route or Gateway of Last Resort" section.
如果你不想改变控制台接口的特权允许的超时时间,进入"Specifying a Default Route or Gateway of Last Resort"一节。
Configuring the Console Idle Privileged EXEC Timeout
设置控制台实行特权置闲的超时时间
This section describes how to configure the console line's idle privileged EXEC timeout. By default, the privileged EXEC command interpreter waits 10 minutes to detect user input before timing out.
本节描述了如何配制控制台队列实行特权置闲的超时时间。在默认状态下,特权实行命令解释程序在超时之前等待十分钟来发现用户的输入。
When you configure the console line, you can also set communication parameters, specify autobaud connections, and configure terminal operating parameters for the terminal that you are using. For more information on configuring the console line, see the Cisco IOS Configuration Fundamentals and Network Management Configuration Guide. In particular, see the "Configuring Operating Characteristics for Terminals" and "Troubleshooting and Fault Management" chapters.
当你配置了控制台队列,你也可以设置通讯参数,指定自动的连接,为所使用的终端配置终端操作参数。配置控制台队列的更多信息,请参看Cisco IOS Configuration Fundamentals and Network Management Configuration Guide。详细说明请看"Configuring Operating Characteristics for Terminals"章和 "Troubleshooting and Fault Management"章。
SUMMARY STEPS
摘要步骤
4.
DETAILED STEPS
详细步骤
Examples
例如:
The following example shows how to set the console idle privileged EXEC timeout to 2 minutes 30 seconds:
下面的例子演示了如何将控制台实行特权置闲的超时时间设置为2分30秒:
The following example shows how to set the console idle privileged EXEC timeout to 10 seconds:
下面的例子演示了如何将控制台实行特权置闲的超时时间设置为10秒:
What to Do Next
下一步
Proceed to the "Configuring Fast Ethernet and Gigabit Ethernet Interfaces" section.
进入"Configuring Fast Ethernet and Gigabit Ethernet Interfaces"部分
Configuring Fast Ethernet and Gigabit Ethernet Interfaces
配置快速以太网和千兆以太网接口
This section shows how to assign an IP address and interface description to an Ethernet interface on your router.
本节演示了如何分配一个IP地址和路由器以太网接口的接口描述。
For comprehensive configuration information on Fast Ethernet and Gigabit Ethernet interfaces, see the "Configuring LAN Interfaces" chapter of the Cisco IOS Interface and Hardware Component Configuration Guide.
关于快速以太网和千兆以太网接口全面配置的信息,请参看Cisco IOS Interface and Hardware Component Configuration Guide 的"Configuring LAN Interfaces"章节。
For information on interface numbering, see the quick start guide that shipped with your router.
有关接口的编号,请看路由器的快速开始向导。
大致步骤
4.
详细步骤
Examples
例如
Configuring the Fast Ethernet Interface: Example
配置快速以太网接口
description FE int to HR group
ip address 172.16.3.3 255.255.255.0
Sample Output for the show ip interface brief Command
显示IP接口摘要命令的输出范例
Router# show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 172.16.3.3 YES NVRAM up up
FastEthernet0/1 unassigned YES NVRAM administratively down down
What to Do Next
下一步
Proceed to the "Specifying a Default Route or Gateway of Last Resort" section.
进入”Specifying a Default Route or Gateway of Last Resort" 一节
Specifying a
指定最近请求的默认路由和网关
This section describes how to specify a default route with IP routing enabled. For alternative methods of specifying a default route, see the Configuring a Gateway of Last Resort Using IP Commands tech note.
The Cisco IOS software uses the gateway (router) of last resort if it does not have a better route for a packet and if the destination is not a connected network. This section describes how to select a network as a default route (a candidate route for computing the gateway of last resort). The way in which routing protocols propagate the default route information varies for each protocol.
本节描述了如何指定 IP路由的默认路由。指定默认路由的可选择的方法,参看Configuring a Gateway of Last Resort Using IP Commands技术笔记。在数据包没有更好的路由,以及目的地是不可到达的网络的情况下Cisco IOS软件使用最近请求的网关。本节描述了如何选择一个网络作为默认路由(处理最近请求网关的侯选路由)。路由协议传播默认路由信息的方式对于每个协议是不同的。
For comprehensive configuration information about IP routing and IP routing protocols, see the Cisco IOS IP Configuration Guide. In particular, see the "Configuring IP Addressing" chapter and all "Part 2: IP Routing Protocols" chapters.
IP路由和IP路由协议的全面配置信息,参看Cisco IOS IP Configuration Guide,"Configuring IP Addressing" 章,和所有 "Part 2: IP Routing Protocols" 章。
大致步骤
4.
5.
or
ip route dest-prefix mask next-hop-ip-address
详细配置
Examples
例如
Specifying a
指定默认路由。例如
ip route 192.168.24.0 255.255.255.0 172.28.99.2
ip default-network 192.168.24.0
Sample Output for the show ip route Command
显示IP路由命令的输出
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
Gateway of last resort is 172.28.99.2 to network 192.168.24.0
172.24.0.0 255.255.255.0 is subnetted, 1 subnets
C 172.24.192.0 is directly connected, FastEthernet0
S 172.24.0.0 255.255.0.0 [1/0] via 172.28.99.0
S* 192.168.24.0 [1/0] via 172.28.99.2
172.16.0.0 255.255.255.0 is subnetted, 1 subnets
C 172.16.99.0 is directly connected, FastEthernet1
What to Do Next
下一步
Proceed to the "Configuring Virtual Terminal Lines for Remote Console Access" section.
进入"Configuring Virtual Terminal Lines for Remote Console Access"节
Configuring Virtual Terminal Lines for Remote Console Access
为远程控制访问设置虚拟终端线路
Virtual terminal (vty) lines are used to allow remote access to the router. This section shows you how to configure the virtual terminal lines with a password, so that only authorized users can remotely access the router.
虚拟终端线路用于对路由器的远程访问。本节演示了如何使用密码对虚拟终端线路进行配置,所以只有授权用户可以远程访问路由器。
The router has five virtual terminal lines by default. However, you can create additional virtual terminal lines as described in the chapter "Configuring Protocol Translation and Virtual Asynchronous Devices" in the Cisco IOS Terminal Services Configuration Guide .
路由器默认有五个的虚拟终端线路。但是你可以按照Cisco IOS 终端服务配置向导中Configuring Protocol Translation and Virtual Asynchronous Devices一章所描述的,创建另外的虚拟终端线路。
For more information on line passwords and password encryption, see the "Configuring Passwords and Privileges" chapter in the Cisco IOS Security Configuration Guide . Also see the Cisco IOS Password Encryption Facts tech note.
更多有关线路密码和密码编码的信息参看Cisco IOS Security Configuration Guide中Configuring Passwords and Privileges一章。也可参看Cisco IOS Password Encryption Facts技术笔记。
If you want to secure the vty lines with an access list, see "Part 3: Traffic Filtering and Firewalls" in the Cisco IOS Security Configuration Guide.
如果想用访问列表(??)来保护vty线路,参看Cisco IOS Security Configuration Guide.中的"Part 3: Traffic Filtering and Firewalls"部分。
SUMMARY STEPS
大致步骤
3.
8.
详细步骤
Examples
例如
The following example shows how to configure virtual terminal lines with a password:
下例演示了如何使用密码配置虚拟终端线路
What to Do Next
下一步
After you configure the vty lines, follow these steps:
当你配置了vty线路后,按如下步骤:
•
(可选)如何将虚拟终端线路密码加密,参看Cisco IOS Security Configuration Guide中"Configuring Passwords and Privileges"一章。也可参看Cisco IOS Password Encryption Facts技术笔记。
•
(可选)如何使用访问列表(??)来保护VTY线路,参看Cisco IOS Security Configuration Guide.的"Part 3: Traffic Filtering and Firewalls"部分。
•
继续路由器的基本软件配置,进入"Configuring the Auxiliary Line" 部分。
Configuring the Auxiliary Line
配置Aux线路
This section describes how to enter line configuration mode for the auxiliary line. How you configure the auxiliary line depends on your particular implementation of the auxiliary (AUX) port. See the following documents for information on configuring the auxiliary line:
本节描述了如何进入线路配置模式来配置AUX线路。如何配置AUX线路取决于AUX端口的特殊执行(??)。有关AUX线路配置的信息请看下面的文档。
Configuring a Modem on the AUX Port for EXEC Dialin Connectivity, tech note
Configuring a Modem on the AUX Port for EXEC Dialin Connectivity,技术笔记
http://www.cisco.com/warp/public/471/mod-aux-exec.html
Configuring Dialout Using a Modem on the AUX Port, sample configuration
Configuring Dialout Using a Modem on the AUX Port配置范例
http://www.cisco.com/warp/public/471/mod-aux-dialout.html
Connecting a SLIP/PPP Device to a Router's AUX Port, tech note
Connecting a SLIP/PPP Device to a Router's AUX Port,技术笔记
http://www.cisco.com/warp/public/701/6.html
Configuring AUX-to-AUX Port Async Backup with Dialer Watch, sample configuration
Configuring AUX-to-AUX Port Async Backup with Dialer Watch,配置范例
http://www.cisco.com/warp/public/471/aux-aux-watch.html
Modem-Router Connection Guide, tech note
Modem-Router Connection Guide,技术笔记
http://www.cisco.com/warp/public/76/9.html
SUMMARY STEPS
大致步骤
4.
详细配置
What to Do Next
下一步
Proceed to the "Verifying Network Connectivity" section.
进入 "Verifying Network Connectivity"节
Verifying Network Connectivity
验证网络连通性
This section describes how to verify network connectivity for your router.
本节描述了如何为路由器验证网络的连通性
先决条件
•
完成了本文档前面提及的所有配置任务
•
路由器必须连接到一个配置正确的网络主机上
大致步骤
2.
3.
详细配置
Examples
例如
The following display shows sample output for the ping command when you ping the IP address 192.168.7.27:
下面显示了当你ping IP地址192.168.7.27时ping命令的输出结果
Target IP address: 192.168.7.27
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.7.27, timeout is 2 seconds:
Success rate is 100 percent, round-trip min/avg/max =
The following display shows sample output for the ping command when you ping the IP hostname donald:
下面显示了当你ping IP主机名为donald 时ping命令的输出结果
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.7.27, timeout is 2 seconds:
Success rate is 100 percent, round-trip min/avg/max =
What to Do Next
下一步
Proceed to the "Saving Your Router Configuration" section.
进入”Saving Your Router Configuration"一节
Saving Your Router Configuration
保存路由器配置
This section describes how to avoid losing your configuration at the next system reload or power cycle by saving the running configuration to the startup configuration in NVRAM.
本节描述了如何通过保存运行的配置到NVRAM中的启动配置来避免在下次加载系统或者加电时丢失配置(信息)。
大致步骤
2.
详细步骤
|
进入特权模式 • 输入密码 | ||
|
Saves the running configuration to the startup configuration. 将运行的配置保存到启动配置。 |
What to Do Next
下一步
Proceed to the "Saving Backup Copies of Your Configuration and System Image" section.
进入”Saving Backup Copies of Your Configuration and System Image"一节
Saving Backup Copies of Your Configuration and System Image
保存配置备份和系统镜像
To aid file recovery and minimize downtime in case of file corruption, we recommend that you save backup copies of the startup configuration file and the Cisco IOS software system image file on a server.
为了在文件损坏时帮助文件恢复和减少停工时间,我们建议你在一个服务器上保存启动配置文件的备份和Cisco IOS软件系统镜像文件。
For more detailed information, see the "Managing Configuration Files" chapter and the "Loading and Maintaining System Images" chapter of the Cisco IOS Configuration Fundamentals and Network Management Configuration Guide.
更多细节信息,参看Cisco IOS Configuration Fundamentals and Network Management Configuration Guide.的"Managing Configuration Files" 一章和 "Loading and Maintaining System Images" 一章。
SUMMARY STEPS
大致步骤
2.
4.
DETAILED STEPS
详细步骤
Examples
例如
Copying the Startup Configuration to a TFTP Server: Example
将启动配置文件拷贝到TFTP服务器:例如
The following example shows the startup configuration being copied to a TFTP server:
下面的例子显示了将启动配置拷贝到TFTP服务器
Router# copy nvram:startup-config tftp:
Name of configuration file to write [rtr2-confg]? <cr>
Write file rtr2-confg on host 172.16.101.101?[confirm] <cr>
Copying from Flash Memory to a TFTP Server: Example
从闪存拷贝到TFTP服务器:例如
The following example shows the use of the show flash: command in privileged EXEC to learn the name of the system image file and the use of the copy flash: tftp: privileged EXEC command to copy the system image (c3640-2is-mz) to a TFTP server. The router uses the default username and password.
下面的例子显示了show flash的使用:学习(??)系统镜像文件名字的特权命令和copy flash的使用:将系统镜像(c3640-2is-mz)拷贝到TFTP服务器的特权命令。路由器使用默认的用户名和密码。
[4137952 bytes used, 12639264 available, 16777216 total]
16384K bytes of processor board System flash (Read/Write)\
IP address of remote host [255.255.255.255]? 172.16.13.110
filename to write on tftp host? c3600-c2is-mz
Where to Go Next
下一步
•
当你完成了基本软件配置,考虑使用路由协议或访问列表以及提高安全性的其他方法来保护你的路由器。参看”Related Documents—Additional Configuration" 一节。
•
参看 Finding Feature Documentation来在路由器上配置特征(??)
Additional References
附加参考
The following sections provide references related to basic software configuration using the Cisco IOS CLI.
下面一节通过Cisco IOS CLI提供了和基本软件配置相关的参考
Related Documents—Basic Software Configuration
相关文档——基本软件配置
|
Chassis installation, cable connections, power-up procedures, and interface numbering 安装,连线,启动过程和接口编码 |
Quick start guide for your router 路由器的快速启动向导 |
|
Guidelines for assigning the router hostname 分配主机名的原则 |
|
|
Access lists, passwords, and privileges 访问列表,密码和特权 |
|
|
Passwords and password encryption 密码和编码 |
Cisco IOS Password Encryption Facts tech note |
|
Password recovery procedures for Cisco products Cisco产品的密码恢复程序 |
|
|
Configuring the console line, managing configuration files, and loading and maintaining system images 配置控制台队列(??),管理配置队列和和装载维护系统镜像 |
Cisco IOS Configuration Fundamentals and Network Management Configuration Guide |
|
配置接口 |
Cisco IOS Interface and Hardware Component Configuration Guide |
|
IP routing and IP routing protocols IP路由和IP路由协议 |
|
|
Configuring default routes or a gateway of last resort 配置默认路由或者一个最近请求网关 |
Configuring a Gateway of Last Resort Using IP Commands tech note |
|
Configuring virtual terminal lines 配置虚拟终端线路 |
|
|
Configuring the auxiliary (AUX) port 配置AUX端口 |
Configuring a Modem on the AUX Port for EXEC Dialin Connectivity , tech note Configuring Dialout Using a Modem on the AUX Port , sample configuration Connecting a SLIP/PPP Device to a Router's AUX Port , tech note Configuring AUX-to-AUX Port Async Backup with Dialer Watch , sample configuration Modem-Router Connection Guide , tech note |
Related Documents—Additional Configuration
相关文档——附加配置
|
Cisco configuration settings that network administrators should consider changing on their routers, especially on their border routers, to improve security Cisco有关网络管理员应该考虑在路由器,尤其是边界路由器的交换以增加安全性的配置 |
Improving Security on Cisco Routers tech note Note 注意:必须有Cisco.com的帐户才能看到这篇文档。如果你没有或者忘记了用户名或密码,点击对话框的Cancle,按照指示命令继续。 |
|
IP routing and IP routing protocols IP路由和IP路由协议 |
|
|
访问列表 |
技术支持
Copyright © 2004 Cisco Systems, Inc. All rights reserved.
浙公网安备 33010602011771号