If you have just changed to Oleg firmware and have no real experience with Linux, this short tutorial may help. It re-uses the excellent Wengi tutorial and
Raas image.
Note:
This is for RT-N16 or WL routers with 2.6 kernel.
The Oleg firmware can be downloaded from here now:
ftp://core.dumped.ru/rt-n/
Later on:
http://code.google.com/p/wl500g/downloads/list
You'll need either USB stick or USB HDD (at least 2GB, but bigger is better).
Note:
Do not store any data on the disk as when you start the disk has to 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, first reboot the router.
Wait for 1 min. after rebooting the router to detect the USB storage.
telnet/PuTTY (you have to enable it in web interface) to your router 192.168.1.1 username:admin, password what you use with web interface (change it from default!)
copy the following lines as such (creates partition table)
Note: all of your data in the stick/HDD will be lost
Code:
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
fdisk /dev/sda < /tmp/parttbl
echo "" > /etc/fstab
flashfs save && flashfs commit && flashfs enable
reboot
echo "Wait till reboot (terminal disconnect)"
and paste it to the terminal (right click or what works with you mouse).
Wait till the router reboots.
Wait for 1 min. after rebooting the router to detect the USB storage.
telnet/PuTTY again to the router
copy the following lines as such and paste to the router (formats stick/HDD):
Code:
for i in `cat /proc/mounts | awk '/tmp\/mnt/{print($1)}'`;do umount $i; done
mkswap /dev/sda1 && swapon /dev/sda1
mke2fs -j /dev/sda2
mke2fs -j /dev/sda3
free
You're now ready to install optware.
Make sure that the router has a working internet connection (as image files are downloaded like
Attachment 6579).
You have to copy the following lines as such and paste to the terminal (telnet/PuTTY) you logged in to the router:
Code:
cd /tmp && wget -O flashf.tar.gz "http://wl500g.info/attachment.php?attachmentid=6579&d=1275990726" && cd / && tar -xvzf /tmp/flashf.tar.gz
chmod +x /usr/local/sbin/*
flashfs save && flashfs commit && flashfs enable
[ "`awk '/SwapTotal/{print($2)}' /proc/meminfo`" -eq 0 ] && mkswap /dev/sda1 && swapon /dev/sda1
mount -o noatime -t ext3 /dev/sda2 /opt && mount -o noatime -t ext3 /dev/sda3 /mnt
[ -n "`mount | sed -n '/\/opt/p'`" ] && [ -n "`mount | sed -n '/\/mnt/p'`" ] && cd /mnt && wget http://files.wl500g.info/asus/custom/raas/v10/opt.tar.gz && cd / && tar -xvzf /mnt/opt.tar.gz && cd /opt && wget http://files.wl500g.info/asus/custom/raas/v10/mnt.tar.gz && cd / && tar -xvzf /opt/mnt.tar.gz
ipkg update
cd /mnt && wget http://rutorrent.googlecode.com/files/rutorrent-3.0.tar.gz && tar -xvzf rutorrent-3.0.tar.gz
ipkg install readline && ln -s /opt/lib/libreadline.so.6.1 /opt/lib/libreadline.so.5
[ -x /opt/etc/init.d/rc.unslung ] && /opt/etc/init.d/rc.unslung start
#reboot
Installation is completed in a few minutes.
You can navigate to router's web interface, the best starting point is:
http://192.168.1.1:8082/cms/
username: admin
password: asus
Attachment 6305
SWAT/Samba (file sharing, web like control)
http://192.168.1.1:901/
ADOS (http/ftp downloader, you may use
fewgets as well, it's a bit simpler, N16 variant:
Attachment 6570)
http://192.168.1.1:8082/protected/WebUI/ados/
You have to login second time to ADOS as well.
username: admin
password: logitech
Transmission (torrent client)
http://192.168.1.1:8082/cgi-bin/transmission.cgi
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 try also the Transmission remote GUI:
http://code.google.com/p/transmisson-remote-gui/
If you prefer rtorrent over Transmission (like I do) you can install it via telnet/PuTTY:
Code:
ipkg update
ipkg install rtorrent gnuplot
mkdir -p /opt/share/torrent/session
mkdir -p /mnt/protected/Downloaders/rtorrent
/bin/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 && /bin/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`" ] && /bin/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 ( \"127.0.0.1\" =>\n\t\t (\n\t\t \"host\" => \"127.0.0.1\",\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
cd /mnt && wget -O fewgets.tar.gz "http://wl500g.info/attachment.php?attachmentid=6570&d=1275768575" && 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 (
http://code.google.com/p/ntorrent/), however there is a nice web front end to it, named ruTorrent (
http://code.google.com/p/rutorrent/)
Do not change lighttpd.conf any further until you're familiar with the system.
ruTorrent web interface:
http://192.168.1.1:8082/rutorrent/
From internet: https://<your public IP|dyndns host name>/rutorrent/
fewgets:
http://192.168.1.1:8082/cgi-bin/fewgets.cgi
Don't forget to change the web password in
/opt/etc/lighttpd/.lighttpdpassword as
the https port is also available from internet!
Installing MediaTomb (optional):
Code:
cd /opt/share/file && mv magic magic.old
ipkg install readline mediatomb
mkdir -p /opt/etc/mediatomb
mkdir -p /usr/local/root/.mediatomb
flashfs save && flashfs commit && flashfs enable
/bin/sed -i 's/MT_USER="root"/MT_USER="admin"/' /opt/etc/mediatomb.conf
/bin/sed -i 's/MT_ENABLE=false/MT_ENABLE=true/' /opt/etc/default/mediatomb
cd /opt/share/mediatomb
cat sqlite3.sql | sqlite3 mediatomb.db
mv mediatomb.db /opt/etc/mediatomb/
/opt/etc/init.d/S90mediatomb start
/bin/ps | grep mediatomb
MediaTomb web interface:
http://192.168.1.1:50500/
You can learn more about MediaTomb:
http://mediatomb.cc/
Replacing Samba2 with Samba3 (optional):
Code:
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 "http://wl500g.info/attachment.php?attachmentid=6455&d=1274467707" && cd / && tar -xvzf /mnt/smb.tar.gz
/opt/etc/init.d/S08samba start
/bin/ps | grep smbd
Attachment 6455
A few notes:
- Don't upgrade the packages unless you know what you're doing as it may replace the working .conf files (save /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
http://linux.die.net/man/1/rtorrent
If it works, 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.