交换机的初始化配置方式分为两种,一种是steup的交互式配置模式,一种是逐条命令的配置模式

提要1:同时配置明文密码与暗文密码时,暗文密码生效而明文密码不生效

这里将首先演示setup的方式配置

进入特权模式

Switch> enable

输入setup

Switch#setup

确认配置

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

输入主机名sd

Enter host name [Switch]: sd

输入加密密码

Enter enable secret: 123

输入明文密码

Enter enable password: 456

输入远程链接密码

Enter virtual terminal password: 789

不启动snmp

Configure SNMP Network Management? [no]:no

进入接口vlan1

management network from the above interface summary: vlan1

是否配置vlan1

Configuring interface Vlan1: Configure IP on this interface? [yes]:yes

配置vlan1的ip并确认

IP address for this interface: 192.168.0.1 配置IP Subnet mask for this interface [255.255.255.0] : 确认子网掩码 Would you like to enable as a cluster command switch? [yes/no]:yes 确认

确认配置保存

[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

命令配置模式

enable 进入特权模式

conf t 进入全局配置模式

no ip domain-lookup 去除域名解析(使命令误输入之后不会陷入假死状态)

hostname qsq 更改交换机名称

enable password 123 设置明文密码

enable secret 456 设置暗文密码

line vty 0 4 设置远程登陆终端上限

password 789 设置远程登陆密码

login 启用远程登陆密码验证

exit 退出

interface vlan1 进入vlan1

ip address 192.168.1.1 255.255.255.0 配置vlan1的IP地址与子网掩码

no shutdown 激活vlan1

end 返回至特权模式

copy running-config startup-config 保存配置