DD-WRT : A custom version of linux based on BusyBox for embedded devices like router . Its and advanced firmware to help users get more out of their hardware and to have more control over the device and how it functions . Can be used in Cybercafe as advanced traffic control unit .

Requirements :
- WiFi or Non - WiFi Router : Choice for cheap routers are ASUS WL520GU and ASUS RT-N13U B1 , these come with USB support . Others without USB support ASUS RT-N10 and Buffalo WHR-HP-GN . For support of other routers check Router Database .
- DD-WRT Flash File : Source your download file from the site itself or here is the official repository Here .
- NAS Storage Device : Required only if you want to setup a downloading server or a NAS setup on your home LAN / WiFi .Can be a pen-drive or external hard disk , external hard disk is preferred as pen-drives have limited number of read and writes.
The method I will show is for ASUS RT-13U B1 .
Reasons why you should opt for DD-WRT over shitty Asus Firmware :
- Almost all Linux Kernel Fixes done in dd-wrt.
- Allows freedom to go about install any apps which linux supports(Most probably all of them)
- Very good for people who intend to use in cybercafes as it allows tighter control and improved security and proper logging of events
- DD-WRT is far superior compared to other open Firmware like Tomato and Open WRT and DD-WRT community is best in the recent times.
- Install Transmission to get all download on your USB without keeping the PC turned on[Yes it supports full resume downloads never break now]
FLASHING THE ROUTER WITH DD-WRT
- Goto this link , select your operating system and download ASUS RT-N13U Rev.B1 utilities and a copy of the ASUS RT-N13U Rev.B1 firmware 2.0.2.0 or later [avoid the beta of RUSSIA ONLY] . Install ASUS RT-N13U Rev.B1 utilities .
- Download DD-WRT [16994] or latest from the router database . I have linked build 16994 as it has been reported the most stable build by many users .
- Connect the router on LAN [not WiFi] if not connected already .Be sure router's WAN port is open and other LAN ports are open i.e. no connection other than your PC . Using IE [preferred at DD-WRT Forums] or Chrome is advised over Firefox as few face problems on the mentioned browsers .
- Place the router in recovery mode . To do that unplug the router , push the RESET button situated at the bottom of the router properly, then plug in the router . Hold the button a minimum of 5 seconds until the LED in front starts to blink .
- On PC open ASUS Firmware Restoration Utility . Select the image you have downloaded from DD-WRT with extension ".trx" (asus-to-ddwrt.trx) . Click "Upload" and do not interrupt as it may render your router bricked .
- Reboot and launch DD-WRT web interface . For telnet access use username: root , password: admin as other login details didnt work for me neither did it work for few others .
SETTING UP STORAGE TO USE ON ROUTER
- Download GParted Live or any other live distribution of linux . I am using ubuntu for this purpose as I have it on dual boot .Open GParted and select your pen-drive properly from the drop-down box at top right corner for e.g for me its "/dev/sdd" . Delete all partitions , it should look like this .

Select the first button on the left to create partition .
First make this partition

Secondly make this partition for the installation of Optware

Thirdly create another partition of the left over space [I have named it SHARE]

NTFS is avoided as it doesn't allow the drive to function at optimum rates when connected to router .

When everything is done it should look like this , hit "Apply All Operations" when you are done .
It should end up like this

Note the partition with exclamatory mark .
Close GParted.
Now open up TERMINAL , enter a few commands
Code:
sudo dd if=/dev/zero of=/dev/sd*#
Replace the * with the alphabet and #[ should be 1 if you started off fresh] with the number you noted in the previous GParted window.
Code:
sudo wget http://home.karneval.cz/10102207/fs.gz
Code:
sudo dd if=fs.gz of=/dev/sd*#
Code:
sudo rm fs.gz;sudo reboot

Now open http://192.168.1.1/Diagnostics.asp in your browser
In the text box under command shell copy this out :
Code:
EXT3="YES";EXT3P="part2";EXT32="YES";EXT3P2="part3 ";mkdir /tmp/etc/config echo "tar -zxvf /dev/scsi/host0/bus0/target0/lun0/part1 -C /tmp/root" >> /tmp/etc/config/fs.wanup if [ "$EXT3" == "YES" ]; then echo "sh /tmp/root/ext3" >> /tmp/etc/config/fs.wanup; fi if [ "$EXT32" == "YES" ]; then echo "sh /tmp/root/ext3" >> /tmp/etc/config/fs.wanup; fi echo "mount -o rw -t ext3 /dev/discs/disc0/$EXT3P /opt" >> /tmp/etc/config/fs.wanup echo "mount -o rw -t ext3 /dev/discs/disc0/$EXT3P2 /mnt" >> /tmp/etc/config/fs.wanup echo "rm /tmp/root/*.ko /tmp/root/fs.gz /tmp/root/ext3" >> /tmp/etc/config/fs.wanup chmod +x /tmp/etc/config/fs.wanup sh /tmp/etc/config/fs.wanup echo "nobody:*:65000:65000:nobody:/mnt:/bin/false" >> /etc/passwd sleep 60 iptables -I INPUT -p tcp -d 192.168.1.1 --dport 25000 -j logaccept echo 1 > /sys/class/scsi_disk/0:0:0:0/allow_restart /opt/bin/transmission-daemon -g /mnt/data/torrents/.config/transmission-daemon
And Select the Save Startup Box just below.
Goto http://192.168.1.1/USB.asp
Enable everything under this tab and select Disk Mount Point as "/opt"

Now connect your drive and goto Administration tab and select reboot router .
INSTALLING OPTWARE
For this you need to telnet to the router . On windows you can use putty and for linux the basic terminal is more than enough
.

Open Terminal and enter :
Username:root
Password:admin
type "mount"
output should be like this
Code:
root@DD-WRT:~# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
none on /dev type devfs (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
ramfs on /tmp type ramfs (rw)
devpts on /dev/pts type devpts (rw)
devpts on /proc/bus/usb type usbfs (rw)
/dev/discs/disc0/part2 on /opt type ext3 (rw,data=ordered)
/dev/discs/disc0/part3 on /mnt type ext3 (rw,data=ordered)
See the "/opt" and "/mnt" are mounted
Optware strictly needs an empty ext3 partition.
Code:
wget http://home.karneval.cz/10102207/optware-install.sh -O - | tr -d '\r' > /tmp/optware-install.sh
sh /tmp/optware-install.sh; ipkg update; ipkg upgrade
wget http://home.karneval.cz/10102207/sort -P /opt/bin; chmod +x /opt/bin/sort
Code:
ipkg install xinetd htop nano samba2 vsftpd tftp-hpa wget; killall xinetd smbd nmbd
rm /opt/etc/samba/smb.conf /opt/etc/vsftpd.conf /opt/etc/init.d/S80samba /opt/etc/xinetd.d/tftp
wget http://home.karneval.cz/10102207/opt.gz -P /opt; tar -xvzf /opt/opt.gz -C /opt
sh /opt/etc/init.d/S10httpd; sh /opt/etc/init.d/S10xinetd; rm /opt/opt.gz
ln -s /mnt/data /opt/share/www/data
Now you can access your router
Am skipping the part to allow WAN access to these server if you want I can add them later .
INSTALLING TRANSMISSION[HOME SEEDBOX]
Now in telnet terminal put in this :
Code:
cd /mnt
mkdir -p /mnt/data/torrents # -p to make both directories at the same time
/opt/bin/ipkg-opt -verbose_wget install transmission
/opt/bin/transmission-daemon -g /mnt/data/torrents/.config/transmission-daemon
killall transmission-daemon
wget http://www.3iii.dk/linux/optware/settings.json -O /mnt/data/torrents/.config/transmission-daemon/settings.json
/opt/bin/transmission-daemon -g /mnt/data/torrents/.config/transmission-daemon
Now you get web access to the Transmission page by going to http://192.168.1.1:9091. That is, if your routers IP is 192.168.1.1. You can also download the transmission remote GUI Link .

Download this Shutdown script and put it under /opt/etc and then add this to the Command text box here at http://192.168.1.1/Diagnostics.asp
Code:
chmod 777 /opt/etc/shutdown.sh
.
CHANGES IN DD-WRT v18777
----------------------------------------------
Select auto mount the in Services>USB tab on the front-end GUI
and to mount the 2nd partition use [now the ext3 module is pre-loaded and mount as same as proper linux distros have]
Code:
mount -t ext3 /dev/sda2 /mnt
So far VSFTP didn't work for me , so using the PROFTPD from the front-end GUI , rest remains same.
---------------------------------------------
Source
http://www.dd-wrt.ca...hp/Asus_RT-N13U
http://www.techencla...rts-191359.html
Special thanks to Dinjo @ Techenclave as he is the one who taught me the advanced stuffs
.