本节说明如何使用设置命令工具配置路由器的主机名、设置密码以及如何配置接口以便与管理网络通信。如果在启动序列的结尾出现下列信息,则已自动调用设置命令工具:
--- system configuration dialog ---
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 '[]'.
would you like to enter the initial configuration dialog?[yes/no]:
设置命令工具提示您输入与路由器和网络相关的基本信息,并创建初始配置文件。创建配置文件后,您可使用cli 或cisco 路由器和安全设备管理器(sdm) 执行其它配置。
设置命令工具的具体提示内容视路由器型号、已安装的接口模块和软件映像的情况而定。下列示例和用户项(以粗体显示)仅作为示例显示。
有关接口和端口编号方面的帮助信息,请参阅的“端口编号”一节。
如果使用设置命令工具时出错,可以先退出,然后再次运行设置命令工具。请按ctrl-c,然后在授权exec 模式提示符(router#) 下键入setup 命令。
步骤1 要继续使用安装命令工具,请在启动信息结束后输入yes。
would you like to enter the initial configuration dialog?[yes/no]:yes
步骤2 当下列信息出现时,请按return 进入基本管理设置:
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]:yes
步骤3 输入路由器的主机名(本示例使用router):
configuring global parameters:
enter host name [router]:router
步骤4 输入特权加密密码。该密码是加密的(更安全)并且查看配置时不能看到它。
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:xxxxxx
步骤5 输入不同于特权加密密码的特权密码。该密码未加密(不十分安全)并且查看配置时能看到它。
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:xxxxxx
步骤6 输入虚拟终端密码,此密码防止通过控制台端口以外的端口进行未授权的访问:
the virtual terminal password is used to protect access to the router over a network interface.
enter virtual terminal password:xxxxxx
步骤7 根据网络的具体情况对下列提示给出合适的响应:
configure snmp network management?[yes]:
community string [public]:
显示可用接口的汇总:
显示的接口编号视cisco 模块化路由器平台的类型和已安装的接口模块及接口卡而定。
current interface summary
controller timeslots d-channel configurable modes status

any interface listed with ok? value "no" does not have a valid configuration

步骤8 选择一个可用接口,以将路由器连接到管理网络:
enter interface name used to connect to the management network from the above interface summary:gigabitethernet0/0
步骤9 根据网络的具体情况对下列提示给出合适的响应:
configuring interface gigabitethernet0/0:
use the 100 base-tx (rj-45) connector?[yes]:yes
operate in full-duplex mode?[no]:no
configure ip on this interface?[yes]:yes
ip address for this interface: 172.1.2.3
subnet mask for this interface [255.255.0.0] : 255.255.0.0
class b network is 172.1.0.0, 16 subnet bits; mask is /16
步骤10 显示配置:
the following configuration command script was created:
hostname router
enable secret 5 $1$d5p6$pyx41/lqiask.hcsbfo5q1
enable password xxxxxx
line vty 0 4
password xxxxxx
snmp-server community public!
no ip routing!
interface gigabitethernet0/0
no shutdown
media-type 100basex
half-duplex
ip address 172.1.2.3 255.255.0.0!
interface gigabitethernet0/1
shutdown
no ip address!
end
步骤11 对下列提示给出响应。请选择[2] 保存初始配置:
[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]: 2
building configuration...
use the enabled mode 'configure' command to modify this configuration.
press return to get started!return
出现用户提示:router]
步骤12 验证初始配置。有关验证步骤,请参阅“验证初始配置”一节。