Cisco 3750交换机密码初始化

本文介绍Cisco3750交换机在忘记密码后如何进行密码重置的过程,包括进入交换机的ROM Monitor模式、重命名配置文件、启动交换机进入设置向导等步骤,并详细记录了配置过程。

分类: 系统运维

1.  连接交换机的console口到终端或PC仿真终端。用无Modem的直连线连接PC的串行口到交换机的console口。

2.  拔掉交换机的电源.

3.  按住交换机上的Mode按钮,与此同时,重新插上交换机的电源线.当交换机上SYST的LED长期亮的时候,可以松开Mode按钮。

4.  再通过超级终端连接交换机。

5.  交换机有如下显示:

switch:

:switch: flash_init

初始化flash文件系统

Initializing Flash...

flashfs[0]: 83 files, 4 directories

flashfs[0]: 0 orphaned files, 0 orphaned directories

flashfs[0]: Total bytes: 15998976

flashfs[0]: Bytes used: 6472704

flashfs[0]: Bytes available: 9526272

flashfs[0]: flashfs fsck took 8 seconds.

...done Initializing Flash.

Boot Sector Filesystem (bs) installed, fsid: 3

Setting console baud rate to 9600...

switch: rename flash:config.text flash:config.old

更名含有password的配置文件

switch: boot

启动交换机

Loading "flash:c3750-i9-mz.121-19.EA1d/c3750-i9-mz.121-19.EA1d.bin"...@@@@@@@@@@

。。。。。。。。

         --- System Configuration Dialog ---

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

您是否进入初始化配置对话,选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 '[]'.

。。。。。

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

您是否进入基本配置安装,选Y

Configuring global parameters:

 

  Enter host name [Switch]: zcomf10

输入设备的名字

 

  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: zcom:com

输入密文

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

输入密码(不能和密文相同)

  The virtual terminal password is used to protect

  access to the router over a network interface.

  Enter virtual terminal password: 87654321

输入虚拟终端的密码(以备远程登录)

  Configure SNMP Network Management? [no]:

询问是否要设置路由器支持的各种网络协议:

Current interface summary

。。。。。。。

Enter interface name used to connect to the

management network from the above interface summary: vlan1

键入作为管理接口的接口名

 

Configuring interface Vlan1:

  Configure IP on this interface? [yes]: Y   (Vlan1IP配置)

    IP address for this interface: 192.168.10.1  (键入IP地址)

    Subnet mask for this interface [255.255.255.0] :255.255.255.0  (键入子网掩码,或按回车键使用默认值)

    Class C network is 192.168.10.0, 24 subnet bits; mask is /24

Would you like to enable as a cluster command switch? [yes/no]: no  (n集群模式?)

 

The following configuration command script was created:

已建立以下配置信息

hostname zcomf10

enable secret 5 $1$6kZ/$LCWVkp11b1IMVWm8PSVuo0

enable password 12345678

line vty 0 15

password 87654321

no snmp-server

!

no ip routing

 

!

interface Vlan1

no shutdown

ip address 192.168.10.1 255.255.255.0

!

interface GigabitEthernet1/0/1

!

interface GigabitEthernet1/0/2

!

。。。。。。。。

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.

这里有一个有趣的地方,那就是你能够选择进入命令行接口模式并放弃刚才的配置(0),你也能够回头重新再设置一遍(1),也能够保存配置到NVRAM中并退出重启(2)。这里我选择的是0,我们将不保存刚才的配置并进入命令行接口模式(CLI)。接下来我们将介绍CLI。再重复一次,你可以在任何时候按下 Ctrl+C来退出安装模式。

Enter your selection [2]: 2

Building configuration...

[OK]

Use the enabled mode 'configure' command to modify this configuration.

 

zcomf10>en

进入特权模式enenable一样

Password:

zcomf10#copy run

zcomf10#copy running-config star

zcomf10#copy running-config startup-config  (退出,并保存到startup-config文件里:

Destination filename [startup-config]?

Building configuration...

[OK]

zcomf10#reload     (完成重启)

Proceed with reload? [confirm]

<think> 嗯,用户这次明确询问思科交换机恢复初始化的方法。结合之前的对话历史,系统要求用中文回复并遵循特定格式规范。用户应该是网络管理员或技术人员,需要紧急处理设备重置问题,语气直接说明需求迫切。 思科交换机初始化涉及多重验证机制,必须严谨操作。核心步骤包括清除启动配置、删除vlan.dat文件、断电重启这三项关键操作。特别要注意2950/3550等老型号与Nexus系列的文件路径差异——老平台vlan.dat在flash根目录,而Nexus存放在volatile:目录。用户若执行write erase后配置仍残留,大概率是漏删了vlan.dat文件。 安全方面需重点提醒:恢复前务必确认设备不在生产环境运行,且要备份必要配置。曾见过用户误删运行中核心交换机的惨剧。操作顺序也关键,必须先清配置再重启,否则配置可能从启动配置文件恢复。 考虑设计结构化回复:用分步代码块展示CLI命令序列,对关键术语如"特权模式"加注中文说明。最后延伸三个实用问题——包括密码恢复和配置导入导出,这些是初始化后常见后续操作。特别是密码恢复流程差异大,Catalyst和Nexus完全不相同,值得单列问题说明。 用户可能遇到的实际难点在于:某些型号断电重启后会自动保留vlan.dat。需要追加"验证步骤",用show vlan命令确认默认VLAN1是否呈现初始状态。若发现残留VLAN,需复查文件系统。这部分作为补充提示放在注意事项更妥当。 </think> 思科交换机恢复初始化需按以下步骤操作,**请务必提前备份配置并确认设备不在生产环境**: ### 步骤1:清除启动配置 ```cisco Switch# erase startup-config Erasing the nvram filesystem will remove all configuration files! [confirm] [回车确认] Erase of nvram: complete Switch# ``` ### 步骤2:删除VLAN数据库(关键步骤) ```cisco Switch# delete vlan.dat Delete filename [vlan.dat]? [回车确认] Delete flash:/vlan.dat? [confirm] [回车确认] Switch# ``` > 📌 **注意**: > - 2950/3550等老型号需执行此步骤 > - Nexus系列使用 `delete volatile:vlan.dat` > - 部分新型号会自动同步清除 ### 步骤3:重启设备 ```cisco Switch# reload Proceed with reload? [confirm] [回车确认] ``` ### 验证初始化效果 重启后通过命令检查: ```cisco Switch> enable Switch# show running-config ! 应只显示默认配置(无端口/IP配置) Switch# show vlan ! 应仅存默认VLAN1 ``` ### ⚠️ 注意事项 1. **物理访问权限**:部分型号需通过Console线连接 2. **密码重置**:若忘记密码需进入ROMMON模式 (中断启动流程 → 修改寄存器值 → 跳过配置加载) 3. **堆叠系统**:需逐台单独初始化后再重组堆叠 4. **SDM模板**:数据中心交换机需检查 `show sdm prefer` 是否恢复默认 > 💡 **延伸场景**: > 若需完全恢复出厂固件(含IOS),需使用 `archive download-sw` 命令重刷系统镜像[^cisco_recovery]。 --- ### 相关问题 1. **如何从TFTP服务器恢复思科交换机配置?** 2. **忘记思科交换机enable密码应如何重置?** 3. **思科交换机初始化后如何快速导入基础安全配置?** [^cisco_recovery]: 思科官方恢复指南建议在关键操作前验证IOS文件的MD5校验值。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值