Saturday , December 7 2024
Home / How To / console password recovery Huawei S5300

console password recovery Huawei S5300

What to do if you forgot console password to Huawei S5300 switch?

I received such question last week. One of readers of this blog forgot console password and he wanted to modify startup configuration file from bootrom menu. His operation failed and there was a notification from the system that there is an “invalid package file!” and “auto-booting failed!”.

There was s5300ei-v100r002c02spc100 software installed in this switch so we can focus just on this software.

In S5300 there are two ways to solve this problem:

  1. Create configuration file on your PC, upload it to S5300 and modify startup file
  2. Delete configuration file from S5300 to let it to boot with empty configuration

Let’s start with the first way:

  • Create configuration file on your PC. You can use default empty configuration downloaded from another switch
  • Start FTP server on your PC
  • Upload the configuration file to flash of S5300 from bootrom menu:

*       Copyright (c) 2008-2009 HUAWEI TECH CO., LTD.       *
*************************************************************
Board Name ....................................... CX22EFGE
DDR SDRAM size ................................... 256MB

DDR SDRAM test ................................... pass
Press Ctrl+T to enter Boot-Up Diagnostics in 1 seconds

     ************************************************
     *                                              *
     *             Basic BOOTROM, Ver009            *
     *                                              *
     ************************************************

     Copyright (c) 2008-2009 HUAWEI TECH CO., LTD.
     Creation date: Sep 16 2009, 01:28:46

     CPU L1 Cache    : 32KB
     CPU Clock Speed : 533MHz
     Bus Clock Speed : 266MHz
     Memory Size     : 256MB

Press Ctrl+B to enter BOOTROM menu... 2
password: (default password for S5300 is huawei)
          BOOTROM  MENU

    1. Boot with default mode
    2. Enter serial submenu
    3. Enter startup submenu
    4. Display flash files
    5. Modify BOOTROM password
    6. Reboot
Enter your choice(1-6):
  • As this is an old bootrom type “CTRL Z” to go to hidden bootrom menu and follow the procedure below:
HIDDEN MENU

    1. Erase Flash
    2. Delete file from Flash
    3. Format flash
    4. Enter ethernet submenu
    5. Update EPLD file
    6. Update FPGA file
    7. Update FansCard File
    8. Return to main menu    

Enter your choice(1-8): 4
  ETHERNET  SUBMENU

    1. Download file to SDRAM through ethernet interface and boot
    2. Download file to Flash through ethernet interface
    3. Modify ethernet interface boot parameter
    4. Return to main menu

Be sure to select 3 to modify boot parameter before downloading!

Enter your choice(1-4): 3

Note: Two protocols for download, tftp & ftp.
      You can modify the flags following the menu.
      tftp--0x80, ftp--0x0.

'.' = clear field;  '-' = go to previous field;  ^D = quit

boot device          : mottsec0
processor number     : 0
host name            : host
file name            : S5300EI-V100R005C00SPC100.cc new_cfg.cfg (new configuration file)
inet on ethernet (e) : 192.168.0.20 1.1.1.2 (IP address of the switch)
inet on backplane (b):
host inet (h)        : 192.168.0.22 1.1.1.1 (IP address of PC)
gateway inet (g)     :
user (u)             : huawei huawei (FTP user)
ftp password (pw) (blank = use rsh): huawei huawei (FTP password)
flags (f)            : 0x0 (FTP flag)
target name (tn)     : V1R5SPC100.cc new_cfg.cfg
startup script (s)   :
other (o)            : 

Starting to write BOOTLINE into flash ... done

          ETHERNET  SUBMENU

    1. Download file to SDRAM through ethernet interface and boot
    2. Download file to Flash through ethernet interface
    3. Modify ethernet interface boot parameter
    4. Return to main menu

Enter your choice(1-4): 2

boot device          : mottsec
unit number          : 0
processor number     : 0
host name            : host
file name            : new_cfg.cfg
inet on ethernet (e) : 1.1.1.2
host inet (h)        : 1.1.1.1
user (u)             : huawei
ftp password (pw)    : huawei
flags (f)            : 0x0
target name (tn)     : new_cfg.cfg

Attached TCP/IP interface to mottsec0.
Warning: no netmask specified.
Attaching network interface lo0... done.
Loading... 

Read file to sdram .Done

Writing Flash.done
File length: 5057 bytes
Took time : 4s

          ETHERNET  SUBMENU

    1. Download file to SDRAM through ethernet interface and boot
    2. Download file to Flash through ethernet interface
    3. Modify ethernet interface boot parameter
    4. Return to main menu

Enter your choice(1-4): 4

         HIDDEN MENU

    1. Erase Flash
    2. Delete file from Flash
    3. Format flash
    4. Enter ethernet submenu
    5. Update EPLD file
    6. Update FPGA file
    7. Update FansCard File
    8. Return to main menu    

Enter your choice(1-8): 8

          BOOTROM  MENU

    1. Boot with default mode
    2. Enter serial submenu
    3. Enter startup submenu
    4. Display flash files
    5. Modify BOOTROM password
    6. Reboot

Enter your choice(1-6): 4
No. File Size(bytes)     Created Date       File Name
=================================================================
1:  108376   bytes   Oct 01 2008 00:01:24   matnlog.dat
2:  5169809  bytes   Oct 01 2008 00:05:18   log.log
3:  102      bytes   Oct 09 2008 16:27:17   $_patchstate_a
4:  836      bytes   Oct 01 2008 00:04:36   rr.dat
5:  836      bytes   Oct 01 2008 00:04:41   rr.bak
6:  5057     bytes   Oct 01 2008 00:05:23   new_config.cfg
7:  11050836 bytes   Oct 01 2008 00:02:26   S5300EI-V100R005C00SPC100.cc
8:  327968   bytes   Oct 01 2008 00:50:21   bootrom104.bin
9:  4860     bytes   Oct 01 2008 00:12:59   vrpcfg.cfg
10:  1037     bytes   Oct 01 2008 00:13:12   private-data.txt
11:  7458012  bytes   Oct 01 2008 00:10:20   s5300ei-v100r002c02spc100.cc
12:  384384   bytes   Oct 01 2008 00:11:11   bootrom009.bin
13:  5057     bytes   Oct 01 2008 00:06:35   new_cfg.cfg
Total: 30008KB(Free: 6024KB)

          BOOTROM  MENU

    1. Boot with default mode
    2. Enter serial submenu
    3. Enter startup submenu
    4. Display flash files
    5. Modify BOOTROM password
    6. Reboot

Enter your choice(1-6): 3

       Startup Configuration Submenu

    1. Display startup configuration
    2. Modify startup configuration
    3. Return to main menu

Enter your choice(1-3): 2

Note: startup file field can not be cleard
'.'=clear field; '^D'=quit; Enter=use current configuration
startup type(1: Flash  2: Server)
  current: 1
  new    : 1
Flash startup file (can not be cleared)
  current: s5300ei-v100r002c02spc100.cc
  new    : s5300ei-v100r002c02spc100.cc
saved-configuration file
  current: vrpcfg.cfg
  new    : new_cfg.cfg
license file
  current:
  new    :
patch package
  current:
  new    :
       Startup Configuration Submenu

    1. Display startup configuration
    2. Modify startup configuration
    3. Return to main menu

Enter your choice(1-3): 1
Current startup configuration

  startup type      : Flash
  startup file      : s5300ei-v100r002c02spc100.cc
  configuration file: new_cfg.cfg
  license file      :
  patch package     :
Last time startup state : Success
Latest successful startup configuration
  startup file      : s5300ei-v100r002c02spc100.cc
  configuration file: vrpcfg.cfg
  license file      :
  patch package     :
       Startup Configuration Submenu

    1. Display startup configuration
    2. Modify startup configuration
    3. Return to main menu

Enter your choice(1-3): 3

          BOOTROM  MENU

    1. Boot with default mode
    2. Enter serial submenu
    3. Enter startup submenu
    4. Display flash files
    5. Modify BOOTROM password
    6. Reboot
Enter your choice(1-6): 6
Reboot...

After this procedure the switch will boot with the new configuration file.

And now the second way:

  • Go to bootrom menu:
*       Copyright (c) 2008-2009 HUAWEI TECH CO., LTD.       *
*************************************************************
Board Name ....................................... CX22EFGE
DDR SDRAM size ................................... 256MB

DDR SDRAM test ................................... pass
Press Ctrl+T to enter Boot-Up Diagnostics in 1 seconds

     ************************************************
     *                                              *
     *             Basic BOOTROM, Ver009            *
     *                                              *
     ************************************************

     Copyright (c) 2008-2009 HUAWEI TECH CO., LTD.
     Creation date: Sep 16 2009, 01:28:46

     CPU L1 Cache    : 32KB
     CPU Clock Speed : 533MHz
     Bus Clock Speed : 266MHz
     Memory Size     : 256MB

Press Ctrl+B to enter BOOTROM menu... 2
password: (default password for S5300 is huawei)
          BOOTROM  MENU

    1. Boot with default mode
    2. Enter serial submenu
    3. Enter startup submenu
    4. Display flash files
    5. Modify BOOTROM password
    6. Reboot
Enter your choice(1-6):
  • As this is an old bootrom type “CTRL Z” to go to hidden bootrom menu and follow the procedure below:
HIDDEN MENU

    1. Erase Flash
    2. Delete file from Flash 
    3. Format flash
    4. Enter ethernet submenu
    5. Update EPLD file
    6. Update FPGA file
    7. Update FansCard File
    8. Return to main menu    

Enter your choice(1-8): 2
No. File Size(bytes)      Created Date       File Name
=================================================================
1:  108376   bytes   Oct 01 2008 00:12:29   flash:/matnlog.dat
2:  5169809  bytes   Oct 01 2008 00:05:18   flash:/log.log
3:  102      bytes   Oct 09 2008 16:27:17   flash:/$_patchstate_a
4:  836      bytes   Oct 01 2008 00:12:54   flash:/rr.dat
5:  836      bytes   Oct 01 2008 00:12:58   flash:/rr.bak
6:  5057     bytes   Oct 01 2008 00:05:23   flash:/new_config.cfg
7:  11050836 bytes   Oct 01 2008 00:02:26   flash:/S5300EI-V100R005C00SPC100.cc
8:  327968   bytes   Oct 01 2008 00:50:21   flash:/bootrom104.bin
9:  4860     bytes   Oct 01 2008 00:12:59   flash:/vrpcfg.cfg
10:  1037     bytes   Oct 01 2008 00:13:12   flash:/private-data.txt
11:  7458012  bytes   Oct 01 2008 00:10:20   flash:/s5300ei-v100r002c02spc100.cc
12:  384384   bytes   Oct 01 2008 00:11:11   flash:/bootrom009.bin
13:  5057     bytes   Oct 01 2008 00:06:35   flash:/new_cfg.cfg                  

BE CAREFUL!
This may cause your system fail to start!
Please input the full directory and filename you want to delete, e.g.: flash:/hw-switch.cc  flash     flash:/vrpcfg.cfg

delete it? Yes or No(Y/N)y

Deleting file .....done

         HIDDEN MENU

    1. Erase Flash
    2. Delete file from Flash
    3. Format flash
    4. Enter ethernet submenu
    5. Update EPLD file
    6. Update FPGA file
    7. Update FansCard File
    8. Return to main menu    

Enter your choice(1-8): 8

          BOOTROM  MENU

    1. Boot with default mode
    2. Enter serial submenu
    3. Enter startup submenu
    4. Display flash files
    5. Modify BOOTROM password
    6. Reboot

Enter your choice(1-6): 4
No. File Size(bytes)     Created Date       File Name
=================================================================
1:  108376   bytes   Oct 01 2008 00:12:29   matnlog.dat
2:  5169809  bytes   Oct 01 2008 00:05:18   log.log
3:  102      bytes   Oct 09 2008 16:27:17   $_patchstate_a
4:  836      bytes   Oct 01 2008 00:12:54   rr.dat
5:  836      bytes   Oct 01 2008 00:12:58   rr.bak
6:  5057     bytes   Oct 01 2008 00:05:23   new_config.cfg
7:  11050836 bytes   Oct 01 2008 00:02:26   S5300EI-V100R005C00SPC100.cc
8:  327968   bytes   Oct 01 2008 00:50:21   bootrom104.bin
9:  1037     bytes   Oct 01 2008 00:13:12   private-data.txt
10:  7458012  bytes   Oct 01 2008 00:10:20   s5300ei-v100r002c02spc100.cc
11:  384384   bytes   Oct 01 2008 00:11:11   bootrom009.bin
12:  5057     bytes   Oct 01 2008 00:06:35   new_cfg.cfg
Total: 30008KB(Free: 6032KB)

          BOOTROM  MENU

    1. Boot with default mode
    2. Enter serial submenu
    3. Enter startup submenu
    4. Display flash files
    5. Modify BOOTROM password
    6. Reboot

Enter your choice(1-6): 3

       Startup Configuration Submenu

    1. Display startup configuration
    2. Modify startup configuration
    3. Return to main menu

Enter your choice(1-3): 1
Current startup configuration
  startup type      : Flash
  startup file      : s5300ei-v100r002c02spc100.cc
  configuration file: vrpcfg.cfg
  license file      :
  patch package     : 

Last time startup state : Success
Latest successful startup configuration
  startup file      : s5300ei-v100r002c02spc100.cc
  configuration file: vrpcfg.cfg
  license file      :
  patch package     : 

       Startup Configuration Submenu

    1. Display startup configuration
    2. Modify startup configuration
    3. Return to main menu

Enter your choice(1-3): 3

          BOOTROM  MENU

    1. Boot with default mode
    2. Enter serial submenu
    3. Enter startup submenu
    4. Display flash files
    5. Modify BOOTROM password
    6. Reboot

Enter your choice(1-6): 6

After this operation the switch will boot with default empty configuration file.

After a new software is installed, for example S5300EI-V100R005C00SPC100, the main bootrom menu appearance is changed:

Press Ctrl+B to enter BOOTROM menu... 2 1
password: 

          BOOTROM  MENU

    1. Boot with default mode
    2. Enter serial submenu
    3. Enter startup submenu
    4. Enter ethernet submenu
    5. Enter filesystem submenu
    6. Modify BOOTROM password
    7. Reboot

Enter your choice(1-7): 5

         FILESYSTEM SUBMENU

    1. Erase Flash
    2. Format flash
    3. Delete file from Flash
    4. Rename file from Flash
    5. Display Flash files
    6. Update EPLD file
    7. Update FPGA file
    8. Update FansCard File
    9. Return to main menu    

Enter your choice(1-9):

As you can see, you do not have to go to hidden mode to use ethernet submenu and do operation on files.

How to upload file from this new bootrom menu you can find in upgrade of Huawei’s S5300 switch.

Leave a Reply

Your email address will not be published. Required fields are marked *