Page 1 of 9 123 ... LastLast
Results 1 to 15 of 123

Thread: [HowTo] Part One - WL-500g Premium

  1. #1
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    24

    Lightbulb [HowTo] Part One - WL-500g Premium

    What is it for?
    This is a little "HowTo" for new Users of the Asus WL-500g Premium. It's a synopsis of my own experiences in setting up this box with Oleg's firmware "WL500gp-1.9.2.7-7f-pre4.trx". Thanks to Oleg fort his great work and thanks to all users of this forum, because almost every information I gathered comes from this site here (including the postings from macsat).
    Comment: I tried to record every step of setting up the box, so I hope the amount of typos and principal faults is finite. And please be forbear with my grammar and orthography - English is not my native language..
    In general: Any corrections, comments, improvements or suggestions are welcome!
    2nd comment: principally you have to save every changes on flash fliesystem before you reboot with
    Code:
     flashfs save && flashfs commit && flashfs enable && reboot
    but you can execute more than one of this sections and commit changes to flash at the end, unlike I write you have to flash.

    To get access
    First of all you've got to get access to your box. Therefore I use Putty, you can get it here: http://www.chiark.greenend.org.uk/~s.../download.html
    If you didn't disabled telnet on the Asus-configuration site, you can access your box by opening a telnet-session with IP 192.168.1.1, Port 23, username "admin" and password "admin" (if you haven't changes yet, but you should).
    Now you are connected to your box. You can try some commands to play a bit around: top, ps, df, free...

    Install ssh-deamon
    So, you have access, but with telnet this connection is not encrypted, so we will establish a ssh-connection. Therefore we need to install dropbear.
    Create the dropbear-directory:
    Code:
    mkdir -p /usr/local/etc/dropbear
    Generate dropbear-keys; it may take a few seconds:
    Code:
    dropbearkey -t dss -f /usr/local/etc/dropbear/dropbear_dss_host_key
    dropbearkey -t rsa -f /usr/local/etc/dropbear/dropbear_rsa_host_key
    Create the script-directory:
    Code:
    mkdir -p /usr/local/sbin/
    Create the post-boot script-file
    Code:
    echo "#!/bin/sh" >> /usr/local/sbin/post-boot
    Mark post-boot-file as executable:
    Code:
    chmod +x /usr/local/sbin/post-boot
    Start dropbear in post-boot-script:
    Code:
    echo "dropbear" >> /usr/local/sbin/post-boot
    You can start dropbear manually to try it out, but we have to reboot anyway:
    Code:
    dropbear
    Save changes in flash and reboot:
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    Extend RAM to 32MB
    After flashing Oleg's FW on your box, it has by default 16MB RAM, but on the PCB are 32MB. By changing some NVRAM variables you can make the hole 32MB RAM accessable.

    Attention! This just works with Premium boxes! Use this section on your own risk! It can damage your box! You shouldn't change the nvram variables with a Premium V2!!!
    Code:
    nvram set sdram_init=0x0009
    nvram set sdram_ncdl=0
    nvram commit
    reboot
    You can check the success by typing
    Code:
    free
    Prepare USB-HDD
    If you want to connect a USB-HDD to you box and make it accessible by network you have to partition your HDD and create a linux-accassible filesystem (ext3). For that matter we can create a swap-partition.
    О made the decision to create one big primary partition for data and one little partition at the end of the disk for swap.
    Run the partition program by typing
    Code:
    fdisk /dev/discs/disc0/disc
    Fdisk is self-explaining, type m to view the help-page. When you are finished, don't forget to save changes with the w-command before you exit fdisk.
    After partition your disk, it's time to create filesystems
    Code:
    mke2fs -j /dev/discs/disc0/part1
    mkswap /dev/discs/disc0/part2
    We already created the post-boot scriptfile, now we can create several others too.
    Code:
    touch /usr/local/sbin/post-firewall 
    touch /usr/local/sbin/post-mount
    touch /usr/local/sbin/pre-shutdown
    chmod +x /usr/local/sbin/*
    Netx we will modify the post-boot-script with the vi-editor. I wouldn't say it's self-explaining but with a few commands you can use it. With "i" you get into editor-modus, with [ESC] you leave it. With ":wq!" you quit the editor by saving your file. For further information about vi visit http://lug.boulder.co.us/docs/vi_vim_howto.html
    Code:
    vi /usr/local/sbin/post-boot
    Add the following lines to post-boot file:
    Code:
    #Wait for /opt to mount
    mount /dev/discs/disc0/part1 /opt
    i=0
    while [ $i -le 30 ]
    do
    if [ -d /opt/etc ]
    then
    break
    fi
    sleep 1
    i=`expr $i + 1`
    done
    
    # Activate swap
    swapon /dev/discs/disc0/part2
    
    # Run all active services - active means starts with S
    /opt/etc/init.d/rc.unslung
    Save changes in flash and reboot.
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    Initiate ipkg and install nano, screen, midnight commander
    With ipkg there exists a package-system which enables you to easily install additional software-packages. Available packages und information about them you can find here: http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/, http://ipkgfind.nslu2-linux.org/
    So, make the necessary dirs and install and update ipkg:
    Code:
    mkdir /opt/tmp 
    mkdir /opt/tmp/ipkg 
    ipkg.sh update 
    ipkg.sh install ipkg
    ipkg update
    Now you are able install useful software, for examle nano, a nice, easy to use editor:
    Code:
    ipkg install nano
    Install the terminal-multiplexer screen, a nice tool to handle several terminal-sessions:
    Code:
    ipkg install screen
    Some useful commands for screen are:
    Code:
    C-a c		create
    C-a n		next
    C-a p		previous
    C-a #		#=number of screen beginning with 0
    C-a A		give a name
    C-a " 		list
    C-a K		kill
    C-a d 		detatch
    screen -r 	reattach
    C-a S		split horizontally
    C-a X		kill 2nd region
    In which e.g. "C-a" means to press [ctrl] and [a] at the same time. For further information see: http://www.slac.stanford.edu/comp/unix/package/epics/extensions/iocConsole/screen.1.html

    Install midnight commander, THE file-browser:
    Code:
    ipkg install mc
    Midnight commander won't rum without a few lines in the post-boot script:
    Code:
    nano /usr/local/sbin/post-boot
    So add to post-boot-file:
    Code:
    #to let midnight commander run on terminals, make alias for colored mc
    echo "export TERMINFO=/opt/share/terminfo">>/etc/profile
    echo "alias mc=\"mc -c\"">>/etc/profile
    Install cron, a daemon to run scripts by scheduler:
    Code:
    ipkg install cron
    With cron it is possible to let script-files periodically run, accordingly to its directory in which it is saved.
    Code:
    mkdir /opt/etc/cron.5mins
    mkdir /opt/etc/cron.hourly
    mkdir /opt/etc/cron.daily
    mkdir /opt/etc/cron.weekly
    mkdir /opt/etc/cron.monthly
    Now you have to edit the crontab-file:
    Code:
    nano /opt/etc/crontab
    and add the following lines:
    Code:
    SHELL=/bin/sh
    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin
    MAILTO=""
    HOME=/
    # ---------- ---------- Default is Empty ---------- ---------- #
    # Syntax for lines is : minute hour day month dayofweek command #
    */5 * * * * admin run-parts /opt/etc/cron.5mins
    0 * * * * admin run-parts /opt/etc/cron.hourly
    0 0 * * * admin run-parts /opt/etc/cron.daily
    0 0 * * 0 admin run-parts /opt/etc/cron.weekly
    0 0 1 * * admin run-parts /opt/etc/cron.monthly
    It's just an example. To understand how cron works, search for a cron-howto. I didn't used it copious, but I think it works (note: you need cron for the torrent-package). As you can see in the run-parts-script, I have this from macsat, but I modified the crontab-file.

    So, we have to create the run-parts-script:
    Code:
    nano /opt/bin/run-parts
    Fill it with the following lines:
    Code:
    #!/bin/sh
    #
    # runparts.sh by macsat@macsat.com
    # intended for use with cron
    #
    # based on rc.unslung by unslung guys :-)
    #
    if [ -z "$1" ]
    then
    echo "Usage : $0 "
    fi
    
    RUNDIR=$1"/*"
    
    for i in $RUNDIR ;do
    
    # Ignore dangling symlinks (if any).
    [ ! -f "$i" ] && continue
    
    case "$i" in
    *.sh)
    # Source shell script for speed.
    (
    trap - INT QUIT TSTP
    set start
    . $i
    )
    ;;
    *)
    # No sh extension, so fork subprocess.
    $i start
    ;;
    esac
    done
    And make the script executable:
    Code:
    chmod +x /opt/bin/run-parts
    Save changes in flash and reboot:
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    [edit@20060725] typos..
    [edit@20080827] nvram variables with Premium V2
    Last edited by marcnesium; 27-08-2008 at 13:57.
    "Documentation is like sex. If it is good, it is REALLY good, and if it is bad, it is better than nothing!" Gabe Helou

  2. #2
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    24

    Post WL-500g Premium Howto Part Two

    Samba
    So, you have a HDD connected to your box, now you want to access this disk over network connection. For this we need to configure the samba-daemon.

    Create samba-directory:
    Code:
    mkdir /opt/etc/samba
    Create samba-config-file with nano or vi:
    Code:
    nano /opt/etc/samba/smb.conf
    Content of /opt/etc/samba/smb.conf:
    Code:
     
    [global]
    workgroup = YOURWORKGROUPNAME
    guest account = nobody
    security = share
    browseable = yes
    guest ok = yes
    guest only = no
    log level = 1
    max log size = 100
    encrypt passwords = no
    dns proxy = no
    
    [smbshare]
    path=/opt/share
    writeable = yes
    browseable = yes
    force user = admin
    
    [otherdir]
    path=/opt/share/otherdir
    writeable = yes
    browseable = yes
    force user = admin
    This is just an example, too. It makes the "share"-directory accessible over network under the name "smbshare" and its subdir "otherdir" under the name "otherdir". You can modify that like you want. Under Windows you can connect to this dirs with \\192.168.1.1\smbshare and \\192.168.1.1\otherdir.

    Create samba-Init-file:
    Code:
    nano /opt/etc/init.d/S97Samba
    Content of /opt/etc/init.d/S97Samba:
    Code:
    #!/bin/sh
    /usr/sbin/smbd -D -l /opt/var/log/smbd.log -s /opt/etc/samba/smb.conf
    /usr/sbin/nmbd -D -n myasus -o -l /tmp -s /opt/etc/samba/smb.conf
    Mark init-file as executable:
    Code:
    chmod 755 /opt/etc/init.d/S97Samba
    Save changes in flash and reboot:
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    Install (c)torrent
    There are two ipkg-packages, which make it possible to download files over bittorrent-protocol with your box. The downloaded files are stored on USB-HDD. This download-solution is not compatible with the Asus download master. But it works very well, I never used Asus dm at all. To control and supervise the downloads oleo wrote a cgi-script, which enables you to control your downloads with browser/webinterface. Thanks to oleo.
    Code:
    ipkg install ctorrent
    ipkg install torrent
    The following directories are necessary:
    Code:
    mkdir /opt/share/torrent
    mkdir /opt/share/torrent/source
    mkdir /opt/share/torrent/work
    mkdir /opt/share/torrent/target
    To get the cgi-script run you have to edit the httpd configuration-file:
    Code:
    nano /usr/local/root/httpd.conf
    Content of /usr/local/root/httpd.conf
    Code:
     
    A:*
    /cgi-bin:admin:admin
    .au:audio/basic
    .asp:text/html
    You have to start the http daemon in one of the start-scripts:
    Code:
    nano /usr/local/sbin/post-mount
    Add following line to /usr/local/sbin/post-mount
    Code:
    #!/bin/sh
    /usr/sbin/busybox_httpd -p 8008 -h /opt/share/www
    Now you can edit the torrent configuration file:
    Code:
    nano /opt/etc/torrent.conf
    Mine looks like this:
    Code:
    ##########
    #   Configuration
    #   NOTE: no spaces around the = sign
    #   the config will be sourced (eg. . torrent.conf)
    
    SOURCE=/opt/share/torrent/source
    WORK=/opt/share/torrent/work
    TARGET=/opt/share/torrent/target
    MAILTO=
    MAILFROM=
    # default MAILER is mini_sendmail
    #MAILOPT="-sblackhole.dyndns.org -f"
    USER=admin
    GROUP=root
    DATE_FORMAT="%d %h %H:%M"
    
    # btget port range environment
    BTLIB_MINPORT=52846
    export BTLIB_MINPORT
    BTLIB_MAXPORT=52846
    export BTLIB_MAXPORT
    #time between logs
    LOG_TIME=59
    
    # Seed torrent after completition (YES or NO)
    AUTOSEED="YES"
    
    #Colors for command line. # comment out if not needed
    GREEN="\033[32;1m"
    #NC="\033[0m"
    #BACK_UP="\033[1K\033[0G"
    NORMAL="\033[0m"
    WARN="\033[33;1m"
    BAD="\033[31;1m"
    BOLD="\033[1m"
    GOOD="\033[32;1m"
    Now you can put a torrent-file into the source-dir and control it with the cgi-script http://192.168.1.1:8008/cgi-bin/torrent.cgi. That's it.

    Install nload
    A nice tool to watch the traffic on the network interfaces of the box is nload:
    Code:
    ipkg install nload
    You can use it for example like this:
    Code:
    nload -t 200 -s 7 -i 2048 -o 256 -u H eth1
    -t: time until refresh in ms
    -s: smoothness [1-9], 1 means average over litte, 9 over long time
    -i: sets scale for incoming traffic, in kBit/s
    -o: sets scale for outgoing traffic, in kBit/s
    -u: sets units, see helppage -h for more details

    In order to make this command more easier to use, you can create an alias in /usr/local/sbin/post-boot:
    Code:
    nano /usr/local/sbin/post-boot
    Add the following line to post-boot file
    Code:
    echo "alias nld=\"nload -t 200 -s 7 -i 2048 -o 256 -u H eth1\"">>/etc/profile
    The Wondershaper-issue
    I must admit, that's one thing, that doesn't work well, yet. Wondershaper is a script which provides QoS, but I can't get it run very well.
    I tried to start the script with:
    Code:
    /init/wshaper start "eth1" 1990 190 " " " " "54321" "54321"
    But except of some experiments I don't use it, cause it don't work very well for me. For own experiments use nload to watch effects of wshaper.
    In my opinion thy syntax is quite complicated. For further information read the following:
    - http://wiki.wl500g.info/index.php/PackageWondershaper
    - Wondershaper QoS discussion on AsusForum
    - http://www.docum.org/docum.org/docs/BB/BB.php
    - http://lartc.org/lartc.html

    That's it. Preliminary. I hope it helped you a bit. This here are all steps I've done on my box and it's running since a week or two without any problem (except wshaper)...

    As I wrote above: Any corrections, comments, improvements or suggestions are welcome! You can help to correct and complete this.

    [edit@20060728]: typos
    [edit@20060822-Styno]: typo
    Last edited by Styno; 22-08-2006 at 10:37. Reason: typo
    "Documentation is like sex. If it is good, it is REALLY good, and if it is bad, it is better than nothing!" Gabe Helou

  3. #3
    great tutorial!!!

    everything works almost fine, one thing i have troubles with.

    [admin@paco sbin]$ post-mount

    that command i must manually start, when i reboot the router i must login with ssh and run that command before the web interface for the torrent is working.

    do you have any suggest/idea?

  4. #4
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    24

    Wink

    Perhaps the script is not marked as executable...
    To check type:
    Code:
    ls -all
    correct return is:
    Code:
    [admin@horst sbin]$ ls -all
    drwxr-xr-x    1 admin    root            0 Jul 16 19:24 .
    drwxr-xr-x    1 admin    root            0 Jan  1  2000 ..
    -rwxr-xr-x    1 admin    root          712 Jul 24 13:11 post-boot
    -rwxr-xr-x    1 admin    root           64 Jul 24 12:24 post-firewall
    -rwxr-xr-x    1 admin    root           60 Jul 24 13:12 post-mount
    If one file is not executable, change this with
    Code:
    chmod +x post-mount
    Helpful?
    "Documentation is like sex. If it is good, it is REALLY good, and if it is bad, it is better than nothing!" Gabe Helou

  5. #5
    Thx, but did is not the problem, i checked it by myself before.

    Code:
    [admin@paco sbin]$ ls -all
    drwxr-xr-x    1 admin    root            0 Jul 24 15:33 .
    drwxr-xr-x    1 admin    root            0 Jan  1  2000 ..
    -rwxr-xr-x    1 admin    root          465 Jul 24 16:11 post-boot
    -rwxr-xr-x    1 admin    root            0 Jul 24 16:05 post-firewall
    -rwxr-xr-x    1 admin    root           60 Jul 24 16:26 post-mount
    -rwxr-xr-x    1 admin    root            0 Jul 24 16:05 pre-shutdown
    [admin@paco sbin]$
    Looks fine to me

  6. #6

    Also useable for the wl-500gx?

    Is your tutorial also useable for the wl-500gx? i have to set one up tomorrow.
    Is the memeoty trick also possible?

    Thanks

    elbling

  7. #7
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    24

    Wink

    To my knowledge the Deluxe version has only 16MB RAM on PCB, so DO NOT change this NVRAM-variables!! It can damage your box!!

    The rest of the howto should be transferable to the deluxe-box. Spontaneous I can't think of any problems (expect of the RAM!!) - but I never owned a deluxe box - so I never tried Let me know...

    Ciao Marc.
    "Documentation is like sex. If it is good, it is REALLY good, and if it is bad, it is better than nothing!" Gabe Helou

  8. #8
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    24
    No reason for this problem found. Perhaps an individual case? Anyone with same problem? Workaround: start http daemon in one of the other post-~-scripts...

    Ciao Marc.
    "Documentation is like sex. If it is good, it is REALLY good, and if it is bad, it is better than nothing!" Gabe Helou

  9. #9
    Quote Originally Posted by marcnesium
    No reason for this problem found. Perhaps an individual case? Anyone with same problem? Workaround: start http daemon in one of the other post-~-scripts...

    Ciao Marc.

    the post-mount is not running automaticly for me too.. i need to do it everytime i restart the router

    I aint able also to acess samba or even ftp any ideas what may be causing this?

  10. #10
    Fdisk is self-explaining, type m to view the help-page. When you are finished, don't forget to save changes with the w-command before you exit fdisk.
    After partition your disk, it's time to create filesystems
    Code:
    mke2fs -j /dev/discs/disc0/part1
    mkswap /dev/discs/disc0/part2

    pls help me, mke2fs works good, but when i try "mkswap /dev/discs/disc0/part2" putty says :
    Code:
    [admin@(none) root]$ mkswap /dev/discs/disc0/part2
    mkswap: /dev/discs/disc0/part2: No such file or directory
    [admin@(none) root]$
    any ideas?


    EDIT: FOUND MY PROBLEM
    forgot to make a swap partition with fdisk - damn
    sorry, im a linux newbie
    Last edited by olli84; 11-08-2006 at 18:56.

  11. #11
    Thanks for this very good tutorial!!

    I also followed the (c)torrent install part but I am having some problems. It seems like everything is installed correctly but the torrents does just not download.

    I can upload the torrent file and I can see that it is recognized with the cgi-script. I do not know if I control the torrent downloads correctly but the torrents does not download.

    I have tried to a few different ports in the torrent.conf. One of the ports I have tried is the one that my Aazerues on my laptop uses, which downloads just fine.

    Can someone help me debug this issue? Perhaps to check if everything is installed correctly. If I need to control the torrent download by doing something more than just upload the torrent file. Or to check the see if it is a firewall issue.

    Any suggestions are welcome.

  12. #12
    'am a newbies and i'll would install CTORRENT with oleg's firmware 1.9.2.7-7f-pre3 because Download master don't work fine.
    what is the method?

    a fat32 HDD is ok for CTORRENT?

    (sorry for my english)

    thank you for help

  13. #13
    Quote Originally Posted by willy132fr View Post
    'am a newbies and i'll would install CTORRENT with oleg's firmware 1.9.2.7-7f-pre3 because Download master don't work fine.
    what is the method?

    a fat32 HDD is ok for CTORRENT?

    (sorry for my english)

    thank you for help
    recently, i try the HOW TO but system (with putty) says me:

    "can't write" when i try <echo "#!/bin/sh" >> /usr/local/sbin/post-boot> , have you an idea?

  14. #14
    Join Date
    Aug 2006
    Location
    CZ, Olomouc
    Posts
    7
    Hi, i have also some small problems to get all this nice stuff working.

    I proceeded all this tutorial and some problems was mentioned here...

    I updated to WL500gp-1.9.2.7-7f-pre4.trx today my WL500gP.
    Restart and all settings about memory is well.

    Post-boot doesn't work to me automaticky. So when i want ctorrent get working i have to start this sctipt after reboot.
    I didn't find any mistake in my way.
    When I'll do post-boot manualy, I can access to Torrent admin but links source, work and target is not accesible in browser. May be some link is written wrong but I don't know where .
    May by it's relate with other problem... samba seems to have problem. I cannot connect to router by win sharing by lan. I tried also settings by r0kanon.

    May be somebody can send list of all installed files with adjusted rights?
    It should be helpful but I think I have it wll .

    Thank You.
    WL500gp-1.9.2.7-7f-pre4@WL-500gP & DeLock USB 2.0 IDE Converter with WD1200BB... seems that I'm trying to work on this stuff...

  15. #15
    Join Date
    Aug 2006
    Location
    CZ, Olomouc
    Posts
    7
    Quote Originally Posted by willy132fr View Post
    recently, i try the HOW TO but system (with putty) says me:

    "can't write" when i try <echo "#!/bin/sh" >> /usr/local/sbin/post-boot> , have you an idea?
    Try to write it with nano... or other editor directly into post-boot file.
    Or may be you have wrong rights to write into this file.
    WL500gp-1.9.2.7-7f-pre4@WL-500gP & DeLock USB 2.0 IDE Converter with WD1200BB... seems that I'm trying to work on this stuff...

Page 1 of 9 123 ... LastLast

Similar Threads

  1. Asus WL-500g Premium и шлюз
    By Grig_oriy in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 106
    Last Post: 15-05-2012, 21:43
  2. Установка svn на Asus WL-500g Premium
    By aka_mev in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 63
    Last Post: 19-03-2012, 21:01
  3. Сборка пакетов под WL-500g Premium
    By angel_il in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 127
    Last Post: 24-11-2011, 13:28
  4. WL-500g Premium died After Upgrading Firmware
    By acidbrain in forum WL-500gP Firmware Discussion
    Replies: 166
    Last Post: 17-06-2011, 08:59
  5. HOWTO use your WL-500g as IPv6 router
    By phedny in forum WL-500g/WL-500gx Tutorials
    Replies: 8
    Last Post: 17-02-2008, 08:19

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
  •