交换机的初始配置

初始配置选项

完成硬件安装后,您需要为交换机设置所需的配置,以使网络能有流量通过。在使用新设备的第一天,您可以执行多个任务以确保设备在线、可访问,并可轻松配置。

当管理引擎模块出货时,MANUAL_BOOT 的出厂默认设置为“否”。这意味着,当您第一次为设备通电时,它总是会自动启动。因此,对于初始配置,以下是最先可以使用的选项:

  • 使用网络用户界面配置交换机

  • 使用 CLI 配置交换机

  • 在 ROMMON 模式下配置交换机

    该选项需要您中断自动启动(出厂默认值)并输入 ROMMON 提示符以输入所需设置。如果您想使用位于 TFTP 服务器上的映像来启动系统,请使用此选项。

使用网络用户界面配置交换机

有关使用 WebUI 设置交换机的详细说明,请参阅所需版本的软件配置指南。在该指南中,转到“使用网络用户界面配置交换机”。

使用 CLI 配置交换机

启动终端仿真软件

要启动终端仿真软件,请按以下步骤操作:

开始之前

终端仿真软件通常为 Hyperterminal 或 ProcommPlus 这类 PC 应用,可以实现在交换机和您的 PC 或终端之间进行通信。

过程


步骤 1

如果您在使用 PC 或终端,请启动终端仿真程序。

步骤 2

启动终端仿真会话。

步骤 3

配置 PC 或终端的波特率和字符格式,使之与这些控制台端口默认字符相匹配:

  • 9600 波特率

  • 8 个数据位

  • 无流量控制

  • 1 个停止位

  • 无奇偶校验


下一步做什么

连接电源。

连接电源

要连接电源,请执行以下步骤:

过程


步骤 1

将设备随附的特定于国家/地区的交流电源线的一端连接至交换机的电源连接器。

步骤 2

将另一端插入接地的 100 至 240 VAC、50-60 Hz 交流电源插座。

交换机将通电。

如果在为交换机加电之前启动了终端仿真程序,PC 或终端会显示启动加载程序顺序。需要按下 Enter 键以显示设置程序提示。


下一步做什么

从您的网络管理员处获取 IP 设置。

连接 RJ-45 控制台端口

要使用控制台端口执行初始配置,请将交换机控制台端口连接到使用 VT-100 终端仿真程序的 PC 上。使用 RJ-45 转 DB-9 适配器电缆完成此操作。

要将 PC 或终端连接到交换机,请按以下步骤操作:

过程


步骤 1

使用 RJ-45 转 DB-9 适配器电缆,将 RJ-45 连接器插入位于管理引擎模块前面板上的控制台端口中。

步骤 2

将适配器电缆的 DB-9 母 DTE 连接到 PC 串行端口,或将适当的适配器连接到终端。


连接 USB 控制台端口

过程


步骤 1

 

交换机上 USB A 型端口提供文件系统支持,它不是控制台端口。请参阅 USB A 型端口部分。

步骤 2

将 USB 电缆连接至 PC USB 端口。将电缆的另一端连接至交换机上的迷你 B 型(5 针连接器)USB 控制台端口。

步骤 3

启动 PC 或终端上的终端仿真程序。终端仿真程序通常是一种 PC 应用(如 Putty 或 TeraTerm 等),可以在交换机与您的 PC 或终端之间实现通信。

步骤 4

配置 PC 或终端的波特率和字符格式,使之与这些控制台端口默认特性相匹配:

  • 9600 波特率

  • 8 个数据位

  • 1 个停止位

  • 无奇偶校验

  • 无(流量控制)

步骤 5

按交换机入门指南所述为交换机加电。

步骤 6

PC 或终端会显示引导加载程序顺序。按 Enter 键显示设置提示。执行设置程序中的步骤。


IP 设置

要设置交换机,您需要为交换机分配 IP 地址和其他必要配置信息,以与本地路由器和互联网进行通信。

您将需要网络管理员提供以下信息:

  • 交换机 IP 地址

  • 子网掩码(IP 子网掩码)

  • 默认网关(路由器)

  • TFTP 服务器

执行初始配置

启动脚本运行配置向导,该向导会提示您完成基本配置输入。您可以随时输入问号“?”获取帮助。在任意提示符处使用 Ctrl+C 中止配置对话框。默认设置位于方括号“[ ]”中。

过程


步骤 1

回答您是否想要进入初始配置对话框。

示例:

Would you like to enter the initial configuration dialog? [yes/no]: yes

步骤 2

回答您是否想要进入基本管理设置。

示例:

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

步骤 3

回答您是否想要进入基本管理设置。

示例:

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

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

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

  The virtual terminal password is used to protect
  access to the router over a network interface.
  Enter virtual terminal password: examplevtp
Setup account for accessing HTTP server? [yes]: yes
    Username  [admin]: 
    Password  [cisco]: 
    Password is UNENCRYPTED.
  

步骤 4

回答您是否想要设置一个账户来访问 HTTP 服务器。

示例:

Setup account for accessing HTTP server? [yes]: yes
    Username  [admin]: 
    Password  [cisco]: 
    Password is UNENCRYPTED.
  

步骤 5

回答您是否想要配置 SNMP 网络管理。

示例:

Configure SNMP Network Management? [no]: no 

步骤 6

系统显示接口摘要。根据列表,输入用于连接管理网络的接口名称,然后输入接口的 IP 地址和子网掩码。

示例:


Current interface summary
Any interface listed with OK? value "NO" does not have a valid configuration

Interface              IP-Address      OK? Method Status                Protocol
Vlan1                  unassigned      NO  unset  up                    up      
GigabitEthernet0/0     unassigned      NO  unset  up                    up      
GigabitEthernet1/0/1   unassigned      YES unset  down                  down    
<output truncated>

Enter interface name used to connect to the
management network from the above interface summary: GigabitEthernet0/0

Configuring interface GigabitEthernet0/0:
  Configure IP on this interface? [yes]: 
    IP address for this interface: 192.168.247.10
    Subnet mask for this interface [255.255.255.0] : 255.255.0.0
    Class C network is 192.168.247.0, 16 subnet bits; mask is /16

The following configuration command script was created:
hostname Switch
enable secret 5 $1$2EYv$CSkmxAlgDon2AKcfXNNwT/
enable password exampleenable
line vty 0 4
password examplevtp
username admin privilege 15 password cisco
no snmp-server
!
!
interface Vlan1
shutdown
no ip address
!
interface GigabitEthernet0/0
no shutdown
ip address 192.168.247.10 255.255.0.0
!
interface GigabitEthernet1/0/1
!
interface GigabitEthernet1/0/2
<output truncated>
end

步骤 7

保存配置,然后验证运行配置。

示例:


[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...
[OK]
Use the enabled mode 'configure' command to modify this configuration.

Press RETURN to get started!

*Aug 17 21:16:56.780: %PKI-4-NOCONFIGAUTOSAVE: Configuration was modified.  Issue "write memory" to save new IOS PKI configuration
Switch> enable
Password: exampleenable
Switch#
Switch# show running-config interface GigabitEthernet0/0
Building configuration...

Current configuration : 118 bytes
!
interface GigabitEthernet0/0
 vrf forwarding Mgmt-vrf
 ip address 192.168.247.10 255.255.0.0
 negotiation auto

end

步骤 8

使用以太网管理接口通过 VRF 对接口执行 Ping 操作。

Switch# ping vrf Mgmt-vrf 192.168.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms
Switch#
*Aug 17 21:18:45.152: %PNP-6-PNP_DISCOVERY_STOPPED: PnP Discovery stopped (Config Wizard)

您现在已经完成交换机的初始配置,可以通过网络连接配置其他接口和功能,而无需直接连接到管理引擎模块的控制台端口。

要使用 CLI 执行其他配置或管理任务,请使用终端程序通过控制台端口在 Switch> 提示符处输入命令,或使用 Telnet 通过网络来输入。有关配置信息,请参阅交换机软件配置指南以及交换机命令参考。

在 ROMMON 模式下配置交换机

过程


步骤 1

将系统设置为自动启动。要在 ROMMON 模式下更改网络参数,请将控制台连接到系统,在系统启动期间,看到提示符后按 CTRL+C 停止启动并访问 ROMMON 提示符。

示例:

Initializing Hardware...

System Bootstrap, Version 16.6.1r [FC2], RELEASE SOFTWARE (P)
Compiled Sat 07/15/2017 10:06:12.23 by rel

Current image running: 
Primary Rommon Image

Last reset cause: SoftwareResetTrig
C9400-SUP-1 platform with 16777216 Kbytes of main memory

Preparing to autoboot. [Press Ctrl-C to interrupt]  0     
<output truncated>
rommon1>

步骤 2

设置网络参数。此处输入的值仅用作示例。

示例:


rommon 2> set IP_ADDRESS=192.168.247.10
rommon 3> set IP_SUBNET_MASK=255.255.0.0
rommon 4> set DEFAULT_GATEWAY=172.20.52.35
rommon 5> set TFTP_SERVER=198.51.100.2

步骤 3

输入 set 命令以确保保存设置,然后启动系统

示例:


rommon 6> set
rommon 7> boot

安装和卸载 USB 驱动程序

安装 Microsoft Windows USB 设备驱动程序

首次将基于 Microsoft Windows 的 PC 连接到交换机上的 USB 控制台端口时,必须安装 USB 设备驱动程序。

安装思科 Microsoft Windows USB 驱动程序

过程


步骤 1

从 Cisco.com 网站获取思科 USB 控制台驱动程序文件,然后将其解压缩。

 

您可以从 Cisco.com 网站下载驱动程序文件,以便下载交换机软件。

Windows 10 自带 USB 转 RS232 驱动程序。如需更多功能,请在 cisco.com 的 软件下载中心下载 USB 控制台软件。

步骤 2

如果使用 32 位 Windows 系统,请双击 Windows_32 文件夹中的 setup.exe 文件。如果使用 64 位 Windows 系统,请双击 Windows_64 文件夹中的 setup(x64).exe 文件。

步骤 3

Cisco Virtual Com InstallShield Wizard 启动。点击 Next

步骤 4

此时将出现“Ready to Install the Program”窗口。点击 Install

 

如果出现“User Account Control”警告,请点击 Allow - I trust this program 以继续。

步骤 5

此时将出现“InstallShield Wizard Completed”窗口。点击 Finish

步骤 6

将 USB 电缆连接到 PC 和交换机控制台端口。USB 控制台端口 LED 变为绿色,并且此时出现“找到新硬件向导”。按照说明完成驱动程序安装。


卸载思科 Microsoft Windows USB 驱动程序

卸载思科 Microsoft Windows USB 驱动程序

开始之前

在卸载驱动程序之前断开交换机控制台终端的连接。

过程


步骤 1

运行 setup.exe(适用于 Windows 32 位)或 setup(x64).exe(适用于 Windows 64 位)。点击 Next

步骤 2

此时将出现 InstallShield Wizard for Cisco Virtual Com。点击 Next

步骤 3

在出现“Program Maintenance”窗口时,选中“Remove”单选按钮。点击 Next

步骤 4

在出现“Remove the Program”窗口时,点击 Remove

 

如果出现“User Account Control”警告,请点击 Allow - I trust this program 以继续。

步骤 5

在出现“InstallShield Wizard Completed”窗口时,点击 Finish