Asus RT-N13U

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 19:15, 3 February 2011 (edit)
Delta hd (Talk | contribs)
m (Flashing DD-WRT to a Stock Asus RT-N13U)
← Previous diff
Current revision (03:10, 25 February 2018) (edit) (undo)
Ian5142 (Talk | contribs)
(Added link to Where do I download firmware.)
 
(17 intermediate revisions not shown.)
Line 1: Line 1:
-The original hardware version (not B1, see Notes below) is now supported and quite stable.+There are two hardware versions of this router, the original <b>'v1'</b>, and the later <b>'B1'</b>. Both have stable DD-WRT releases available.
- +
-This device continues to be one of the lowest-cost (reported min $18 USD) wireless-N alternatives with USB connectivity, supporting: 
-*Network printer 
-*USB-connected HDDs and flash drives, ext2/ext3/FAT/FAT32/NTFS 
-*Second or multiple wireless LAN(s) 
-*Optware Light<b>*</b> 
-**Samba (FTP and file sharing) 
-**Transmission (torrent client) 
-**Asterisk (PBX, VoIP gateway) 
-**[[Quick list of Optware packages|Other Optware packages]] 
-*Sound card<b>*</b> (not yet functional; drivers needed) 
-<b>*</b>With attached USB flash device (and hub if any other connections) 
-  
-<u>Hardware Revision B1 Notes</u>:+By connecting a storage device, both can be fully self-contained; no more need for Internet access at bootup to load file system (FS) drivers. While this method requires some configuration (see [http://www.dd-wrt.com/wiki/index.php?title=Asus_RT-N13U#Mount_FS_by_Direct_Access_Method Mount FS by Direct Access Method]), third-party developers have now produced [http://www.dd-wrt.com/wiki/index.php?title=Asus_RT-N13U#Third-party_Developer_FW firmware] (FW) images <b>with</b> the FS drivers, including swap. Similar official releases are thought to be forthcoming, but the timeframe is unknown.
-*Current firmware images <b>will NOT work on hardware version B1!</b>+
-*Identify by "B1" clearly printed on bottom panel of router+
-*Want to see rev B1 unleashed with DD-WRT? <b>[http://www.dd-wrt.com/site/community/donations Donate a router!]</b>+
- +
-<b>For discussion or comments, see [http://www.dd-wrt.com/phpBB2/viewtopic.php?t=61734&postdays=0&postorder=asc&start=465 RT-N13U thread].</b> 
-  
-Many thanks to those who got DD-WRT working on the RT-N13U!+For wireless-N with USB, this router remains one of the best values. Besides the standard network printer and storage tasks, it can run Asterisk (PBX), host separate wireless LANs (WLANs), run many of the hundreds of [http://www.dd-wrt.com/wiki/index.php/Quick_list_of_Optware_packages Optware programs] including torrent clients such as Transmission, serve small websites, serve sound (Ex. to stereo) with inexpensive sound card attached, and it even scratches your back. (:^) These are covered in detail below. (Web cam on the horizon.)
- +
-== Device Specifications == 
-*Power Supply = 12VDC 1,0A 
-*Ethernet Ports = 1x WAN RJ-45 10/100 Base T, 4x LAN RJ-45 10/100 Base T 
-*Antennas = 3x internal antennas 
-*USB ports = 1x USB2.0 
-*Wireless standards supported: 802.11b (max. 11 Mbit/s), 802.11g (max. 54 Mbit/s), 802.11n (max. 300 Mbit/s, 2.4 GHz only) 
-*RAM = 32 MB (64 MB in rev B1) 
-*Flash = 4 MB (8 MB in rev B1) 
-*CPU = Ralink RT3052F clocked at 384 MHz 
-  
-== Flashing DD-WRT to a Stock Asus RT-N13U ==+[http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U%2C_page_2 Click here for <b>Page 2</b>] of this wiki.
-This procedure places the router in recovery mode, then uses Asus' Firmware Restoration utility to upload the DD-WRT image. Subsequent updates, if any, are much easier - you can then make direct webflash by Administration->FirmwareUpgrade usin only the 3.52Mb file named ''Asus-RTN13U-webflash.bin'' .+ 
- + 
 +==Overview Items==
 + 
 +===A Major Step Forward===
 +From the earliest FW releases, FS drivers have been absent. While no extra storage is ''required'' to run DD-WRT (there's a robust feature set as-installed), it's a must for Optware and many device-hosted programs and USB-connected hardware.
 + 
 +To help us all, gouryella brought the needed FS modules together, wrote the scripts, hosted everything on his website, and even made a guide (see [http://www.dd-wrt.com/wiki/index.php?title=Asus_RT-N13U#Automounting_ext3.2FFAT.2FFAT32.2FNTFS here] or [http://www.dd-wrt.com/phpBB2/viewtopic.php?p=454647#454647 in the thread]). (He's done similar for Optware, and his work is now also used in other routers.) Many thanks, gouryella.
 + 
 +With this method, the router downloads and installs the FS modules after each reboot; clearly some inherent shortcomings, but functional.
 + 
 +Now with the posting of [http://www.dd-wrt.com/wiki/index.php/Mounting_USB_drive_without_located_onboard_fs_modules Kirill's wiki] (thanks to viking13 for bringing it to the forum), there is another option, one that allows <b>FS drivers</b> to be <b>loaded directly from an attached drive</b>. (See [http://www.dd-wrt.com/wiki/index.php?title=Asus_RT-N13U#Mount_FS_by_Direct_Access_Method below].) Faster and more consistent reboots are reported, and <b>dependence on web connection is eliminated</b>. Many thanks, Kirill.
 + 
 +But perhaps eclipsing this accomplishment, grymster has succeeded in building a DD-WRT from source. He has also been so kind as to post his tools so that others can create custom builds (see [http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U#Third-party_Developer_FW Third-party Developer FW], below). Many thanks, grymster, and to amitg0123 also for the B1 build.
 + 
 + 
 +===Differences in Hardware===
 +The two versions differ primarily in the amount of flash memory and RAM onboard, the v1 at 4/32 and the B1 at 8/64 (MB flash/RAM).
 + 
 +There is also a small but significant difference in bootloaders which causes the two FW versions to be incompatible. Flashing the wrong one reportedly bricks the device. Take care when downloading!
 + 
 +===Support Threads===
 +Each hardware version has it's own support thread, the [http://www.dd-wrt.com/phpBB2/viewtopic.php?t=61734&postdays=0&postorder=asc&start=780 v1 here] and [http://www.dd-wrt.com/phpBB2/viewtopic.php?t=76472&postdays=0&postorder=asc&start=90 B1 here]. Please post any comments to the pertinent thread, [http://www.dd-wrt.com/phpBB2/viewtopic.php?t=61734&postdays=0&postorder=asc&start=780 the v1] as default.
 + 
 + 
 +===Firmware Repository===
 +Official releases are found [[Index:FAQ#Where_do_I_download_firmware.3F|from here]]. After selecting folder year and release number, carefully choose either 'Asus-RTN13' for v1, or 'Asus-RTN13UB1' for B1.
 + 
 +Each directory contains two files, a .trx for [http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U#Flashing_from_Stock_Asus_FW_to_DD-WRT first flash] (from stock), and a .bin for [http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U#Updating_DD-WRT later updates].
 + 
 +===Third-party Developer FW===
 +<b>For v1:</b> grymster has created and posted on [http://www.dd-wrt.com/phpBB2/viewtopic.php?p=633602#633602 this thread]. (Earlier post with some ensuing discussion is [http://www.dd-wrt.com/phpBB2/viewtopic.php?p=632053#632053 here]). grymster shares his tools for building the FW [http://www.dd-wrt.com/phpBB2/viewtopic.php?p=632360#632360 here].
 + 
 +<b>For B1:</b> amitg0123 has started and posted on [http://www.dd-wrt.com/phpBB2/viewtopic.php?p=632565 this thread]. (amitg0123 also started [http://www.dd-wrt.com/phpBB2/viewtopic.php?t=142711 a development thread] for information on building the FW.)
 + 
 +<u>Notes</u>:
 +* Must be logged in to see or download files.
 +* These are .trx files, which must be flashed using Asus Firmware Restoration Utility (AFRU).
 +*If DD-WRT is already installed, it is not possible to use the Firmware Upgrade tab under Administration in the web interface. (That input accepts only .bin files.) The router has to be placed in recovery mode, as for first flash (see [http://www.dd-wrt.com/wiki/index.php?title=Asus_RT-N13U&action=submit#Flashing_from_Stock_Asus_FW_to_DD-WRT below]), and the .trx file uploaded using AFRU.
 + 
 + 
 +===Which FW Image for Me?===
 +The good news is, there are now options! Those wanting to stay strictly with official releases should pick from the links [[Index:FAQ#Where_do_I_download_firmware.3F|here]].
 +*To access USB-attached storage devices, router must be configured to load FS drivers, either by download on each restart, or by direct access to a prepared drive (see [http://www.dd-wrt.com/wiki/index.php?title=Asus_RT-N13U#Mount_FS_by_Direct_Access_Method Mount FS by Direct Access Method]).
 +*There is no swap, and no way to add it since it must be built into the kernel. And there is no indication that swap will ever be included in future official releases. (This is a consideration only if running memory-hungry programs (Ex. Transmission).
 + 
 +The more adventurous may consider [http://www.dd-wrt.com/phpBB2/viewtopic.php?p=633602#633602 grymster's] or [http://www.dd-wrt.com/phpBB2/viewtopic.php?p=632565 amitg0123's] FW. Notes:
 +*Third-party so some (small) risk.
 +*FS drivers are built-in so no need for extra configuration work.
 +*Swap is included, available if needed.
 +*Current v1 build has some parts removed, notably support for IPv6, USB serial and printing, and 3G drivers for Sierra and Option cards.
 + 
 +==Flashing from Stock Asus FW to DD-WRT==
 +This procedure places the router in recovery mode, then uses AFRU to upload the DD-WRT (official or third-party) .trx file. Subsequent updates, if any, are much easier (see [http://www.dd-wrt.com/wiki/index.php?title=Asus_RT-N13U#Updating_DD-WRT Updating DD-WRT])
 + 
<b>1. Preparation for Initial DD-WRT Install</b> <b>1. Preparation for Initial DD-WRT Install</b>
-NB: this operation is made only once, to convert the Asus loader into a DD-WRT loader.+:1. Download desired DD-WRT FW file
-:1. Download latest DD-WRT Firmware Image+:*Read the above and select file desired. Be absolutely sure it is right one, v1 vs B1.
-:*Browse to [ftp://www.dd-wrt.com/others/eko/BrainSlayer-V24-preSP2/ firmware repository] and select/open most current directory, Ex. 12-24-10-r15962/+:*Be sure file is '.trx' (.bin files are for updates only, for use only after DD-WRT is installed).
-:*Open 'Asus-RTN13U' directory and download 'asus-to-ddwrt.trx'+
-:2. Download latest version of the Asus Utility+:2. Download latest version of the Asus Firmware Restoration Utility
-:*Browse to http://support.asus.com/download+:*From a Windows machine, Browse to http://support.asus.com/download
-:*In the three dropdown menus, select 'Wireless', 'AP/Router', 'RT-N13U', and click 'Search'+:*Navigate to device model number, -N13U or -N13U-B1
-:*Select OS in popup menu+:*Select OS
-:*Click '+' next to 'Utilities' and skip down to the most current non-B1 version, now 4.0.6.3 dated 2010/01/06. In that box, click 'Global' and save the UT_RT_N13U_4063.zip file. (Also see next step, download firmware.)+:*Click '+' next to 'Utilities', select version and download
-:*Within that zip file, navigate to the UT4063/Utility folder and run 'setup' to install.+:*Within the zip file, navigate to the */Utility folder and run 'setup' to install AFRU.
-:*Be sure there is access to the Firmware Restoration utility+:*Be sure AFRU can be started with no problems
-:3. Download safety copy of Asus firmware+:3. Download safety copy of Asus firmware (optional)
-:*Do same as previous step, except click '+' next to 'Firmware' and download latest non-B1 version, now 1.0.2.0 dated 2010/01/06.+:*Do same as previous step, except click '+' next to 'Firmware' and download desired version.
:*Note that this file should not be needed; use only to restore Asus FW to router if later desired. :*Note that this file should not be needed; use only to restore Asus FW to router if later desired.
Line 66: Line 88:
:*On PC, disable any firewall (Ex. Windows Firewall) :*On PC, disable any firewall (Ex. Windows Firewall)
:*Optional: Set PC to use a static IP, Ex. 192.168.1.2, netmask 255.255.255.0, gateway 192.168.1.1 :*Optional: Set PC to use a static IP, Ex. 192.168.1.2, netmask 255.255.255.0, gateway 192.168.1.1
-:*If possible, use uninterruptable power supply (UPS) for both PC and router. A power failure while flashing, though not likely, will probably brick the router.+:*If possible, use uninterruptible power supply (UPS) for both PC and router. A power failure while flashing, though not likely, will probably brick the router.
-:*Note: Early on, some had problems using Firefox. Consider using Internet Explorer or Chrome.+:*Last check: Flashing a v1 FW to a B1 device will brick it, and vica versa. Be sure the FW file that is about to be flashed is the correct one for the device.
-:*Final warning: Installing this firmware on a B1 version will brick the device. (See note at top of page.)+ 
<b>2. Flash to DD-WRT</b> <b>2. Flash to DD-WRT</b>
:1. Place router in Recovery mode :1. Place router in Recovery mode
-:*Disconnect power adapter plug from the RT-N13U+:*Disconnect power adapter plug from router
:*Push and hold the Restore button located on bottom panel. While continuing to hold down the Restore button, plug the power adapter back into router. :*Push and hold the Restore button located on bottom panel. While continuing to hold down the Restore button, plug the power adapter back into router.
:*After five seconds, LED on front panel starts to blink, release the button. :*After five seconds, LED on front panel starts to blink, release the button.
:2. Upload firmware image :2. Upload firmware image
-:*On PC, open Asus' Firmware Restoration utility (installed earlier)+:*On PC, open AFRU (installed earlier)
:*In Firmware Restoration window, click 'Browse' and select the DD-WRT image file, asus-to-ddwrt.trx (downloaded earlier) :*In Firmware Restoration window, click 'Browse' and select the DD-WRT image file, asus-to-ddwrt.trx (downloaded earlier)
:*Click 'Upload' to begin flash process that can take up to four minutes. Brick warning: Do not interrupt! :*Click 'Upload' to begin flash process that can take up to four minutes. Brick warning: Do not interrupt!
-:*When message that router is rebooting appears, close Firmware Restoration utility.+:*When message that router is rebooting appears, close AFRU window.
 + 
<b>3. Reboot, launch DD-WRT web interface, and cleanup</b> <b>3. Reboot, launch DD-WRT web interface, and cleanup</b>
-*After a minute or two, disconnect power adapter plug from the RT-N13U+*After a minute or two, disconnect power adapter plug and leave for at least 10 seconds
-*Wait at least ten seconds, then reconnect to power+*If optional step of setting static IP was followed earlier, can now reset to automatic
-*If optional step of setting static IP was followed earlier, can reset to automatic+*Connect WAN port then reconnect power plug
*Browse to 192.168.1.1 should bring up the DD-WRT web interface; set name/password for first access *Browse to 192.168.1.1 should bring up the DD-WRT web interface; set name/password for first access
-*Configure router as desired. Default connection is DHCP; for DSL check [[DSL with DD-WRT]].+*Configure router as desired. Default connection is DHCP; for DSL check [http://www.dd-wrt.com/wiki/index.php/DSL_with_DD-WRT DSL with DD-WRT.].
*When satisfied that factory firmware will not be used again, uninstall Asus Utility from PC and delete Asus files. *When satisfied that factory firmware will not be used again, uninstall Asus Utility from PC and delete Asus files.
-== Automounting ext3/FAT/FAT32/NTFS == 
-The following tutorial is provided primarily by gouryella (taken from http://www.dd-wrt.com/phpBB2/viewtopic.php?p=454647#454647), also by calvin18 and others of the community.+==Updating DD-WRT==
 +This task is straightforward enough that it needs nearly no instruction.
 +#Backup any scripts, files or settings that are intended for reuse.
 +#Select and download the correct DD-WRT binary file, .bin, from [ftp://ftp.dd-wrt.com/others/eko/BrainSlayer-V24-preSP2/ the repository] (see [http://www.dd-wrt.com/wiki/index.php?title=Asus_RT-N13U#Firmware_Repository Firmware Repository], above)
 +#In the DD-WRT web interface, navigate to Administration | Firmware Upgrade tab, click 'Browse', select the downloaded .bin file, and click 'Restore'.
 +#After restart, restore any backups as desired.
 + 
 +==Mounting File System for External Storage==
 +To access USB-attached storage devices, the router must be configured to load FS drivers, either by download on each restart (Download Method) or by direct access to a prepared drive (Direct Access Method). This does not apply to [http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U#Third-party_Developer_FW third-party developer FW], which has the FS drivers built-in. If not using the router's file system or running Optware, this section can be skipped.
 + 
 + 
 +It is helpful to know that <b>Optware must be installed to an ext*-formatted (typically ext3) partition</b>. Because one part of the drive must be ext*, the reasoning goes, it is most efficient to make it all the same, as each FS mounted consumes more RAM. (This is more of a concern in the v1 version, depending on what other loads are applied.) That noted, it is possible to mount multiple partitions by simply insmodding the corresponding modules (see step 9 under Direct Access Method).
 + 
 + 
 +Other considerations in planning <b>network storage strategy</b>:
 +* Transfer speeds through the router are limited to <b>2 - 2.5 MB/sec</b>. (This is a common limitation; not peculiar to this device.)
 +* Any drive with a USB interface can be attached to the router. Any active (powered) drive must have it's own power supply. (Flash drives are passive, not powered, so they can be plugged in directly.)
 +* Any drive attached to the router can be used for network storage by any and all clients on the LAN regardless of client OS (Windows, OSX, Android, etc.).
 +* Any (ext3-formatted) drive can be used for Optware installation. However, that drive must remain 'permanently' attached to the router.
 +* Multiple 'drives' can be attached by using a USB hub or combo card reader/USB hub. <b>Note:</b> Some report that in a multi-drive environment, drives will not auto-mount on router reset. (Each's USB plug must be manually re-inserted after a restart; then it can be mounted.)
 +* Flash drives should not be used for swap or they will quickly be ruined.
 +* Portable HDDs formatted ext3 for occasional attachment to the router can be used on Windows clients by installing either [http://www.chrysocome.net/explore2fs explore2fs] or [http://www.diskinternals.com/linux-reader/ linux-reader].
 + 
 + 
 +To do this setup, <b>access by terminal interface is needed</b>, either Telnet or SSH. If unfamiliar with these, see the [http://www.dd-wrt.com/wiki/index.php/Telnet/SSH_and_the_command_line Telnet/SSH tutorial].
 + 
 + 
 +<b>The Direct Access Method is preferred</b> as it does not not depend on an Internet connection, a distant server, and the presence and integrity of the driver file itself. The Download Method does have these dependencies, though it can be useful as a backup in (expectedly rare) situations (Ex. the local drive has failed or been removed). Normally either one method or the other is applied, then all forgotten about.
 + 
 + 
 +===Mount FS by Direct Access Method===
 +<u>Overview</u><br>
 +All official FW releases contain drivers for low-level access to USB storage devices. For direct access to work, the drive (typically SD card or flash drive) must be prepared with a special partition (typically small, 1~3 MB) in a memory-like format. (Note this does not convey any additional burden because this partition is never mounted.) The FS driver archive is then block-copied to it and the startup script modified to load the drivers automatically.
 + 
 + 
 +<b>1. Have Disk On Hand</b><br>
 +If already connected to router, power down both disk and router, wait a few seconds then disconnect disk.
 + 
 + 
 +<b>2. Connect Disk to PC</b><br>
 +*If disk is powered type, connect USB first, then power cable.
 +*If SD card or flash drive, just plug in.
 +*Caution: Never unplug a flash memory device without first unmounting or removing power from host.
 + 
 + 
 +<b>3. Create Disk Backup</b><br>
 +*If disk contains useful data, backup data before proceeding.
 + 
 + 
 +<b>4. Choose a Format Method</b><br>
 +*Must have access to linux; 'dd' command is needed for block transfer.
 +*Windows users can run a live CD without altering host PC.
 +*Gparted is one of the most reliable; see [http://gparted.sourceforge.net/livecd.php Gparted live CD].
 +*Gparted is also available on [http://www.ubuntu.com/download/ubuntu/download Ubuntu live CD].
 +*May also refer to [http://www.dd-wrt.com/wiki/index.php/Mounting_USB_drive_without_located_onboard_fs_modules Kirill's wiki] for using fdisk (linux) or [http://www.dd-wrt.com/wiki/index.php/How_to_-_Format_and_Partition_External_Storage_Device Format and Partition wiki].
 + 
 + 
 +<b>5. Create (or Edit) Partitions</b><br>
 +*Note: Existing ext* partitions (and a few other types) can be moved with no data loss (if sufficient space available) to make room for the tiny new one.
 +*Instructions for a typical installation, short version:
 +:*Make the first primary partition type ext3
 +:*Include all but the smallest partition size allowed (usually 1-3 MB) in the first primary partition
 +:*Make the second primary partition the remainder of the disk (usually the leftover 1-3 MB)
 +*Instructions under Windows, detailed version:
 +:#Download the selected .iso image (Gparted or Ubuntu) from step 4. (The Gparted live CD actually loads Ubuntu, then calls Gparted on bootup.) Ubuntu 10.10 .iso is assumed.
 +:#Burn the .iso to CD and reboot to that disk (In Windows, strike F8 during restart and select that option.)
 +:#Tip: When asked about keyboard driver, accept the default option.
 +:#In Gparted (in Ubuntu: System | Administration | Gparted Patition Editor), select connected USB device (Caution!), click Partition | Unmount, Partition | Delete, Edit | Apply All Operations (or green checkmark), Device | Create Partition Table | Apply, and click on new, unallocated partition table to select.
 +:#Continuing, click Partition | New, then for 'File System' pick ext3. Click the down arrow next to 'New Size (MiB)' one time. (This will leave space for the smallest allowable partition for direct access.) Click 'Add'.
 +:#In table, click to select unallocated 1.00 MiB partition, Partition | New, then for 'File System' select 'unformatted', Add.
 +:#Table should display only the two newly-created partitions and none unallocated. Click Edit | Apply All Operations (or green checkmark), Apply.
 +:#When done, view as-written partition table; exit Gparted.
 +:#Open command shell window, Applications | Accessories | Terminal
 +:#If drive was unmounted earlier, unplug USB connection. (If any doubt, shutdown PC, then unplug.)
 +:Tip: If running Ubuntu live CD, before removing, partition one of PC's disks, install and try out. Many consider Ubuntu superior to Windows.
 + 
 + 
 +<b>6. Preformat Direct Access Partition</b><br>
 +*Re-connect USB drive to PC
 +*In linux terminal, verify drive is mounted:
 + df -h
 + mount
 +:The last line of output of each of these commands should contain the reference to the first partition. Ex:
 + /dev/sdb1 241M 6.1M 222M 3% /media/b564adc7-53c4-482d-a296-8391af52fe3b
 + /dev/sdb1 on /media/b564adc7-53c4-482d-a296-8391af52fe3b type ext3 (rw,nosuid,nodev,uhelper=udisks)
 +:Note name is /dev/sdb1; format is ext3. Second partition (the unformatted one) is then /dev/sdb2 (not shown).
 +:If any doubt, check and be sure. All data will be eliminated from /dev/sdb2 (in this example).
 +*Preformat the small partition:
 + sudo dd if=/dev/zero of=/dev/sdb2
 + 
 + 
 +<b>7. Download FS Driver File</b><br>
 +*Still in linux terminal, copy mount point from earlier output and paste with cd command, followed by download of driver file:
 + cd /media/b564adc7-53c4-482d-a296-8391af52fe3b
 + sudo wget http://home.karneval.cz/10102207/fs.gz
 +:This places a copy of the driver file temporarily in the first partition. Block transfer it now to the second for direct access:
 + sudo dd if=fs.gz of=/dev/sdb2
 + 
 + 
 +<b>8. Prepare Optware Partition and Unmount</b><br>
 +Skip this step if only modifying an existing drive for direct access and with Optware already installed. (Unmount only.)
 +*Note that Optware will not install unless partition is completely empty. Still in Linux terminal:
 + sudo rm fs.gz
 + sudo rmdir lost+found
 +*Drive is now ready to receive Optware. Unmount before disconnecting USB:
 + umount /dev/sdb1
 +:Done with linux terminal.
 + 
 + 
 +<b>9. Update Settings in Web Interface</b><br>
 +*Login to router (from browser) and navigate to Services | USB tab. Enable each of the following:
 +:*Core USB Support
 +:*USB 2.0 Support
 +:*USB Storage Support
 +:*Automatic Drive Mount
 +:Click 'Apply Settings'
 +*Plug pre-formatted USB drive into router
 +*Head to Administration | Commands tab and paste in window:
 + sleep 15
 + cd /tmp/var/tmp
 + tar -zxvf /dev/scsi/host0/bus0/target0/lun0/part2
 + insmod jbd.ko
 + insmod mbcache.ko
 + insmod ext3.ko
 + rm /tmp/var/tmp/*.ko
 + sleep 10
 + mount -t ext3 -o noatime,nodiratime /dev/scsi/host0/bus0/target0/lun0/part1 /opt
 +:Click 'Save Startup'. This should work as written if partitioned per examples and only one disk; skip to 10.
 +*Other cases
 +:*If other drives are attached or there are extra partitions on the drive, '/dev/scsi/host0/bus0/target0/lun0/partX' may not work. In this case, determine correct partition string(s) and replace in the above (both 'tar' and 'mount' lines). Hint: Attach drives one-at-a-time while monitoring the output of:
 + dmesg
 +::(which can be entered at command line or in same Commands window (Administration | Commands tab), except pressing 'Run Commands' button).
 +:*For each additional file system needed, append insmod lines (just above 'rm' line) as required:
 +::*For FAT/FAT32
 +:::*fat.ko
 +:::*vfat.ko
 +:::*nls_iso8859-1.ko
 +:::*nls_cp437.ko
 +::*For NTFS
 +:::*fuse.ko
 +:*Also append similar 'mount' lines, but with 'ext3' replaced by file type, 'vfat' or 'ntfs-3g'.
 +:*Of course, if ext3 format is not used, delete those three 'insmod' lines (jbd.ko, mbcache.ko, and ext3.ko).
 +:*In general, if the modules are inserted then the drive plugged in, the drive should be recognized and its device string should appear in <i>dmesg</i> output.
 + 
 + 
 +<b>10. Reboot and Check</b><br>
 +*Reboot router, soft (Administration | Management tab, Reboot Router button) or hard (pull power adapter plug, wait at leat 10 seconds, plug back in).
 +*Verify drive mounting:
 +:*At command line or in Commands window (Administration | Commands tab), enter:
 + mount
 +::(and hit 'Run Commands' button). Drive should show up on /opt, Ex:
 + /dev/scsi/host0/bus0/target0/lun0/part1
 + 3.6G 419.8M 3.0G 12% /opt
 +*Now ready to install Optware.
 + 
 + 
 +===Mount FS by Download Method===
 + 
 +The next subheading describes the download method, but remains under its original title, "Automounting ext3/FAT/FAT32/NTFS" to keep from breaking any links to it.
 + 
 +If Direct Access method was applied, jump to [http://www.dd-wrt.com/wiki/index.php?title=Asus_RT-N13U#Installing_Optware_Light Installing Optware Light].
 + 
 + 
 +=== Automounting ext3/FAT/FAT32/NTFS ===
 +The following tutorial is from [http://www.dd-wrt.com/phpBB2/viewtopic.php?p=454647#454647 gouryella's guide], which will always have the most up-to-date information. (It is linked from the [http://www.dd-wrt.com/wiki/index.php/Supported_Devices Supported Devices Page].)
 + 
 + 
The RT-N13U has only 4 MB flash, which is almost full with DD-WRT installed. Ext3 needs an extra 200 KB of storage, and the driver is not present in the DD-WRT firmware yet [BrS]. The RT-N13U has only 4 MB flash, which is almost full with DD-WRT installed. Ext3 needs an extra 200 KB of storage, and the driver is not present in the DD-WRT firmware yet [BrS].
Gouryella wrote a smart script that downloads the ext3 driver and mounts the 1st partition to /opt during boot (after WAN is up) Gouryella wrote a smart script that downloads the ext3 driver and mounts the 1st partition to /opt during boot (after WAN is up)
Line 136: Line 324:
== Installing Optware Light == == Installing Optware Light ==
 +This tutorial is also from [http://www.dd-wrt.com/phpBB2/viewtopic.php?p=454647#454647 gouryella's guide] (see steps 4 - 6).
-The following tutorial is provided by gouryella (taken from http://www.dd-wrt.com/phpBB2/viewtopic.php?p=454647#454647) 
'''1. Installing Optware (only to an ext3 partition; /opt MUST be empty)''' '''1. Installing Optware (only to an ext3 partition; /opt MUST be empty)'''
Line 160: Line 348:
web: http://192.168.1.1:8080 web: http://192.168.1.1:8080
ftp: ftp://192.168.1.1 ftp: ftp://192.168.1.1
- pxe: add: dhcp-boot=pxelinux.0,dw-wrt,192.168.1.1 to Services -> Services -> Additional DNSMasq Options+ pxe: add: dhcp-boot=pxelinux.0,dd-wrt,192.168.1.1 to Services -> Services -> Additional DNSMasq Options
''' 1.3 Open to the world (paste to Administrations -> Commands and Save Firewall)''' ''' 1.3 Open to the world (paste to Administrations -> Commands and Save Firewall)'''
iptables -t nat -I PREROUTING -p tcp -d $(nvram get wan_ipaddr) --dport 80 -j DNAT --to 192.168.1.1:8080 iptables -t nat -I PREROUTING -p tcp -d $(nvram get wan_ipaddr) --dport 80 -j DNAT --to 192.168.1.1:8080
Line 169: Line 357:
iptables -I INPUT -p tcp -d 192.168.1.1 --dport 21 -j logaccept iptables -I INPUT -p tcp -d 192.168.1.1 --dport 21 -j logaccept
-== Installing a Transmission-daemon onto Asus RT-N13U == 
-I have just successfully installed and running this Transmission Torrent thingy +== Installing a Transmission-daemon onto Asus RT-N13U ==
 +See [http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U%2C_page_2#Installing_a_Transmission-daemon_onto_Asus_RT-N13U Installing a Transmission-daemon onto Asus RT-N13U] on page 2.
-and thanks to "Gouryella" for showing us the light 
-adopted with slight Modification from [[Transmission daemon]] kudos to anonymous code-angels--[[User:Capper|Capper]] 22:07, 25 August 2010 (CEST)+== Installing a Network Printer onto Asus RT-N13U ==
 +See [http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U%2C_page_2#Installing_a_Network_Printer_onto_Asus_RT-N13U Installing a Network Printer onto Asus RT-N13U] on page 2.
-''' 1. Make the following folders''' 
- cd /opt 
- mkdir -p /opt/data/torrents/.config # -p to make directories at the same time 
-The plan is to have everything torrent go to the folder /opt/data/torrents 
- 
-'''2. Install Optware Transmission''' 
- 
- /opt/bin/ipkg-opt -verbose_wget install transmission 
- 
-:Note: I like to see the progress of the downloading process, so I know the right thing is happening. This is done with the -verbose_wget parameter. 
- 
- 
-'''3. Started and stopped Transmission to get the basic work folders''' 
- 
- /opt/bin/transmission-daemon -g /opt/data/torrents/.config/transmission-daemon 
- killall transmission-daemon 
- 
-With the command above you get the basic folder structure of: 
- 
- /opt/data/torrents/.config/ 
- /opt/data/torrents/.config/transmission-daemon 
- /opt/data/torrents/.config/transmission-daemon/settings.json #file 
- /opt/data/torrents/.config/transmission-daemon/blocklists  
- /opt/data/torrents/.config/transmission-daemon/resume  
- /opt/data/torrents/.config/transmission-daemon/torrents 
- 
- 
-'''4. Edit ''settings.json'' ''' 
- 
- nano /opt/data/torrents/.config/transmission-daemon/settings.json 
- 
-'''5. Delete contents of ''settings.json'' and copy-paste following code into it.''' 
- 
- { 
- "blocklist-enabled": 1, 
- "download-dir": "\/opt\/data\/torrents", 
- "download-limit": 100, 
- "download-limit-enabled": 1, 
- "encryption": 2, 
- "max-peers-global": 35, 
- "peer-port": 25000, 
- "pex-enabled": 1, 
- "port-forwarding-enabled": 1, 
- "rpc-authentication-required": 0, 
- "rpc-password": "", 
- "rpc-port": 9091, 
- "rpc-username": "", 
- "rpc-whitelist": "192.168.1.*", 
- "upload-limit": 200, 
- "upload-limit-enabled": 1 
- } 
- 
-The file ''settings.json'' can also be downloaded from here (the wget command is one line): 
- <nowiki> wget http://www.3iii.dk/linux/optware/settings.json -O /opt/data/torrents/.config/transmission-daemon/settings.json</nowiki>  
- 
-but change to "download-dir": "\/opt\/data\/torrents", from "download-dir": "\/mnt\/data\/torrents", 
- 
-'''6. Open listening port for WAN access''' 
- 
-Go to your DD-WRT control panel and add the following to Administration - Commands - Firewall 
- 
- iptables -t nat -I PREROUTING -p tcp -d $(nvram get wan_ipaddr) --dport 25000 -j DNAT --to 192.168.1.1:25000  
- iptables -I INPUT -p tcp -d 192.168.1.1 --dport 25000 -j logaccept 
- 
-You may change the value 25000 to whatever port you specified in the settings.json file for the value "peer-port" 
- 
-'''7. Restart transmission''' 
- 
- /opt/bin/transmission-daemon -g /opt/data/torrents/.config/transmission-daemon 
- 
- 
-'''8. Accessing Transmission web interface''' 
- 
-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 
- 
- 
-'''9. Autorun Transmission-daemon every time router reboot''' 
- 
-I would not like to go to command shell and type to start the Daemon. so here is the autostart for couch potatoes like me. 
-  
- cd /opt/etc/init.d 
- rm S99trans 
-This will remove old S99trans initializing file you might have in the directory . We will now create an autorun script for our Transmission-Daemon 
-  
- nano S99trans 
-now type-in following lines in it 
- 
- sleep 120 
- /opt/bin/transmission-daemon -g /opt/data/torrents/.config/transmission-daemon 
-Save it by presseing CTRL+O followed by CTRL+X , now we will Make it executable by... 
- 
- chmod +x /opt/etc/init.d/S99trans 
-You are done. Enjoy downloadig sans PC. 
- 
-'''10. How to get transmission to download torrent files?''' 
- 
- - In a web browser go to your favourite torrent site/tracker and download a "<myfile>.torrent" file 
- - In a web browser go to 192.168.1.1:9091 to enter the Transmission web page. 
- - click "open" 
- - click the text field (or "select" button) 
- - point out the "<myfile>.torrent" 
- - click "upload" 
-  
- and the torrent'ed file should start downloading shortly. 
- 
- 
-The downloaded file will turn up in the '''/opt/data/torrents''' folder. 
- 
-The full space of the file will be reserved from the start, so in a FTP, WinSCP or Explorer via Samba it may seem like the file is all there immediately, but it is not! It is fully downloaded when the line turns green in the Transmission web interface at ''192.168.1.1:9091''. 
- 
-You can see details about any of the torrent files by clicking the Inspector button on the right in the Transmission web interface. 
- 
- 
-'''11. Another interface option''' 
- 
-You might also want to check out a front-end (remote-GUI) for the rpc version of transmission.<br> 
- 
-transmission-remote-gui is an application written in Free Pascal to remotely manage Transmission 
-See: http://code.google.com/p/transmisson-remote-gui 
- 
-transmission-remote-dotnet is a .NET application written in C# to remotely manage Transmission.  
-See: http://code.google.com/p/transmission-remote-dotnet/ 
- 
-"Try the latest one (beta is welcomed over here)" 
-  
- 
-== Installing a Network Printer onto Asus RT-N13U == 
-As of v24-PreSp2 (first versions to work on Asus RT-N13U) jffs was removed due to the lack of space available. However, Brainslayer put the support of network printing onto the firmware, enabling use of a network printer. Special Thanks for TimeKiller for figuring out most of the solution. 
- 
-'''1.''' First enable USB support 
- 
-Enable the following under Services -> USB: 
- 
- Core USB Support 
- USB 1.1 Support (UHCI) 
- USB 1.1 Support (OHCI) 
- USB 2.0 Support 
- USB Printer Support 
- 
-'''2.''' Startup Settings 
- 
-Go to Administrations -> Commands, and add this: 
- 
- sleep 4 
- mkdir -m 755 -p /dev/usb 
- mknod -m 660 /dev/usb/lp0 c 180 0 
- /usr/sbin/p910nd -f /dev/usb/lp0 1  
- 
-Save on the Startup. 
- 
-'''3.''' Reboot and Install Drivers 
- 
-Reboot the router, then install drivers through tcp/ip (9101) 
- 
-For Windows 7: 
- Go to Devices and Printers 
- Then, press Add a Printer 
- Got to Network Printers 
- Skip the detection, as Windows will not find anything 
- Go to "Add a printer using a tcp/ip address or hostname" 
- Device type: Autodetect 
- Hostname and ip address: your router's ip (default 192.168.1.1) 
- Port Name: Anything (puts your router's ip by default) 
- After it says it could not detect a printer, select custom, then Advanced 
- Make sure the protocol is RAW and change the Port Number is 9101 
- Install your drivers and finish. 
- 
-You should print a test page to see if it works. 
- 
-'''4.''' Troubleshooting 
-If the test page does not come, try these settings instead: 
- 
-Go to Administrations -> Commands, and add this: 
- 
- sleep 4 
- chmod +rwx /usr/sbin/p910nd  
- mkdir -m 755 -p /dev/usb 
- mknod -m 660 /dev/usb/lp0 c 180 0 
- chmod +rwx /dev/usb/lp0 
- /usr/sbin/p910nd -b -f /dev/usb/lp0 0  
- 
-Save again on the Startup. 
-Reboot 
-then follow the steps above but instead of port 9101, put in 9100. 
-You should print a test page again to see if it works. 
-If it doesn't work, you somehow did not follow the instructions correctly. 
-  
== Fire up a Second Wireless Network w/ Optional Bandwidth Throttling == == Fire up a Second Wireless Network w/ Optional Bandwidth Throttling ==
-A second (or even third) wireless network is useful for sharing the router's Internet connection. The new wireless network(s) is easily configurable:+See [http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U%2C_page_2#Fire_up_a_Second_Wireless_Network_w.2F_Optional_Bandwidth_Throttling Fire up a Second Wireless Network w/ Optional Bandwidth Throttling] on page 2.
-*Secure or open (hotspot)+
-*Complete or partial isolation from the main network+
-*Amount of bandwidth alloted+
-All setup is done in the DD-WRT web interface. (The following instructions should work for other Ralink-based routers as well.)+
- +
-Browse to the router's home page and login, then: 
-  
-'''1. Create Virtual Interface for New Wireless Network'''+== Sound Card ==
 +See [http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U%2C_page_2#Sound_Card Sound Card] on page 2.
-On Wireless | Basic Settings page, under 'Virtual Interfaces' click <b>Add</b> 
-*Key second SSID, the 'Wireless Network Name' preferred, Ex. BobNet, YoHotspot. 
-*Check that 'Wireless SSID Broadcast' is <b>Enable</b> 
-*Set 'AP Isolation' as preferred: <b>Enable</b> (default) for client-to-client communication on the new wireless network, <b>Disable</b> to isolate each. 
-*Set 'Network Configuration' to <b>Bridged</b> 
-*Be sure 'Wireless Mode' at top of page is set to <b>AP</b> (Access Point) 
-*Click <b>Apply Settings</b>. 
-  
-'''2. Set Security for New Wireless Interface'''+== DLNA/UPnP Media Servers ==
 +See [http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U%2C_page_2#DLNA.2FUPnP_Media_Servers DLNA/UPnP Media Servers] on page 2.
-On the Wireless | Wireless Security page, under 'Virtual Interfaces ra1 SSID...' ("ra1" is the new wireless interface just created in step 1.), set parameters as desired for security. These setting work exactly the same as for the router's physical interface (shown at top of page), but apply only to the new wireless network. 
-*For public access/hotspot, 'Security Mode' would be <b>Disable</b>. 
-*A shared secure network would normally use <b>WPA2</b> and <b>AES</b>. 
-*When done, click <b>Save</b>. 
-  
-'''3. Create Bridge for New Wireless Interface'''+== Device Specifications ==
 +See [http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U%2C_page_2#Device_Specifications Device Specifications] on page 2.
-On the Setup | Networking page, under 'Bridging' click <b>Add</b>. 
-*In leftmost (unlabled) field that pops up, key "<b>br1</b>" (without quotes), 
-*Set 'STP' to <b>Off</b>, and 
-*Leave 'Prio' (Priority) and MTU as they are. Click <b>Save</b>. 
-*New fields will appear for 'IP Address' and 'Subnet Mask'. Populate these (Typical values might be 192.168.<b>16</b>.1 and 255.255.255.0, used in following examples.) and click <b>Save</b>. 
-*Reboot. 
-  
-'''4. Assign New Wireless Interface to New Bridge'''+----
- +== Authors ==
-Still on Setup | Networking page, under 'Assign to Bridge' click <b>Add</b>. On Assignment line that appears:+See [http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U%2C_page_2#Authors Authors] on page 2.
-*Select '<b>br1</b>' in dropdown menu,+
-*Pick '<b>ra1</b>' in second dropdown menu (labled 'Interface'),+
-*Set priority, 'Prio', as desired. Higher number = lower priority. The corresponding priority numbers (under 'Create Bridge' and 'Assign to Bridge') should be similar. Ex. 32768 and 32760.+
-*Click <b>Save</b> and reboot.+
-*Check in 'Current Bridging Table' that ra1 interface is assigned to br1 (they appear on same line). If not, edit any bad entries, possibly Delete and re-key, <b>Save</b>, reboot, and repeat this step.+
- +
- +
-'''5. Enable DNSMasq as Sole DHCP Server'''+
- +
-This has the added benefit of running the router more efficiently*. On Setup | Basic Setup page, see that:+
-*'DHCP Type' is <b>DHCP Server</b>+
-*'DHCP Server' is <b>Enable</b>+
-*'Use DNSMasq for DHCP' is <b>checked</b>+
-*'Use DNSMasq for DNS' is <b>checked</b>+
- +
-On Services | Services page, set:+
-*'Used Domain' to '<b>LAN & WLAN</b>"+
-*'LAN Domain' to some name (Ex. <b>mylan</b>, yourlan, lan1, alan etc.)+
-*'DNSMasq' to <b>Enable</b>+
-*'Local DNS' to <b>Enable</b>+
-*In 'Additional DNSMasq Options' window, paste the following:+
- local=/mylan/ +
- expand-hosts+
- interface=br1+
- dhcp-range=br1,192.168.16.100,192.168.16.120,255.255.255.0,1440m+
-*Edit the above pasted text to customize as needed:+
-**Replace "mylan" with the name chosen for 'LAN Domain' if different; these must match.+
-**Edit the "120" -- which allows 20 clients to connect simultaneously -- as desired.+
-**Edit both occurences of "192.168.16." to match the address keyed in 'Create Bridge for New Wireless Interface', above.+
-*Click <b>Save</b> and reboot.+
- +
- *(For details, see [[DNSMasq as DHCP server#DNSMasq DHCP Parameters|DNSMasq page]].)+
- +
- +
-'''6. Set Level of Isolation for New Wireless Network'''+
- +
-Unless the new network is secure and all connected clients trusted, some isolation is needed.+
-*The easiest setup completely isolates the new network -- its clients have full access to the Internet, but not to the router or its wired or wireless clients. On the Administration | Commands page, under 'Command Shell', paste the following into the 'Commands' window:+
- iptables -I FORWARD -i br1 -o br0 -j DROP+
- iptables -I INPUT -s 192.168.16.0/24 -d 192.168.1.0/24 -j DROP+
-*As above, edit the subnet addresses, 192.168.16 and 192.168.1, if customized. Click <b>Run Commands</b> and test/verify that everything works as expected. All pings or other attempts to connect between the two subnets should fail. Reboot if any problems.+
-*When satisfied, with final iptables rules in 'Commands' window, click <b>Save Firewall</b>. Note: A click of this button with bad rules showing can lock everyone out of the router, necessitating a hard reset (and loss of all custom settings). Do not skip the previous test step.+
-*If instead of total isolation it is desired to grant partial access to new networks' clients, determine which rules to modify and use (Ex. below), test and save as above.+
- iptables -I INPUT -i br1 -p tcp --dport www -j REJECT+
- iptables -I INPUT -i br1 -p tcp --dport telnet -j REJECT+
- iptables -I INPUT -i br1 -p tcp --dport ssh -j REJECT+
- iptables -I INPUT -i br1 -p tcp --dport https -j REJECT+
- +
-<br>+
-'''7. Set Bandwidth Limits on New WLAN (Optional)'''+
- +
-The maximum bandwidth taken by the new wireless network can be limited by following these steps. New WLAN clients will otherwise compete for bandwidth on equal footing with those on the main network.+
-*Navigate to one or more speed test sites (Ex. [http://www.speakeasy.net Speakeasy]) and note maximum Up- and Down-link speeds.+
-*On NAT/QoS | QoS page, enable QoS ('Start QoS' <b>Enable</b>) and check that 'Port' is <b>WAN</b> and 'Packet Scheduler' is <b>HTB</b>.+
-*In 'Uplink' and 'Donwlink' fields, key desired maximum throttled values in light of speed test results above. To convert, Ex. 5.8 Mbps from test=5800 kbps, and 0.57 Mbps=570 kbps.+
-*Note: Settings below will make the throttled speeds just entered ('Uplink'/'Downlink') apply only to the new wireless network. While the help screen sets a guideline of "80%-100%" of maximum, these throttled values can be set to whatever the admin desires, perhaps as low as 10%. A setting of 50% could prove perfectly functional. Performance testing and tweaking is recommended.+
-*Under 'Netmask Priority', key new wireless subnet address. Using same as above, 192.168.16.0(/)24. Click <b>Add</b>.+
-**On the line that appears, set 'Priority', Ex. <b>Bulk</b>. Click <b>Save</b>.+
-*Repeat for main interface (Ex. 192.168.1.1(/)24), click <b>Add</b>, set priority as desired, typically '<b>Exempt</b>', click <b>Save</b>.+
-*Reboot.+
- +
-Note that throttling can also be applied based on application Service or MAC address.+
- +
-If all steps were followed, the second SSID should appear to wireless clients in the area, their login and connection subject to the security and bandwidth settings made here. It is good to share with thy neighbor!+
- +
- +
-== Sound Card ==+
-Waiting on drivers. See [http://www.dd-wrt.com/phpBB2/viewtopic.php?p=498842 Audio Question].+[[Category:Asus guides]]

Current revision

There are two hardware versions of this router, the original 'v1', and the later 'B1'. Both have stable DD-WRT releases available.


By connecting a storage device, both can be fully self-contained; no more need for Internet access at bootup to load file system (FS) drivers. While this method requires some configuration (see Mount FS by Direct Access Method), third-party developers have now produced firmware (FW) images with the FS drivers, including swap. Similar official releases are thought to be forthcoming, but the timeframe is unknown.


For wireless-N with USB, this router remains one of the best values. Besides the standard network printer and storage tasks, it can run Asterisk (PBX), host separate wireless LANs (WLANs), run many of the hundreds of Optware programs including torrent clients such as Transmission, serve small websites, serve sound (Ex. to stereo) with inexpensive sound card attached, and it even scratches your back. (:^) These are covered in detail below. (Web cam on the horizon.)


Click here for Page 2 of this wiki.


Contents

[edit] Overview Items

[edit] A Major Step Forward

From the earliest FW releases, FS drivers have been absent. While no extra storage is required to run DD-WRT (there's a robust feature set as-installed), it's a must for Optware and many device-hosted programs and USB-connected hardware.

To help us all, gouryella brought the needed FS modules together, wrote the scripts, hosted everything on his website, and even made a guide (see here or in the thread). (He's done similar for Optware, and his work is now also used in other routers.) Many thanks, gouryella.

With this method, the router downloads and installs the FS modules after each reboot; clearly some inherent shortcomings, but functional.

Now with the posting of Kirill's wiki (thanks to viking13 for bringing it to the forum), there is another option, one that allows FS drivers to be loaded directly from an attached drive. (See below.) Faster and more consistent reboots are reported, and dependence on web connection is eliminated. Many thanks, Kirill.

But perhaps eclipsing this accomplishment, grymster has succeeded in building a DD-WRT from source. He has also been so kind as to post his tools so that others can create custom builds (see Third-party Developer FW, below). Many thanks, grymster, and to amitg0123 also for the B1 build.


[edit] Differences in Hardware

The two versions differ primarily in the amount of flash memory and RAM onboard, the v1 at 4/32 and the B1 at 8/64 (MB flash/RAM).

There is also a small but significant difference in bootloaders which causes the two FW versions to be incompatible. Flashing the wrong one reportedly bricks the device. Take care when downloading!

[edit] Support Threads

Each hardware version has it's own support thread, the v1 here and B1 here. Please post any comments to the pertinent thread, the v1 as default.


[edit] Firmware Repository

Official releases are found from here. After selecting folder year and release number, carefully choose either 'Asus-RTN13' for v1, or 'Asus-RTN13UB1' for B1.

Each directory contains two files, a .trx for first flash (from stock), and a .bin for later updates.

[edit] Third-party Developer FW

For v1: grymster has created and posted on this thread. (Earlier post with some ensuing discussion is here). grymster shares his tools for building the FW here.

For B1: amitg0123 has started and posted on this thread. (amitg0123 also started a development thread for information on building the FW.)

Notes:

  • Must be logged in to see or download files.
  • These are .trx files, which must be flashed using Asus Firmware Restoration Utility (AFRU).
  • If DD-WRT is already installed, it is not possible to use the Firmware Upgrade tab under Administration in the web interface. (That input accepts only .bin files.) The router has to be placed in recovery mode, as for first flash (see below), and the .trx file uploaded using AFRU.


[edit] Which FW Image for Me?

The good news is, there are now options! Those wanting to stay strictly with official releases should pick from the links here.

  • To access USB-attached storage devices, router must be configured to load FS drivers, either by download on each restart, or by direct access to a prepared drive (see Mount FS by Direct Access Method).
  • There is no swap, and no way to add it since it must be built into the kernel. And there is no indication that swap will ever be included in future official releases. (This is a consideration only if running memory-hungry programs (Ex. Transmission).

The more adventurous may consider grymster's or amitg0123's FW. Notes:

  • Third-party so some (small) risk.
  • FS drivers are built-in so no need for extra configuration work.
  • Swap is included, available if needed.
  • Current v1 build has some parts removed, notably support for IPv6, USB serial and printing, and 3G drivers for Sierra and Option cards.

[edit] Flashing from Stock Asus FW to DD-WRT

This procedure places the router in recovery mode, then uses AFRU to upload the DD-WRT (official or third-party) .trx file. Subsequent updates, if any, are much easier (see Updating DD-WRT)


1. Preparation for Initial DD-WRT Install

1. Download desired DD-WRT FW file
  • Read the above and select file desired. Be absolutely sure it is right one, v1 vs B1.
  • Be sure file is '.trx' (.bin files are for updates only, for use only after DD-WRT is installed).
2. Download latest version of the Asus Firmware Restoration Utility
  • From a Windows machine, Browse to http://support.asus.com/download
  • Navigate to device model number, -N13U or -N13U-B1
  • Select OS
  • Click '+' next to 'Utilities', select version and download
  • Within the zip file, navigate to the */Utility folder and run 'setup' to install AFRU.
  • Be sure AFRU can be started with no problems
3. Download safety copy of Asus firmware (optional)
  • Do same as previous step, except click '+' next to 'Firmware' and download desired version.
  • Note that this file should not be needed; use only to restore Asus FW to router if later desired.
4. Last few checks
  • If not already directly wired, connect Ethernet cable from one of the router's LAN ports to client PC.
  • Be sure router's other three LAN ports and WAN port are open (nothing connected)
  • On PC, disable all other network adapters: wireless, modem, etc.
  • On PC, disable any firewall (Ex. Windows Firewall)
  • Optional: Set PC to use a static IP, Ex. 192.168.1.2, netmask 255.255.255.0, gateway 192.168.1.1
  • If possible, use uninterruptible power supply (UPS) for both PC and router. A power failure while flashing, though not likely, will probably brick the router.
  • Last check: Flashing a v1 FW to a B1 device will brick it, and vica versa. Be sure the FW file that is about to be flashed is the correct one for the device.


2. Flash to DD-WRT

1. Place router in Recovery mode
  • Disconnect power adapter plug from router
  • Push and hold the Restore button located on bottom panel. While continuing to hold down the Restore button, plug the power adapter back into router.
  • After five seconds, LED on front panel starts to blink, release the button.
2. Upload firmware image
  • On PC, open AFRU (installed earlier)
  • In Firmware Restoration window, click 'Browse' and select the DD-WRT image file, asus-to-ddwrt.trx (downloaded earlier)
  • Click 'Upload' to begin flash process that can take up to four minutes. Brick warning: Do not interrupt!
  • When message that router is rebooting appears, close AFRU window.


3. Reboot, launch DD-WRT web interface, and cleanup

  • After a minute or two, disconnect power adapter plug and leave for at least 10 seconds
  • If optional step of setting static IP was followed earlier, can now reset to automatic
  • Connect WAN port then reconnect power plug
  • Browse to 192.168.1.1 should bring up the DD-WRT web interface; set name/password for first access
  • Configure router as desired. Default connection is DHCP; for DSL check DSL with DD-WRT..
  • When satisfied that factory firmware will not be used again, uninstall Asus Utility from PC and delete Asus files.


[edit] Updating DD-WRT

This task is straightforward enough that it needs nearly no instruction.

  1. Backup any scripts, files or settings that are intended for reuse.
  2. Select and download the correct DD-WRT binary file, .bin, from the repository (see Firmware Repository, above)
  3. In the DD-WRT web interface, navigate to Administration | Firmware Upgrade tab, click 'Browse', select the downloaded .bin file, and click 'Restore'.
  4. After restart, restore any backups as desired.

[edit] Mounting File System for External Storage

To access USB-attached storage devices, the router must be configured to load FS drivers, either by download on each restart (Download Method) or by direct access to a prepared drive (Direct Access Method). This does not apply to third-party developer FW, which has the FS drivers built-in. If not using the router's file system or running Optware, this section can be skipped.


It is helpful to know that Optware must be installed to an ext*-formatted (typically ext3) partition. Because one part of the drive must be ext*, the reasoning goes, it is most efficient to make it all the same, as each FS mounted consumes more RAM. (This is more of a concern in the v1 version, depending on what other loads are applied.) That noted, it is possible to mount multiple partitions by simply insmodding the corresponding modules (see step 9 under Direct Access Method).


Other considerations in planning network storage strategy:

  • Transfer speeds through the router are limited to 2 - 2.5 MB/sec. (This is a common limitation; not peculiar to this device.)
  • Any drive with a USB interface can be attached to the router. Any active (powered) drive must have it's own power supply. (Flash drives are passive, not powered, so they can be plugged in directly.)
  • Any drive attached to the router can be used for network storage by any and all clients on the LAN regardless of client OS (Windows, OSX, Android, etc.).
  • Any (ext3-formatted) drive can be used for Optware installation. However, that drive must remain 'permanently' attached to the router.
  • Multiple 'drives' can be attached by using a USB hub or combo card reader/USB hub. Note: Some report that in a multi-drive environment, drives will not auto-mount on router reset. (Each's USB plug must be manually re-inserted after a restart; then it can be mounted.)
  • Flash drives should not be used for swap or they will quickly be ruined.
  • Portable HDDs formatted ext3 for occasional attachment to the router can be used on Windows clients by installing either explore2fs or linux-reader.


To do this setup, access by terminal interface is needed, either Telnet or SSH. If unfamiliar with these, see the Telnet/SSH tutorial.


The Direct Access Method is preferred as it does not not depend on an Internet connection, a distant server, and the presence and integrity of the driver file itself. The Download Method does have these dependencies, though it can be useful as a backup in (expectedly rare) situations (Ex. the local drive has failed or been removed). Normally either one method or the other is applied, then all forgotten about.


[edit] Mount FS by Direct Access Method

Overview
All official FW releases contain drivers for low-level access to USB storage devices. For direct access to work, the drive (typically SD card or flash drive) must be prepared with a special partition (typically small, 1~3 MB) in a memory-like format. (Note this does not convey any additional burden because this partition is never mounted.) The FS driver archive is then block-copied to it and the startup script modified to load the drivers automatically.


1. Have Disk On Hand
If already connected to router, power down both disk and router, wait a few seconds then disconnect disk.


2. Connect Disk to PC

  • If disk is powered type, connect USB first, then power cable.
  • If SD card or flash drive, just plug in.
  • Caution: Never unplug a flash memory device without first unmounting or removing power from host.


3. Create Disk Backup

  • If disk contains useful data, backup data before proceeding.


4. Choose a Format Method


5. Create (or Edit) Partitions

  • Note: Existing ext* partitions (and a few other types) can be moved with no data loss (if sufficient space available) to make room for the tiny new one.
  • Instructions for a typical installation, short version:
  • Make the first primary partition type ext3
  • Include all but the smallest partition size allowed (usually 1-3 MB) in the first primary partition
  • Make the second primary partition the remainder of the disk (usually the leftover 1-3 MB)
  • Instructions under Windows, detailed version:
  1. Download the selected .iso image (Gparted or Ubuntu) from step 4. (The Gparted live CD actually loads Ubuntu, then calls Gparted on bootup.) Ubuntu 10.10 .iso is assumed.
  2. Burn the .iso to CD and reboot to that disk (In Windows, strike F8 during restart and select that option.)
  3. Tip: When asked about keyboard driver, accept the default option.
  4. In Gparted (in Ubuntu: System | Administration | Gparted Patition Editor), select connected USB device (Caution!), click Partition | Unmount, Partition | Delete, Edit | Apply All Operations (or green checkmark), Device | Create Partition Table | Apply, and click on new, unallocated partition table to select.
  5. Continuing, click Partition | New, then for 'File System' pick ext3. Click the down arrow next to 'New Size (MiB)' one time. (This will leave space for the smallest allowable partition for direct access.) Click 'Add'.
  6. In table, click to select unallocated 1.00 MiB partition, Partition | New, then for 'File System' select 'unformatted', Add.
  7. Table should display only the two newly-created partitions and none unallocated. Click Edit | Apply All Operations (or green checkmark), Apply.
  8. When done, view as-written partition table; exit Gparted.
  9. Open command shell window, Applications | Accessories | Terminal
  10. If drive was unmounted earlier, unplug USB connection. (If any doubt, shutdown PC, then unplug.)
Tip: If running Ubuntu live CD, before removing, partition one of PC's disks, install and try out. Many consider Ubuntu superior to Windows.


6. Preformat Direct Access Partition

  • Re-connect USB drive to PC
  • In linux terminal, verify drive is mounted:
df -h
mount
The last line of output of each of these commands should contain the reference to the first partition. Ex:
/dev/sdb1             241M  6.1M  222M   3% /media/b564adc7-53c4-482d-a296-8391af52fe3b
/dev/sdb1 on /media/b564adc7-53c4-482d-a296-8391af52fe3b type ext3 (rw,nosuid,nodev,uhelper=udisks)
Note name is /dev/sdb1; format is ext3. Second partition (the unformatted one) is then /dev/sdb2 (not shown).
If any doubt, check and be sure. All data will be eliminated from /dev/sdb2 (in this example).
  • Preformat the small partition:
sudo dd if=/dev/zero of=/dev/sdb2


7. Download FS Driver File

  • Still in linux terminal, copy mount point from earlier output and paste with cd command, followed by download of driver file:
cd /media/b564adc7-53c4-482d-a296-8391af52fe3b
sudo wget http://home.karneval.cz/10102207/fs.gz
This places a copy of the driver file temporarily in the first partition. Block transfer it now to the second for direct access:
sudo dd if=fs.gz of=/dev/sdb2


8. Prepare Optware Partition and Unmount
Skip this step if only modifying an existing drive for direct access and with Optware already installed. (Unmount only.)

  • Note that Optware will not install unless partition is completely empty. Still in Linux terminal:
sudo rm fs.gz
sudo rmdir lost+found
  • Drive is now ready to receive Optware. Unmount before disconnecting USB:
umount /dev/sdb1
Done with linux terminal.


9. Update Settings in Web Interface

  • Login to router (from browser) and navigate to Services | USB tab. Enable each of the following:
  • Core USB Support
  • USB 2.0 Support
  • USB Storage Support
  • Automatic Drive Mount
Click 'Apply Settings'
  • Plug pre-formatted USB drive into router
  • Head to Administration | Commands tab and paste in window:
sleep 15
cd /tmp/var/tmp
tar -zxvf /dev/scsi/host0/bus0/target0/lun0/part2
insmod jbd.ko
insmod mbcache.ko
insmod ext3.ko
rm /tmp/var/tmp/*.ko
sleep 10
mount -t ext3 -o noatime,nodiratime /dev/scsi/host0/bus0/target0/lun0/part1 /opt
Click 'Save Startup'. This should work as written if partitioned per examples and only one disk; skip to 10.
  • Other cases
  • If other drives are attached or there are extra partitions on the drive, '/dev/scsi/host0/bus0/target0/lun0/partX' may not work. In this case, determine correct partition string(s) and replace in the above (both 'tar' and 'mount' lines). Hint: Attach drives one-at-a-time while monitoring the output of:
dmesg
(which can be entered at command line or in same Commands window (Administration | Commands tab), except pressing 'Run Commands' button).
  • For each additional file system needed, append insmod lines (just above 'rm' line) as required:
  • For FAT/FAT32
  • fat.ko
  • vfat.ko
  • nls_iso8859-1.ko
  • nls_cp437.ko
  • For NTFS
  • fuse.ko
  • Also append similar 'mount' lines, but with 'ext3' replaced by file type, 'vfat' or 'ntfs-3g'.
  • Of course, if ext3 format is not used, delete those three 'insmod' lines (jbd.ko, mbcache.ko, and ext3.ko).
  • In general, if the modules are inserted then the drive plugged in, the drive should be recognized and its device string should appear in dmesg output.


10. Reboot and Check

  • Reboot router, soft (Administration | Management tab, Reboot Router button) or hard (pull power adapter plug, wait at leat 10 seconds, plug back in).
  • Verify drive mounting:
  • At command line or in Commands window (Administration | Commands tab), enter:
mount
(and hit 'Run Commands' button). Drive should show up on /opt, Ex:
/dev/scsi/host0/bus0/target0/lun0/part1
                         3.6G    419.8M      3.0G  12% /opt
  • Now ready to install Optware.


[edit] Mount FS by Download Method

The next subheading describes the download method, but remains under its original title, "Automounting ext3/FAT/FAT32/NTFS" to keep from breaking any links to it.

If Direct Access method was applied, jump to Installing Optware Light.


[edit] Automounting ext3/FAT/FAT32/NTFS

The following tutorial is from gouryella's guide, which will always have the most up-to-date information. (It is linked from the Supported Devices Page.)


The RT-N13U has only 4 MB flash, which is almost full with DD-WRT installed. Ext3 needs an extra 200 KB of storage, and the driver is not present in the DD-WRT firmware yet [BrS]. Gouryella wrote a smart script that downloads the ext3 driver and mounts the 1st partition to /opt during boot (after WAN is up)


1. Just paste the following into the text box in Administration -> Commands and click Save Startup

[NOTE: configuration of filesystem support and partitions can be easy set at first line, NTFS needs aditional driver, that can be installed after you pass Optware guide by ipkg install ntfs-3g]

EXT3="YES"; EXT3P="part1"; NTFS="NO"; NTFSP="part2"; FAT="NO"; FATP="part3"; mkdir /tmp/etc/config
echo "wget http://home.karneval.cz/10102207/fs.gz -P /tmp/root" >> /tmp/etc/config/fs.wanup
echo "tar -xvzf /tmp/root/fs.gz -C /tmp/root" >> /tmp/etc/config/fs.wanup
if [ "$EXT3" == "YES" ]; then echo "sh /tmp/root/ext3" >> /tmp/etc/config/fs.wanup; fi
if [ "$NTFS" == "YES" ]; then echo "insmod /tmp/root/fuse.ko" >> /tmp/etc/config/fs.wanup; fi
if [ "$FAT" == "YES" ]; then echo "sh /tmp/root/fat" >> /tmp/etc/config/fs.wanup; fi
echo "mount /dev/discs/disc0/$EXT3P -o noatime,nodiratime /opt" >> /tmp/etc/config/fs.wanup
echo "/opt/bin/ntfs-3g /dev/discs/disc0/$NTFSP /mnt" >> /tmp/etc/config/fs.wanup
echo "mount /dev/discs/disc0/$FATP /jffs" >> /tmp/etc/config/fs.wanup
echo "rm /tmp/root/*.ko /tmp/root/fs.gz /tmp/root/ext3 /tmp/root/fat" >> /tmp/etc/config/fs.wanup
chmod +x /tmp/etc/config/fs.wanup
echo "nobody:*:65000:65000:nobody:/mnt:/bin/false" >> /etc/passwd

1.1 Enable the following under Services -> USB

Core USB Support
USB 2.0 Support
USB Storage Support
Automatic Drive Mount

1.2. Reboot router with an ext3 formatted USB drive plugged in

If the drive was successfully mounted (which may take some time), try another filesystems by editing 1st line of script.

[NOTE: check mounts thru putty by DF -h because in dd-wrt gui is is shown only after repluging drive]

1.3 Debugging:

#delete or sharp 10th line, reboot again and check:
dmesg
lsmod
ls /tmp/root
cat /tmp/etc/config/fs.wanup
ls /tmp/etc/config/

[edit] Installing Optware Light

This tutorial is also from gouryella's guide (see steps 4 - 6).


1. Installing Optware (only to an ext3 partition; /opt MUST be empty)

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

[NOTE: gateway is hard set to 192.168.1.1, if u have problem with this replace in optware-install.sh by vi or sed]

Now you can install another Optware packabe from http://www.dd-wrt.com/wiki/index.php/Tutorials or if u like:

1.1. Install xinetd, vsftpd, samba, webserver, pxe boot server, wget, nano, htop, dlq rapget

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

1.2 Well done, RT-N13u is ready for basic usage, u can acces by

samba: \\192.168.1.1
rem to add as hardrive in W7/XP run in command line 
net use a: \\192.168.1.1\www
net use b: \\192.168.1.1\dlq  
web: http://192.168.1.1:8080
ftp: ftp://192.168.1.1
pxe: add: dhcp-boot=pxelinux.0,dd-wrt,192.168.1.1 to Services -> Services -> Additional DNSMasq Options

1.3 Open to the world (paste to Administrations -> Commands and Save Firewall)

iptables -t nat -I PREROUTING -p tcp -d $(nvram get wan_ipaddr) --dport 80 -j DNAT --to 192.168.1.1:8080
iptables -t nat -I PREROUTING -p tcp -d $(nvram get wan_ipaddr) --dport 22 -j DNAT --to 192.168.1.1:22
iptables -t nat -I PREROUTING -p tcp -d $(nvram get wan_ipaddr) --dport 21 -j DNAT --to 192.168.1.1:21
iptables -I INPUT -p tcp -d 192.168.1.1 --dport 8080 -j logaccept
iptables -I INPUT -p tcp -d 192.168.1.1 --dport 22 -j logaccept
iptables -I INPUT -p tcp -d 192.168.1.1 --dport 21 -j logaccept


[edit] Installing a Transmission-daemon onto Asus RT-N13U

See Installing a Transmission-daemon onto Asus RT-N13U on page 2.


[edit] Installing a Network Printer onto Asus RT-N13U

See Installing a Network Printer onto Asus RT-N13U on page 2.


[edit] Fire up a Second Wireless Network w/ Optional Bandwidth Throttling

See Fire up a Second Wireless Network w/ Optional Bandwidth Throttling on page 2.


[edit] Sound Card

See Sound Card on page 2.


[edit] DLNA/UPnP Media Servers

See DLNA/UPnP Media Servers on page 2.


[edit] Device Specifications

See Device Specifications on page 2.



[edit] Authors

See Authors on page 2.