Category Archives: Random stuff

Upgrading firmware on the Linksys SRW2024 without using the web interface

This is useful if, for example, the web interface keeps resetting the connections.

Upgrading the firmware requires first updating the boot code, and the regular console in the earlier firware doesn’t have support for flashing the boot code. However, there is a hidden IOS-like cli available, that makes it possible to upgrade the boot code over tftp. An additional benefit is that it is much faster than using xmodem.

The steps

  1. Setup a tftp server on your machine, serving the files srw2024_16_boot-101.rfb and ls20xx-12230.ros (download from Cisco)
  2. Connect your computer to the switch using ethernet and serial cables.
  3. Boot the switch.
  4. Log into the console.
  5. Press C-z.
  6. On the new promt, type lcli and press enter.
  7. To upgrade the boot code, type copy tftp:///srw2024_16_boot-101.rfb boot
  8. Then upgrade the firmware: copy tftp:///ls20xx-12230.ros image
  9. Lastly, restart the switch: reload

That’s it.

As an aside, please note that the web interface only works in Internet Explorer, so if it seems like it doesn’t work, it’s probably because your’re using another browser.

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.

Flashing taskbar with PuTTY + irssi + screen

As quite many people do, I use to IRC using screen + irssi on my server, which I connect to using PuTTY. A little while ago I went out to find a way to make PuTTY’s taskbar flash when I was hilighted. It wasn’t trivial to find the information on how to do it (it took me some time), so I though I could share it:

In irssi:
/set bell_beeps on
/set beep_msg_level MSGS NOTICES DCC DCCMSGS HILIGHT

And in putty:
Go to Terminal -> Bell in the settings, and set “Taskbar/caption indication on bell” to Flashing or Steady (whichever you prefer).

That should be it, and don’t forget to save the session settings in PuTTY so you don’t have to change them every time you connect ;) .