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:
Код:
mkdir /opt/etc/samba
Create samba-config-file with nano or vi:
Код:
nano /opt/etc/samba/smb.conf
Content of /opt/etc/samba/smb.conf:
Код:
[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:
Код:
nano /opt/etc/init.d/S97Samba
Content of /opt/etc/init.d/S97Samba:
Код:
#!/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:
Код:
chmod 755 /opt/etc/init.d/S97Samba
Save changes in flash and reboot:
Код:
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.
Код:
ipkg install ctorrent
ipkg install torrent
The following directories are necessary:
Код:
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:
Код:
nano /usr/local/root/httpd.conf
Content of /usr/local/root/httpd.conf
Код:
A:*
/cgi-bin:admin:admin
.au:audio/basic
.asp:text/html
You have to start the http daemon in one of the start-scripts:
Код:
nano /usr/local/sbin/post-mount
Add following line to /usr/local/sbin/post-mount
Код:
#!/bin/sh
/usr/sbin/busybox_httpd -p 8008 -h /opt/share/www
Now you can edit the torrent configuration file:
Код:
nano /opt/etc/torrent.conf
Mine looks like this:
Код:
##########
# 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:
You can use it for example like this:
Код:
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:
Код:
nano /usr/local/sbin/post-boot
Add the following line to post-boot file
Код:
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:
Код:
/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