交换机密码破解:不丢失交换机原有的配置
================================================================
1.断电重启交换机,通电时按住Mode,直到进入ROM,然后松开,出现提示符
switch: 后输入
switch:flash_init
switch:load_helper
switch:dir flash:
switch:rename flash:config.text flash:config.old(随便你改成什么但要记得)
switch:boot/reboot/reload/reset用其中的一个命令重新启动交换机
重新启动后:
Continue with configuration dialog? [yes/no]:n  \*不进行初始配置
switch#rename flash:config.old flash:config.text
switch#copy flash:config.text system:running-config
switch(config)#no ena pass
switch(config)#no ena sec
switch#copy runn start
switch#reload
================================================================

交换机配置文件备份、IOS备份、升级、灾难恢复
================================================================
配置文件备份:
1、SW(config)#interface vlan 1
2、SW(config-if)#ip add ip mask    交换机的vlan1 ip以交换机的原始ip为准
3、在pc上打开TFTP服务器,并且网卡ip要和SW的ip在同一个网段
4、SW(config)#copy flash:config.text tftp:
5、Address or name of remote hos []?本pc的ip
6、SW#sh flash: d  查看flash中还有那些文件,再做备份
7、SW(config)#copy flash:文件名 tftp:
IOS备份:
SW(config)#copy flash: c2950-i6q4l2-mz.121-19.EA1c.bin tftp:
================================================================
1900
SW(config)#copy nvram tftp:(//host/dst_file )    配置文件上传
SW(config)#copy tftp:(//host/src_file nvram )   配置文件备份
SW(config)#delete nvram
2950
SW(config)#copy startup-config tftp:
SW(config)#erase startup-config
================================================================
IOS升级:(记住升级前一定要先备份,IOS不要放在中文文件夹下)
SW(config)#copy tftp: c2950-i6q4l2-mz.121-19.EA1c.bin flash:
SW(config)#boot system flash:新的IOS名.bin   设置从此IOS启动
SW(config)#del flash:将要删除的IOS文件名  (如果空间足够大最好不删)
================================================================
灾难恢复:
1、串口线连接交换机console 口
打开超级终端(必须支持XMODEM协议),配置速率为9600
重关机启动交换机c,并按住mode按钮1-2秒钟
2、switch:flash_init
3、switch:load_helper
4、switch#:copy xmodem: flash: IOS文件名.bin
5、超级终端的菜单上的
传送---发送文件---选择IOS镜像文件所在地
选择使用“xmodem”协议,点击“发送”
发送完毕后boot启动即可
备注:这里建议用windows自带的超级终端,上面带有进度显示、时间等
================================================================
IOS:config.text删除不了,即使删了,它也会备份最近的一个配置
升级IOS时先备份,若空间不够则自动覆盖;若未自动覆盖,则先导出IOS文件(用TFTP),再删除
 
接着导入新的更高版本的IOS,此过程很重要,一定不能让Switch重启或断电
================================================================