D-Link DSL-604+ Wireless ADSL Router – Support Forum

Instructions: How to enable telnet and the Command Line Interface [D-Link DSL-604+ Wireless ADSL Router - 104294]

  • rperkin
  • Posts: 2535
  • Join Date: 12 August 2003
  • Location: UK
I have been interested in how to access the Command Line Interface (CLI) of the DSL-604+ since I started having 'hanging' problems with it (since resolved) soon after I purchased it in August 2003. Perhaps naively I wanted to get beneath the surface to see if I could diagnose what was happening. I was frustrated - despite the Users Guide and the publicity material saying it supported Telnet, I couldn't Telnet to it. And the CLI did not appear to be documented anywhere. I *did* discover a newsgroup posting which outlined a security hole and a further posting which claimed to have cured the problem. This search should bring most of them up. I was sceptical of the 'solution' as frankly, I didn't understand it. It did not seem to relate to my experience of firmware upgrades. Recently this mechanism for enabling telnet has been discussed elsewhere in this forum by Mensalina - see this thread. The purpose of this post is to give some background and make the instructions more explicit... I am running firmware R2.21.002.11.b3t41uk dated 4-Nov-03. Just to confirm that it *is* possible, here is an example which shows a Telnet session to my router, with the console prompt and the output from the console 'help' command:
C:\>telnet 192.168.0.1

password: logged on; type '@close' to close connection. 192.168.0.1> help

Commands are:

atm bridge buffer bun chips config dhcpclient dhcpserver diap dnsrelay edd ethernet event flashfs globespan igmp ip ip_filter isfs led log nat oam oamcli portcli ppp reflect restart snmp sntp tftp tiProcess time uptime version webserver wireless

'.' repeats the last command Type 'help all' or 'help ' for more details

192.168.0.1> @close

Connection to host lost.

C:\>

Why would anyone want to enable Telnet? Well, it allows access to the CLI. This is inherently more powerful than the web-based configuration manager. Essentially, the web-based configuration hides the complexity of the CLI from the user. This post gives some background information and tells you how to enable Telnet so that you have access to the CLI. It also tells you how to change the password once you do have access. NOTE: THE INFORMATION PROVIDED HERE IS THIS GIVEN IN GOOD FAITH. NO WARRANTY IS GIVEN THAT THE INFORMATION IS CORRECT. YOU UNDERTAKE ANY ACTIONS SOLELY AT YOUR OWN RISK. USE OF THIS INFORMATION INDICATES ACCEPTANCE THAT YOU MAY INVALIDATE ANY WARRANTY OFFERED BY THE MANUFACTURER OR SUPPLIER. Now read on. CONTINUED...
  • rperkin
  • Posts: 2535
  • Join Date: 12 August 2003
  • Location: UK
...CONTINUED 1. Once upon a time, there was a separate Firmware Upgrade Utility for the DSL-604+. Currently, new releases of firmware are distributed as .xDSL files which are installed via the web-based Configuration Manager. 2. The Firmware Upgrade Utility can also backup and restore the current configuration. This backup essentially consists of text files containing console commands. By taking a backup, then editing the commands, then restoring the modified backup it is possible to change the configuration, including enabling Telnet. 3. More accurately, the Telnet password is the same as the SNMP 'write' community name. What we will do is enable SNMP with different community name, then use this information to log on to the router. 4. I'm not sure when D-Link UK ceased to issue the Firmware Upgrade Utility, but elsewhere it was still being issued as late as R.21.002.11.b3t25. You can find it on the D-Link France site here and on the D-Link Spain site here (it's marked as 'Spain only', but it's on the D-Link Italy server!) and perhaps elsewhere as well. 5. Of these, the variant on the French site is the best. Curiously, it's the UK version. It appears to be *complete*, that is it includes: - release notes (very revealing) - Firmware Upgrade Utility - .xDSL file for the web-based configuration upgrade - .bin file (presumably a binary image of the firmware. Don't know how to load it) 6. Download the file. Assuming it's the file 604+_b3t25uk.zip from the French site, unzip it. Then execute the file DSL604+G-UK-R2-21-002-11-b3t25uk-upgrade-utility.exe which is a self-extracting zipfile. When it's extracted, execute the file setup.exe This will install the Firmware Upgrade Utility into the directory
\Program Files\D-Link\ DSL-604+ Firmware Upgrade Utility\
and create a Start menu entry and desktop icon. The data for the upgrade is placed in subdirectory \DSL-604G 7. Just a note before we start in anger. When running the software described here, I suggest you temporarily disable any virus checking and firewall software you have running. This is known to be a potential cause of problems when running the Firmware Upgrade Utility software and when loading firmware to the router. Also, perform the firmware installation from an Ethernet connected PC, not over a wireless link. Again, you don't want anything to interrupt the firmware update process. 8. Run the utility. It will search your network to 'discover' DSL-604 devices, and list them. You probably *DON'T* want to 'upgrade' the firmware – it's likely you're running a later version than b3t25. In this case, just select the Backup/Restore tab. Ignore the text on the screen about IP Address and Community String. Ignore the IP Address details. It's all wrong and of no consequence. 9. Click on Backup. This will create a subdirectory \Backup alongside the \DSL-604G subdirectory. Once created, the contents of the Backup directory are a number of text files containing CLI commands. Open Windows Explorer and browse to the Backup subdirectory – you will see that one of the files is snmpinit. 10. Double click the file snmpinit to Open it. Since it has no file extension, Windows will be puzzled an
  • rperkin
  • Posts: 2535
  • Join Date: 12 August 2003
  • Location: UK
...CONTINUED 11. The file contains the following text (when backed up from b3t41uk): access read public access write private 200.7.7.7 Edit this to give new 'read' and 'write' community names. Here's an example: access read abc123 access write xyz345 Here the 'read' community has been changed to abc123 and the 'write' community to xyz345 It is the 'write' community name which is the Telnet password. Save the file. If prompted, do *not* change the format of the file (it has Unix style LF delimiters) 12. Return to the Upgrade Utility, and on the Backup/Restore tab click Restore. It's fingers crossed time now. You will see a message Warning. Updating flash now! and after a minute or less the message The configuration files has now been restored! (sic). Close the Upgrade Utility - we won't need it again, although it does have some uses. WAIT for the router to reboot itself - it will take a couple of minutes. Fire up your browser and check that you can login to the web-based configuration manager and access a web page or two. 13. Open a command prompt and enter: telnet 192.168.0.1 (assuming that's the IP address of your router) When prompted for the password, give the 'write' community name you have defined. In the example above, it is xyz345 14. That's it. You're in. Just be careful. You can damage your configuration – what you do is your responsibility. 15. Now you have telnet access, you don't need to go through this rigmarole again to change your password (more accurately, SNMP community name). Login to the router CLI, and at the console command prompt enter the following (without the > > of course!): snmp access delete <old password 1> snmp access read <new password 1> snmp access delete <old password 2> snmp access write <new password 2> config save flashfs update restart Note: Don't forget to WAIT for the router to reboot itself. NEVER interrupt this process, whether using the CLI or the web-based configuration manager, and certainly NEVER power the router down during the process. 16. What else can you use it for? Well, if you've forgotten the password for the web-based administration, then the following CLI commands will tell you: flashfs cat inituser Note: If you've forgotten *all* your passwords, the Firmware Upgrade Utility will reveal all. Use the Backup facility. Your SNMP communinty names (telnet password) are listed in file snmpinit (we've seen and used this here). Your web-based administration details (router login username and password) are listed in file inituser. 17. Where can you find documentation on the CLI? That's tricky. There is no publicly available DSL-604+ Technical Reference Manual. All the information I've been able to find is either generic, or for different D-Link models, or from different manufacturers. All firmware implementations contain some manufacturer-specific and model-specific commands. I do *not* know what these are for the DSL-604+. Now there's a job for someone! Here's what I do have: The DSL-604+ has a DSL communications chipset from Globespan Virata, and runs their operating system, ATMOS. Find the generic ATMOS Command Reference here. Find a more user-oriented manual here (it's got more information, but is not for D-Link but for an AzTech router). Find the DSL-504 command summary here.
  • DanD
  • Posts: 50
  • Join Date: 17 November 2003
Thanks for all this info. They are excellent, clear instructions and although at the time of writing this I haven't yet tried them I'm sure it'll be a breeze! Slightly off topic, but I was very interested to read the detailed release notes that you highlighted with the firmware on the French site. Particularly the reference to 'Add TI 4x feature to wireless AP, compile time decided'! It's a shame that this feature doesn't appear to have been compiled in any of the firmware versions I've tried! I'll let you know if I'm able to identify any additional CLI commands whilst playing. A little more info...(spurred on by all the helpful info in the previous posts) I had a look at the firmware available via the Australian site www.dlink.com.au and found that the current firmware (33au) zip file contains a READ_ME file which also gives some info on how to use the firmware utility and also explains how to use the .bin file to upload firmware via the serial port, if necessary. Thanks again. Dan
  • fettyjah
  • Posts: 27
  • Join Date: 11 November 2003
  • Location: UK
Richard, I have tried running the Firmware Upgrade Utility, but when I select the BACKUP option, it seems to get stuck saying transmitting configuration files, 187 bytes transferred. WHen I check what files have been produced, I only have the init_gspn file. The utility continues to run but produces no other files. ANy ideas?
  • rperkin
  • Posts: 2535
  • Join Date: 12 August 2003
  • Location: UK
Jeff I have run it previously - indeed many times - without problems, when I was researching this, but not since last month when I confirmed that it worked OK and reported it here. To see if I could reproduce the problem you experienced I have just tried it again: 1. To ensure I didn't lose any previous data, I copied the Backup directory, then deleted it. 2. On running the utility, I got an error message saying that the file upgrade.frm was missing. 3. On replacing the directory - in its entirety, the utility ran but as you say "seemed to get stuck". So I can reproduce your symptoms 4. I was running on a wired PC. I then stopped all wireless activity (there were two other wireless PCs active at the time) 5. I deleted all files in the Backup directory with the exception of upgrade.frm 6. The utility ran OK, and completed the backup within a few seconds. I think the problem was due to the fact that there was wireless activity on the router. Trying shutting everything down other than one PC with Ethernet connection to the router, and try again. In hindsight this is probably wise - after all, even though I was only taking a backup this time, I was actually using a firmware upgrade utility which acceses the router at a fairly low level. I wouldn't have loaded new firmware via the web-based config with other activity on the router, so I don't think this utility should be run with other activity either. Hope this helps
  • mwright
  • Posts: 81
  • Join Date: 20 December 2003
I am interested in getting access to the snmp interface on the router. Does the technique described here achieve that? Or is the interface already enabled (I have tried to access it but cannot seem to get a connection) Thanks
  • rperkin
  • Posts: 2535
  • Join Date: 12 August 2003
  • Location: UK
Yes. It works just fine - and of course you can set the SNMP community names/strings to whatever you want. See also my reply to your other post. As an aside I'm surprised that you haven't got it to work using the default Read setting - it does work OK for me. Hope this helps
  • spikes
  • Posts: 20
  • Join Date: 10 January 2004
i am having a few problems with this. i have changed "snmpinit" to access read abc123 access write abc123 but when i telnet and put abc123 as the password it says password: logon failed. Connection to host lost. any ideas?
  • spikes
  • Posts: 20
  • Join Date: 10 January 2004
Anyone?
  • rperkin
  • Posts: 2535
  • Join Date: 12 August 2003
  • Location: UK
Try editing the file again to give two different passwords, restore and try again. Hope this helps - let us know how you get on
  • spikes
  • Posts: 20
  • Join Date: 10 January 2004
yeah i tried that aswell. 2 completly different passwords / names. still no joy
;