How to setup a wireless router with DD-WRT firmware

Updated 23rd July 2010

The Cool Stuff

After 2 years of using wireless broadband, I decided to sign up for a naked ADSL2+ service.

I would need at least a modem for the connection and I figure these are the minimum features I must have:

  1. Wireless support for my Dell Vostro notebook, Norah’s Dell Netbook, 2 of our iphones and not forgetting my trusty Dell Axim X51V PDA. Wireless N is desirable but I will make do with Wireless G if required.
  2. Wireless USB printer support for my Dell 1133 All-in-One printer/scanner combo.
  3. Solid stability as I intend to run 24/7.
  4. Hardware must be cheap and cheerful.

I thought it is a good idea to list down all the steps involved so that if I do forget how I setup the whole thing next time, I can always refer to this page again. I am also inclined to think that some of this info may be useful to some of my friends here.

First off, let me list down all the helpful documentation on the internet and give credits where credits due.

  1. These are the most important website that you must visit
  1. This is another good info for setting up the ASUS router.

In a nutshell, I am going to get a broadcom based modem for the ADSL connection to the ISP, run it in bridge mode in conjunction with a wireless router which I am going to “jailbreak” to install the DD-WRT firmware. The DD-WRT firmware is extremely powerful and just like a friend used to tell me an iphone is useless without jailbreaking, so is a modem without DD-WRT firmware. Tomato is another variant of the firmware and is just as good. The preference is individual.

Hardware Needed

These are the hardware I gathered for the setup.

1. TP-Link TD-8840 ADSL2+ modem from MSY for A$45.

I suppose I can get the TD-8810 modem instead of the TD-8840.  The advantage of the TD-8840 is that it has 4 output LAN ports whereas the TD-8810 only has 1. The additional LAN ports allows you to use another PC to connect to the modem after you put it in bridge mode. Without the additional LAN port, you will not be able to browse directly to the TP-Link web interface without unplugging the only network link to the router (at least not that I know of). The 8840 is only 10 bucks more expensive than the cheaper 8810.

2. ASUS WL-520GU wireless router with USB print server from MWave for A$50. Delivery charge is A$16.66 in my case.

I could have gotten the legendary Linksys WRT-54GL but this model does not have USB support built-in and I finally ended up with the ASUS WL-520GU which is also a fine router.

3. Some network cables and phone cables.

First Baby Step

First,  connect up the TP-Link modem as you normally would. Connect a network cable from the modem to one of the PC. In the web browser, browse to 192.168.1.0.1, login using admin/admin and go to “Quick Setup” on the left panel of the user interface. Input the VPI and VCI values into the box. These values are typically provided by the ISP. The values I used are: VPI = 8, VCI = 35. For connection type, select “PPPoE” for now. Put in the PPP username and password (all of these should be supplied by the ISP). Verify that the modem is actually functioning by plugging a PC into one of the LAN ports.

After this is done, we can put the ASUS into the equation. Connect the ASUS to the TP-Link. Setup the router as you normally would and make sure DHCP server is enabled. Set the WAN IP address as static IP and 192.168.0.11. (again, the choice of IP address is personal). Set the LAN IP address to 192.168.1.1 and gateway address also to 192.168.1.1. Now plug the PC into the ASUS and check if we can access the internet. If everything is working perfectly as it should, we can start the serious modding now.

Software Needed

These are the ingredients you must download from the net to effect the change of firmware for the ASUS.

  • Go to DD-WRT website, navigate to “Downloads”, type in “ASUS” in the search term and navigate to WL520GU. Click on the link and a list of firmwares will now appear. We only need 2 of these firmwares. First off, download the “Special ASUS Firmware” named “dd-wrt.v24_mini_asus.trx”. Save this file into a folder. Next we need to download the “Standard Generic” firmware named “dd-wrt.v24_usb_generic.bin”. Save this file into the same folder.
  • Finally, we need the ASUS firmware restoration utility and this can be found on the CD that comes with the router.

Now we have all the files we need.

Learning to Fly

One of the website suggest that we first set the IP address of the PC to static. I think this is a fine idea. So let’s do it. I set my PC to an IP of 192.168.1.111. Leave the gateway and DNS IP address empty for now. We are now ready to flash.

First we have to unplug the power cable to the router. Start up the ASUS firmware restoration utility and navigate to find the “dd-wrt.v24_mini_asus.trx” firmware. Do not flash first. Look at the back of the modem and we will find a black reset button. Press this button and re-connect the power cable to the router at the same time. The power icon on the ASUS router will flash and this simply means that the router is now put into recovery mode. We can now release the reset button and start the flashing. Press the “upload” button and the DD-WRT firmware will be flashed to the ASUS. This takes about 1 min (actually less i think) in my case. When this is done, browse to 192.168.1.1 and the user interface should now change from the default ASUS one to the cool DD-WRT one. Now setup the username and password again. I use admin as username and password respectively.

Now we can further upgrade the firmware to one with USB support. Browse to DD-WRT interface and under “Administration” click on “Firmware Management”. Select the firmware “dd-wrt.v24_usb_generic.bin” and flash away. The firmware upgrade of the ASUS is now complete. Now change the IP address on the PC to dynamic again.

Bridging the Modem

We can now proceed to the next step where we put the TP-LINK in bridge mode in conjunction with the ASUS router. Basically what this does is that the modem will no longer be responsible to dial up to the ISP. The ASUS router will resume this responsibility. Now we need to login to the TP-Link’s web interface again. Without disconnecting the primary PC from the ASUS router, I use another notebook to plug into one of the spare ports on the TP-Link. See? The additional ports on the TP-LINK is extremely useful in this case.

Navigate to Quick Setup again and under Connection Type, select “Bridging” with encapsulation mode type “LLC/Snap-Bridging”. That’s it. Save the settings and reboot the modem.

On the primary PC, browse to 192.168.1.1 again to enter the DD-WRT web interface. Under “Setup”, navigate to “WAN Setup” and input the username and password associated with the ISP. Make sure that connection type is changed to PPPoE. There are plenty of other settings to play around to suit specific network requirements. Finally, save and reboot the ASUS modem and check if internet can be assessed normally.

We are basically done here. I have not figure out the setting of the USB print server yet so I will leave this to another day.

This is how my network look like now:

USB Print Server Support

updated 25th July 2010

I decided to setup the USB print server support today. I follow the following instructions from DD-WRT website.

The steps to enable JFFS through the router web page are very specific. To avoid having to reset and reprogram your router, it’s smart to make a backup here of your settings. If you follow these steps exactly, it should not lock up.

  1. On the router web page click on Administration.
  2. Scroll down until you see JFFS2 Support section.
  3. Click Enable JFFS.
  4. Click Save.
  5. Wait couple seconds, then click Apply.
  6. Wait again. Go back to the Enable JFFS section, and enable Clean JFFS.
  7. Do not click “Save”. Click Apply instead.

    The router formats the available space.

  8. Wait till you get the web-GUI back, then disable “Clean JFFS” again.
  9. Click “Save”.
  10. It may be wise to Reboot the router, just to make sure
Then one of the website recommended that we first verify that the JFFS space is writable. To do this, I first telnet into 192.168.1.1, login as root/admin and issue the command “mkdir /jffs/test” at the command prompt. Then run “ls /jffs” to see the directory listing. If the “test” folder is displayed, it means the jffs space is writable. We can then delete the test folder by issuing the command “rmdir /jffs/test”.
Then navigate back to the Webgui and under “Services” tab, find the sub-tab called “USB”. Enabled USB support for all services except the USB Storage Support. I read that it is possible to run a flash drive connected to the USB port but I have no need for this for now. I might try this in future.
Now click Save and Apply settings. The router will reboot itself.  We now need to install a print server daemon. Telnet back into DD-WRT and at the command prompt, issue the command wget http://downloads.openwrt.org/snapshots/trunk/brcm-2.4/packages/p910nd_0.93-1_brcm-2.4.ipk

This will download the p910nd print daemon into the router. The file is a small file and download on my end is almost instantaneous.
We then need to install the daemon. We do that by issuing the command “ipkg install p910nd_0.93-1_brcm-2.4.ipk”.
Don’t worry about the warnings about file not found.

This is extracted from one of the great website listed above and I follow the instructions exactly.

Next we will create a script that will check if the printer is on, and if it is, start the print server. It will also stop the server if the printer is turned off. Change to the jffs directory by running cd /jffs and hitting Enter. Type wget http://wl520gu.googlepages.com/watchprinter to download the script. We must make this file executable so it can be run. Type chmod +x /jffs/watchprinter and hit enter. If you run ls you will see that watchprinter is shown in green to indicate an executable file.

Now we need to create a cron job that ensure the watchprinter script is constantly on.

This cron job will run the watchprinter script once every minute. Log into dd-wrt using your web browser. Go to the Administration tab. Scroll down to cron and make sure it is enabled. Put the following command in the Additional Cron Jobs text area and then apply the change.
* * * * * root /jffs/watchprinter

Now we need to create a new printer in windows 7.
Add a new printer, choose Local Printer. Choose Create a new Standard TCP/IP Port. Set the IP address to the IP of the router. (192.168.1.1 by default) Protocol should be RAW, Port number 9100. Install the correct drivers for the printer. For other operating systems read here.

Note: Be sure to create a new printer. Do not modify an existing one.

For whatever reasons, Windows 7 is unable to detect the Dell printer connected to the router. So I started to troubleshoot. I started by issuing a “/watchprinter” command at the /jffs directory. It gives an error message saying that the print server cannot be found. It ends up that the P910nd print daemon cannot be found on the router itself so I suspected that the file wasn’t saved properly in the first place.

I went back to /jffs/tmp directory and issue the wget command again to download again the P910nd daemon. After the download completes, I verify that the file is indeed there by issuing a ls command. Now I install the daemon again.

To make sure that the daemon is installed correctly, I issued the command /watchprinter again on the router. This time there is no error messages and I presumed everything is working fine.

I proceed to install install the Dell printer on windows 7. For whatever reasons, Windows 7 says it is still unable to find the priner on the TCPIP port and prompt me to confirm what is the device type in one of the dialog box. I just select “Generic Network Card” for now. Now windows is attempting to detect the driver model (I am not feeling too optimistic here).
After a long pause, windows then ask me to confirm what is the printer driver to install. As I have previously installed the Dell 1133 printer driver on this PC. I just direct windows to use the previous Dell 1133 driver. Windows then ask if I would want to share out this printer. Answer yes. Now windows will ask to print a test page. I did so to test and it seems the printing is okay. I have also tried printing different type of files to the printer and everything seems okay.
USB Scanning Support on the Router

The Dell 1133 is similar to the Samsung SCX-4600 and is in fact a rebadged of the Samsung printer. Now onto Scanner support. Scanning has always been a tough issue on the linux platform. Let’s see how we go.
Latest update – scanning does not work. Need more research….later.
updated 25th July 2010
Some useful information after combing the internet:

Posted on August 30, 2010, in Computer, Hardware, Software, How-to's. Bookmark the permalink. Comments Off on How to setup a wireless router with DD-WRT firmware.

Comments are closed.