Tag Archive for 'cisco'

Cicso Catalyst 3750-E交换机enable密码忘记后的恢复

一台Cicso Catalyst 3750-E交换机忘记enable密码后无法进入调试,只能想办法将密码去除,但需保留原来交换机的配置。

步骤如下:

1、将交换机console口与电脑相连,再按住交换机面板前的“mode”键,然后重启交换机,直到面板的”STAT”灯亮,放手。如下图。

2、此时会出现如下菜单,依次输入flash_init,load_helper,然后重命名配置文件名称,最后输入boot重启交换机,操作如下:

The system has been interrupted prior to initializing the
flash filesystem.  The following commands will initialize
the flash filesystem, and finish loading the operating
system software:

    flash_init
    load_helper
    boot

switch: flash_init
Initializing Flash…
flashfs[0]: 4 files, 1 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 15998976
flashfs[0]: Bytes used: 8282624
flashfs[0]: Bytes available: 7716352
flashfs[0]: flashfs fsck took 11 seconds.
…done Initializing Flash.
Boot Sector Filesystem (bs) installed, fsid: 3
Setting console baud rate to 9600…

switch: load_helper

switch: dir flash:
Directory of flash:/

2    -rwx  8276561  <date>  c3750-ipservices-mz.122-37.SE.bin
3    -rwx  616       <date>     vlan.dat
4    -rwx  5         <date>       private-config.text
6    -rwx  3027      <date>     config.text

7716352 bytes available (8282624 bytes used)

switch: rename flash:config.text flash:config.text.old
switch: boot
Loading “flash:/c3750-ipservices-mz.122-37.SE.bin”…@@@@

3、重启后进入系统进行如下操作

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

还原配置文件名称,并复制配置文件至running中
Switch>en
Switch#rename flash:config.text.old flash:config.text
Switch#copy flash:config.text system:running-config

进入配置模式,去除enable密码,并保存至start-config中
c3750#configure terminal
c3750(config)#no enable password
c3750(config)#exit
c3750#wr memory
00:04:04: %SYS-5-CONFIG_I: Configured from console by console
Building configuration…
[OK]

这样,交换机的enable密码就去除完成了。

CISCO 4507R根据IP地址查找端口,并使用4/46口来镜像此端口

首先找出10.0.0.9的IP地址所在的端口,然后制作10.0.0.9服务器的镜像口->fastethernet4/46,使之可以查看10.0.0.9上的具体数据包信息。

操作步骤:

1、找出10.0.0.9的MAC地址

Switch#ping 10.0.0.9

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.9, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Switch#sh arp | in 10.0.0.9
Internet  10.0.0.9                4   0014.5e19.8345  ARPA   Vlan1
Internet  10.0.0.92               0   0019.bbdc.1d1f  ARPA   Vlan1
Internet  10.0.0.93               0   001e.4f98.0934  ARPA   Vlan1

2、查看MAC地址0014.5e19.8345的相应端口,显示为在fast4/23端口上

Switch#show mac-address-table address 0014.5e19.8345
Unicast Entries
 vlan   mac address     type        protocols               port
——-+—————+——–+———————+——————–
   1    0014.5e19.8345   dynamic ip                     FastEthernet4/23

3、制作fast4/23的镜像端口->fast4/46

Switch(config)#monitor session 1 source interface fastEthernet 4/23
Switch(config)#monitor session 1 destination interface fastEthernet 5/46

这样,就完成了从查找端口到制作镜像口的操作。