Results 1 to 15 of 57

Thread: [HowTo] Asus RT-N16 (Oleg) - optware the simple way

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Lightbulb [HowTo] Asus RT-N16 (Oleg) - optware the simple way

    Updated on 21.10.2011 to work also with 2.4 kernel routers

    If you have just changed to Oleg firmware without Linux experience, this short tutorial may help. It re-uses the excellent Wengi tutorial and Raas image.
    Official Oleg firmware version:

    You'll need USB stick/HDD (>2GB, but reasonable size HDD if you plan to store/download files as USB sticks wear out).
    Note: Do not store any data on the disk as it will be re-partitioned and everything will be lost.
    Connect only the disk that will contain the system!

    Do not change user name from admin, some programs rely on that.

    After connecting USB storage, reboot the router and wait for ~1 min to detect the USB storage

    telnet/PuTTY (you have to enable it in web interface) to your router username:admin, password what you use with web interface (change it from default!)

    Copy the following lines (creates partition table) and paste it to the terminal as such (right click/what works with your mouse):
    Note: all of your data in the stick/HDD will be lost
    echo -e "o\nn\np\n1\n\n+256M\nn\np\n2\n\n+1024M\nn\np\n3\n\n\nt\n1\n82\nw" > /tmp/parttbl
    case "`/bin/uname -r`" in
        2.6* ) fdisk /dev/sda < /tmp/parttbl;;
        2.4* ) fdisk /dev/discs/disc0/disc < /tmp/parttbl;;
    echo "" > /etc/fstab
    flashfs save && flashfs commit && flashfs enable
    echo "Wait till reboot (terminal disconnect)"
    Wait ~1 min. after rebooting the router to detect the USB storage.
    telnet/PuTTY again to the router
    copy-paste the following lines as such (formats stick/HDD):
    for i in `cat /proc/mounts | awk '/tmp\/mnt/{print($1)}'`;do umount $i; done
    case "`/bin/uname -r`" in
        2.6* ) mkswap /dev/sda1 && swapon /dev/sda1 && mke2fs -j /dev/sda2 && mke2fs -j /dev/sda3;;
        2.4* ) mkswap /dev/discs/disc0/part1 && swapon /dev/discs/disc0/part1 && mke2fs -j /dev/discs/disc0/part2 &&  mke2fs -j /dev/discs/disc0/part3;;
    You're now ready to install optware.
    Make sure that the router has a working internet connection (as image files are downloaded like flashf.tar.gz).
    Copy-paste to the terminal (telnet/PuTTY) you logged in to the router as such:

    DLN=`wget -q "" -O - | /bin/sed -n '/flashf.*tar.gz/p'`
    DLL=`echo "$DLN" | /bin/sed -n 's/.*\(attachmentid=[0-9]*\).*;\(d=[0-9]*\).*/\1\&\2/p'`
    cd /tmp && wget -O flashf.tar.gz "${DLL}" && cd / && tar -xvzf /tmp/flashf.tar.gz
    chmod +x /usr/local/sbin/*
    case "`/bin/uname -r`" in 2.4*)
    cat > /etc/fstab << __EOF__
    #device Mountpoint FStype Options Dump Pass#
    /dev/discs/disc0/part1 none swap sw 0 0
    /dev/discs/disc0/part3 /mnt ext3 rw,noatime 1 1
    /dev/discs/disc0/part2 /opt ext3 rw,noatime 1 1
    mkswap /dev/discs/disc0/part1
    swapon /dev/discs/disc0/part1
    flashfs save && flashfs commit && flashfs enable
    [ "`awk '/SwapTotal/{print($2)}' /proc/meminfo`" -eq 0 ] && mkswap /dev/sda1 && swapon /dev/sda1
    case "`/bin/uname -r`" in
        2.6* ) mount -o noatime -t ext3 /dev/sda2 /opt && mount -o noatime -t ext3 /dev/sda3 /mnt;;
        2.4* ) mount -o noatime -t ext3 /dev/discs/disc0/part2 /opt && mount -o noatime -t ext3 /dev/discs/disc0/part3 /mnt;;
    [ -n "`mount | sed -n '/\/opt/p'`" ] && [ -n "`mount | sed -n '/\/mnt/p'`" ] && cd /mnt && wget && cd / && tar -xvzf /mnt/opt.tar.gz && cd /opt && wget && cd / && tar -xvzf /opt/mnt.tar.gz
    ipkg update
    cd /mnt && wget && tar -xvzf rutorrent-3.3.tar.gz
    ipkg install readline && ln -s /opt/lib/ /opt/lib/
    [ -x /opt/etc/init.d/rc.unslung ] && /opt/etc/init.d/rc.unslung start
    /opt/bin/ps afx
    Installation is completed in a few minutes.

    You can navigate to router's web interface, the best starting point is:
    username: admin
    password: asus
    Name:  Headstart_cms.jpg
Views: 23270
Size:  95.0 KB

    ADOS (http/ftp downloader, you may use fewgets as well, it's a bit simpler)
    You have to login second time to ADOS as well.
    username: admin
    password: logitech

    Transmission (torrent client)
    Simply put your torrent files in /mnt/protected/Downloaders/Transmission/source and download should start in the background.
    Note: transmission program is started by scheduler that runs in every 30 min so it may take some time before transmission starts.

    You may wish to switch to newer version of Transmission, separate tutorial is here.

    If you prefer rtorrent over Transmission (like I do) copy-paste:

    ipkg update
    ipkg install rtorrent gnuplot
    mkdir -p /opt/share/torrent/session
    mkdir -p /mnt/protected/Downloaders/rtorrent
    sed -i -e 's#/opt/bin/bash#/bin/sh#' -e 's#"root"#"admin"#' -e 's#test -x /opt/bin/su.*##' -e 's#su -c \"##' -e 's#\" ${user}##' /opt/etc/init.d/S99rtorrent
    cd /opt/etc && sed -i 's#/opt/share/torrent/work/#/mnt/protected/Downloaders/rtorrent/#' rtorrent.conf
    [ -z "`/bin/sed -n '/scgi_port =/p' rtorrent.conf`" ] && echo "scgi_port = localhost:5000" >> rtorrent.conf
    echo "schedule = log,180,180,\"execute=/opt/etc/rtorrlog,\$get_down_rate=,\$get_up_rate=\"" >> rtorrent.conf
    cd /opt/etc/lighttpd/ && [ ! -f lighttpd.conf.raas ] && cp lighttpd.conf lighttpd.conf.raas
    [ -z "`/bin/sed -n '/^[^#].*mod_scgi/p' lighttpd.conf`" ] && sed -i 's/"mod_fastcgi",/"mod_fastcgi",\n\t\t\t\t"mod_scgi",/' lighttpd.conf
    LIN1=`echo -e "\nscgi.server   = (\"/RPC2\" =>\n\t\t ( \"\" =>\n\t\t   (\n\t\t    \"host\" => \"\",\n\t\t    \"port\" => 5000,\n\t\t    \"check-local\" => \"disable\"\n\t\t   )\n\t\t )\n\t\t)"`
    LIN2=`echo -e "SERVER[\"socket\"] == \":443\" {\nssl.engine\t= \"enable\"\nssl.pemfile\t= \"/opt/etc/lighttpd/lighttpd.pem\"\nserver.document-root\t= \"/mnt/\"\n  auth.require = ( \"\" =>\n\t\t (\n\t\t  \"method\"  => \"digest\",\n\t\t  \"realm\"   => \"RT-N16\",\n\t\t  \"require\" => \"user=admin\"\n\t\t )\n\t\t)\n}"`
    [ -z "`/bin/sed -n '/":443"/p' lighttpd.conf`" ] && echo -e "$LIN1\n\n\$$LIN2" >> lighttpd.conf
    DLN=`wget -q "" -O - | /bin/sed -n '/fewgets.*tar.gz/p'`
    DLL=`echo "$DLN" | /bin/sed -n 's/.*\(attachmentid=[0-9]*\).*;\(d=[0-9]*\).*/\1\&\2/p'`
    cd /mnt && wget -O fewgets.tar.gz "${DLL}" && cd / && tar -xvzf /mnt/fewgets.tar.gz
    flashfs save && flashfs commit && flashfs enable
    /opt/etc/init.d/S80lighttpd restart
    /opt/etc/init.d/S99rtorrent start
    mkdir -p /mnt/protected/ewget
    /bin/ps | grep lighttpd
    You can use it with nTorrent (, however there is a nice web front end to it, named ruTorrent (
    Do not change lighttpd.conf any further until you're familiar with the system.
    ruTorrent web interface:
    From internet: https://<your public IP|dyndns host name>/rutorrent/


    Don't forget to change the web password in /opt/etc/lighttpd/.lighttpdpassword as the https port is also available from internet!

    For installing a kernel modules a separate tutorial exists.

    For OpenVPN I've created a separate tutorial.

    For DLNA media servers I've created a separate tutorial.

    For Tor & polipo a separate tutorial exists. Tor & polipo thread.

    Replacing Samba2 with Samba3 (optional):
    killall smbd nmbd
    cd /opt/etc/samba && [ ! -f smb.conf.raas ] && cp smb.conf smb.conf.raas
    ipkg remove samba2 
    ipkg install samba samba3-swat
    sed -i 's/samba_active=0/samba_active=1/' /opt/etc/init.d/S08samba
    cd /mnt && wget -O smb.tar.gz "" && cd / && tar -xvzf /mnt/smb.tar.gz
    /opt/etc/init.d/S08samba start
    /bin/ps | grep smbd

    A few notes:
    - Don't upgrade the packages unless you know what you're doing as it may replace the working .conf files (save e.g. copy to /mnt the entire /opt/etc before doing so)
    - If you install the latest lighttpd with ipkg install lighttpd you have to change in /opt/etc/lighttpd/lighttpd.conf server.event-handler to this:
    server.event-handler = "poll"
    - You may need to restrict the memory usage of rtorrent in /opt/etc/rtorrent.conf, e.g. to 64 MB:
    max_memory_usage = 67108864
    for other configuration options see
    Enjoy! It worked for me, but there is no guaranty. I shall not be liable of anything if something goes wrong. Use it at your own risk.
    Attached Files Attached Files
    Last edited by ecaddict; 05-12-2011 at 17:21. Reason: Added references to subsequent separate tutorials, highlighted /opt/etc saving

Similar Threads

  1. [Howto] Install DLNA media servers for Oleg firmware
    By ecaddict in forum WL-500gP Tutorials
    Replies: 18
    Last Post: 06-06-2017, 08:40
  2. Optware Entware Asus RT-N56U
    By Omega in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 220
    Last Post: 06-02-2016, 11:53
  3. Replies: 24
    Last Post: 05-05-2015, 08:42
  4. Replies: 6
    Last Post: 21-09-2012, 18:06
  5. [Howto] Install kernel modules for Oleg firmware
    By ecaddict in forum WL-500gP Tutorials
    Replies: 0
    Last Post: 05-12-2011, 17:18

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts