D-Link DGS-3024 password reset

The DGS-3024 does not have a built-in reset function that resets the password, but here’s how you can do it (without contacting the D-Link support).

First, you need to reset the switch to its default settings. This will not touch the user accounts on the switch. It will, however, reset other settings, most importantly the IP address to the defaults (10.90.90.90/24). To reset to default settings, boot the switch and wait until

  Please wait, loading runtime image ...................... XX%

is displayed on the serial console, then press Shift-3. After that, press y when asked if you want to load the default configuration.

Note: If you press Shift-3 earlier (during the power on self test), you will just be able to flash the switch, or change the flashing settings.

After that, connect the switch to a computer (using an ethernet cable) and assign it an IP address in the appropriate range (e.g. 10.90.90.1/24).

Secondly, you will need to setup a TFTP server, and in its root put a file named ‘pw.cfg’ containing:

create account admin someuser
pass
pass

where someuser is the user you want to create, and pass is the password you want for that user. If you use a username that already exists, it won’t work (unless you first delete that user).

Third, you will need to download the MIBs for the DGS-3024 (available here), and unpack them.

Then, use SNMP commands to make the switch download and execute the file you created earlier:

# File type (switch configuration)
snmpset -M DGS3024_MIB_20060721/standard/:DGS3024_MIB_20060721/private/ -v2c -c private 10.90.90.90 1.3.6.1.4.1.171.12.1.2.1.1.6.3 i 3 

# Type of transfer (?)
snmpset -M DGS3024_MIB_20060721/standard/:DGS3024_MIB_20060721/private/ -v2c -c private 10.90.90.90 1.3.6.1.4.1.171.12.1.2.1.1.4.3 i 2 

# Filename
snmpset -M DGS3024_MIB_20060721/standard/:DGS3024_MIB_20060721/private/ -v2c -c private 10.90.90.90 1.3.6.1.4.1.171.12.1.2.1.1.5.3 s pw.cfg 

# Transfer direction (download)
snmpset -M DGS3024_MIB_20060721/standard/:DGS3024_MIB_20060721/private/ -v2c -c private 10.90.90.90 1.3.6.1.4.1.171.12.1.2.1.1.7.3 i 3 

# TFTP server IP (the one you set earlier)
snmpset -M DGS3024_MIB_20060721/standard/:DGS3024_MIB_20060721/private/ -v2c -c private 10.90.90.90 1.3.6.1.4.1.171.12.1.2.1.1.3.3 a 10.90.90.1

# Start the transfer
snmpset -M DGS3024_MIB_20060721/standard/:DGS3024_MIB_20060721/private/ -v2c -c private 10.90.90.90 1.3.6.1.4.1.171.12.1.2.1.1.8.3 i 3

After running these commands you should immediately be able to login to the switch (using serial or telnet) using the username and password you specified earlier.

Thanks goes to this blog post (in russian), that helped me figure out how to reset the password.

One thought on “D-Link DGS-3024 password reset”

  1. I got to the SNMP part of your guide, but I can’t get the switch to respond properly to the first SNMP command. I am using Win7, I downloaded the newest version I could find of net-SNMP 32bit windows binaries, and I found the MIB folder to put them in, C:\usr\share\snmp\mibs, renamed the other default folder before I did this to mibs2, did some more reading and set the environment variable MIBDIRS to c:\usr\share\snmp\mibs; Also, I extracted the MIBs to the current folder I have an administrator prompt open in. This is the second copy of net-snmp I have tried as well, one is 5.4.2.1, other is labeled 5.7 but says ‘unknown version’ when I run snmpset..

    But no matter what I do, I get this:

    D:\download\utils\network\SNMP\net-snmp-5-7-all-binaries>snmpset -M DGS3024_MIB_20060721/standard/:DGS3024_MIB_20060721/private/ -v2c -c private 10.90.90.90 1.3.6.1.4.1.171.12.1.2.1.1.6.3 i 3
    MIB search path: DGS3024_MIB_20060721/standard/:DGS3024_MIB_20060721/private/
    Cannot find module (IP-MIB): At line 0 in (none)
    Cannot find module (IF-MIB): At line 0 in (none)
    Cannot find module (TCP-MIB): At line 0 in (none)
    Cannot find module (UDP-MIB): At line 0 in (none)
    Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none)
    Cannot find module (SNMPv2-MIB): At line 0 in (none)
    Cannot find module (SNMPv2-SMI): At line 0 in (none)
    Cannot find module (NOTIFICATION-LOG-MIB): At line 0 in (none)
    Cannot find module (UCD-SNMP-MIB): At line 0 in (none)
    Cannot find module (UCD-DEMO-MIB): At line 0 in (none)
    Cannot find module (SNMP-TARGET-MIB): At line 0 in (none)
    Cannot find module (NET-SNMP-AGENT-MIB): At line 0 in (none)
    Cannot find module (DISMAN-EVENT-MIB): At line 0 in (none)
    Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
    Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
    Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
    Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
    Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
    Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
    Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none)
    Cannot find module (SNMPv2-TM): At line 0 in (none)
    Error in packet.
    Reason: notWritable (That object does not support modification)
    Failed object: iso.3.6.1.4.1.171.12.1.2.1.1.6.3

    EDIT: Never mind. I ran all the commands again today in a batch file and saw the switch hit my TFTP server. I am able to log in with my account name!! Thanks so much for posting this, never thought I was going to be able to get into management on this thing, but now its working 100%!

Comments are closed.