Setting up My DNS-323 NAS

NOTE (7/7/2012) : I recently upgraded to ffp 0.7. For the most part, I simply followed the well-written directions posted here. I am happy to report that the transition was indeed smooth and painless! If you are on the fence whether to upgrade (or are doing a fresh ffp install), I strongly recommend that you use ffp 0.7. Updated versions of all software mentioned here (Telnet, SSH, PHP, Lighttpd, Transmission) work the same, if not better. I love the convenience offered by the new Slacker tool. Also, Midnight Commander is a delight!

I have been deliberating for quite a while about buying an increased capacity hard drive to store my ever expanding digital content. After a lot of research, my focus gradually shifted to purchasing a NAS RAID device instead. It just makes more sense. The ubiquity of these systems coupled with drastically reducing hard drive prices makes it a no-brainer.  I finally settled on a DNS-323. The ability to install pretty much ANY Linux based server on this miniature device makes it an awesome buy! It turns out that the folks at D-Link actually realize the benefits of having such a robust community around their product and tweak their firmware accordingly.

I also purchased two 1 TB Samsung green drives (HD103SI) to store all my data (in RAID1)

Documented below are all the steps my NAS went through – Most of this information has been gathered from various online websites.

Step 1: Initial setup

After hooking up my NAS (without any drives) into my router, it was assigned a random IP address by the DHCP server in my router (WPN824). The first order of business was to assign a static IP so that my NAS is assigned the same address every time. There are two ways this can be done

  1. Setting up a static IP address in the DNS-323 web interface (this would hardcode an IP address in the device and could present a problem if a need arose to attach it to another router)
  2. Use the ‘Address reservation’ feature of the router to assign a constant IP address to the NAS. This the approach I took. My router had an easy way to set this up (WPN824 web interface->LAN Setup->Address Reservation.. I assigned my NAS an IP of 192.168.1.4 as shown below). Note that you will need to power cycle your router in order for the new IP addresses to be assigned.

image

Once the IP is fixed, the NAS can be accessed by pointing your browser to the assigned IP (http://192.168.1.4 in my case). The next step was to check and upgrade the firmware (this is strongly recommended by D-link). My DNS-323 came with firmware version 1.07 installed. A quick look on the D-Link website revealed that the most recent firmware is 1.09. An upgrade was in order

Note that a firmware upgrade must never be done using a computer hooked up to the router over a wireless link. I downloaded the latest firmware on my desktop, expanded the zip file and uploaded it from the web interface (Tools->Firmware). The upgrade was a smooth process. Graphic below:

image

Ok.. Now that the firmware was upgraded, I powered down the system and inserted my two SATA drives in the provided slots. The NAS was then powered back up. On opening up the web interface, my drives were recognized and displayed.

I decided to go with RAID 1 and format my drives to the more stable EXT3 file system.

image

Your NAS is designed to send you an email when several pre-defined events occur. Lets go ahead and set that up in the admin screen. I have it configured to send emails to my Gmail account.. Working settings below:

image

That’s it! Basic setup is complete. After you restart, your drive (named Volume_1) will be available to all computers on your LAN.

Step 2: Preparing Your NAS for Awesomeness!

What you did in step 1 covered the bare minimum of what your NAS is capable of. This step will reveal the sheer power of this tiny device!

There is a nifty little package named fun_plug which when installed on the DNS-323 opens up the system to numerous software installations. The firmware installed by DLink actually looks for this plug-in in the last phase of the boot up process (and loads it if found).

Setup of fun_plug is as simple as downloading the two packages into Volume_1 and restarting your NAS. As of this writing, the most recent version of fun_plug is 0.5 and it is available at http://www.inreto.de/dns323/fun-plug/0.5/. Do read all the text/instructions on this website for more information regarding the packages bundled with fun_plug.

Simply download the last two files named fun_plug and fun_plug.tgz into the Volume_1 shared drive. Note that you SHOULD NOT unzip/untar the files yourself.

Restart your DNS-323. The fun_plug.tgz file is unpacked (into a directory named ffp) and the .tgz file is deleted. A telnet server is also started so that you can log into your NAS and work with the files on the device. The package you just installed contains several goodies.. The most notable among them being:

  1. Lighttpd Web Server
  2. OpenSSH Secure Shell
  3. RSync File Transfer Utility

I prefer using windows for setting up fun_plug on my DNS-323. In order to login to our NAS box, we need a telnet client. Windows 7 comes with a Telnet client but it needs to be turned on (Control Panel->Programs->Add/Remove windows features):

image

After the client is setup , click on start and type in “Telnet” in the search box. In order to connect to the DNS-323, type in

>o 192.168.1.4

This literally means “Open a connection to 192.168.1.4”. Installing the fun_plug package started a telnet server on the NAS and this is what allows us to login to the box. Note that the telnet connection does not prompt for any passwords and logs you in with root privileges (this is inherently insecure and we will take steps to close this vulnerability in the future).

image

Step 3: Activating Lighttpd web server

Not being content with the ability to access our shared folders on the internal LAN, we are now going to transform our little NAS box into a web server.

Lighttpd is an open source, super-tiny, high-performance web server. What’s more, it comes bundled with fun_plug.. all that is required to be done is to setup a few config parameters:

I created a folder named “share” on volume_1 of my NAS, and I would like for the entire “share” folder (and everything under it) to be web accessible (In case I want to view/download something over the internet, I would like the option to do so). In the final phase of our setup, we will be securing our web server.. so, don’t worry too much about it now.

Telnet into your NAS (o 192.168.1.4 from windows telnet client) and type in the following commands:

cd /ffp/etc                                      //change directory to the /ffp/etc folder
cp examples/lighttpd.conf .        //copy the lighttpd.conf file from examples into current directory
cd /mnt/HD_a2                           //navigate to /mnt/HD_a2.. our shared drive home..
mkdir logs                                    //create directories for the logs

Now, we can customize the lighttpd.conf file that we copied into /ffp/etc

vi /ffp/etc/lighttpd.conf

(vi is the default editor and it takes a bit of getting used to.. Please make sure you know the basics before opening vi.. ‘i’ for insert, ‘esc’+’:wq’ for ‘save and exit’, ‘esc’+’:q’ for ‘exit without saving’ etc.)

Edit the following lines establishing document folders and replace them with the intended folder paths:

server.document-root = “/mnt/HD_a2/share/”
server.upload-dirs = ( “/mnt/HD_a2/tmp” )
server.errorlog = “/mnt/HD_a2/logs/error.log”

#### accesslog module
accesslog.filename          = “/mnt/HD_a2/logs/access.log”

Now, we are ready to start off our webserver:

cd /ffp/start                                        //navigate to the ‘start’ folder.
chmod a+x lighttpd.sh                       //grant execute permissions to all
sh /ffp/start/lighttpd.sh start         //start up the web server!

By default, it activates the web server at port 8080. So, if all went well, you should be able to navigate to http://192.168.1.4:8080 on your browser and see the existing folders.

Installing PHP (Updated 4/2/2011):

PHP is not installed as part of fun_plug by default, but you can get it from the extra-packages repository from here (php-5.2.9 as of this writing). Telnet into your NAS:

#wget http://www.inreto.de/dns323/fun-plug/0.5/extra-packages/net/php-5.2.9-1.tgz

Install:

#funpkg -i php-5.2.9-1.tgz

To use PHP with the lighttpd-webserver, you have to use the appropriate configuration file template (provided in the examples directory). Note that if you customized your earlier .conf file, you need to make a backup copy before replacing your existing config file:

#cp /ffp/etc/examples/lighttpd.conf-with-php /ffp/etc/lighttpd.conf

Also copy the recommended php.ini file to the appropriate folder:

#cp /ffp/etc/examples/php.ini-dist /ffp/etc/php.ini

Restart lighttpd to load the new configuration:

#sh /ffp/start/lighttpd.sh restart

You now have all the goodies that php has to offer (you may want to create a phpinfo file in your web folder to test before proceeding). A simple blog application is easy to setup. Head over to Flatpress and grab a copy (it is a beautiful minimalist flat-file based blogging platform that works very nicely on our NAS). Extract it and save it to your web folder (say /www/).

NOTE: You need to include ctype.so in your php.ini in order to play nice with Flatpress:
#vi /ffp/etc/php.ini

uncomment (or add) the following line in the extensions section:
extension=ctype.so

If all went well, you will be able to navigate to http://192.168.1.4:8080/flatpress and finish setting up your personal blog server!

Step 4: Installing Transmission BitTorrent Client

DNS-323 does come with an inbuilt bit torrent client. But it completely pales in comparison to the features and interface of ‘Transmission’. In addition, the UI of transmission offers us the ability of selecting individual files within the torrent, and the ability to automatically download torrents placed in a designated folder. Setup is quite simple. Most of the work is already done.. we just need to download pre-compiled libraries and setup appropriate config options:

Telnet into your NAS – Open the windows telnet client and type in

o 192.168.1.4

Download and setup the uclibc library (C library optimized for embedded systems)

# cd /mnt/HD_a2
# wget http://www.inreto.de/dns323/fun-plug/0.5/packages/uclibc-0.9.29-7.tgz
# funpkg -i uclibc-0.9.29-7.tgz

After the install step above, REBOOT the NAS. Next, get the libcurl and transmission packages, and install them

UpdateFeb 12,2012: Links have been updated to install transmission 2.42 – the most recent version. If you already have an earlier version running, refer to this website for detailed upgrade instructions. Scroll down to the section labeled “Upgrading from previous version of Transmission”. Follow the directions exactly and it should be effortless.

# wget http://kylek.is-a-geek.org:31337/files/curl-7.18.1.tgz
# wget http://kylek.is-a-geek.org:31337/files/Transmission-2.42-1.tgz
# funpkg -i curl-7.18.1.tgz
# funpkg -i Transmission-2.42-1.tgz

Make Transmission start up automatically when NAS boots up.. Then start and stop it so we can edit the config file created by transmission:

# chmod a+x /ffp/start/transmission.sh;
# sh /ffp/start/transmission.sh start
# sh /ffp/start/transmission.sh stop

Edit transmission settings:

# vi /mnt/HD_a2/.transmission-daemon/settings.json

Create the following directories to serve as the download, incomplete and watch directories for our torrent files – The transmission client automatically downloads .torrent files placed in the ‘transmission-watch’ folder.

# mkdir /mnt/HD_a2/share/transmission-incomplete
# mkdir /mnt/HD_a2/share/transmission-watch

Make the following changes in the settings.json file:

“download-dir”=”/mnt/HD_a2/share/transmission-download”
“rpc-password”:”mypassword”
“rpc-username”:”myusername”
“rpc-whitelist”:”*.*.*.*”
“rpc-whitelist-enabled”:true
“watch-dir”:”/mnt/HD_a2/share/transmission-watch”
“watch-dir-enabled”:true

Transmission’s ‘watch-dir’ uses a feature of the host OS named ‘inotify’ in which, the directory automatically raises an event when a change occurs. This is very different from (and superior to) the mechanics of a ‘cron’ job.
Update 7/21/10 : I ended up disabling the ‘watch-dir’ feature of transmission as it was preventing hard drive spin-down and causing my NAS to overheat.

These settings also create a userid and password for access (I have my rpc-whitelist set to *.*.*.* as I like the flexibility of initiating BT transfers from anywhere on the internet. You can easily restrict access to the transmission web interface to only your LAN if you specify rpc-whitelist as ‘192.168.*.*’).

Restart the NAS. You should be able to access the transmission web interface at http://192.168.1.4:9091 (you will be prompted for the username and password that you setup in the json config file. Also note that even though you entered the password in plaintext in the json file, it will be encrypted and stored when transmission is restarted)

Step 5: Setup SSH

While telnet is a super lightweight protocol that has served us well this far, we must move quickly to password protect our dns-323 box. Telnet was designed to work within a private network and not across a public network.. but we have much grander plans for our DNS-323! Ssh or “secure shell” provides an encrypted channel with similar functionality as telnet.

ssh, however does not permit logging in without a password. So, lets first fix that problem by assigning a password to the ‘root’ user.

By default, the DNS-323 comes with 3 users – root, admin and nobody. This can be observed by executing:

cat /etc/passwd

Note the ‘x’ in the password field indicating use of  a shadow password file.

image

We can assign a password for ‘root’ using the following commands:

pwconv             //refresh the shadow password suite
passwd             //change the passwd of the logged in user

image

Next, remember to change the default shell of the root user

usermod -s /ffp/bin/sh root

and then, save the whole thing to the ROM

store-passwd.sh

image

(The default ‘ash’ shell is an extremely stripped down shell and does not offer much functionality. If by chance you missed the usermod step above,  on logging in, you will be in the ash shell with the following  display:

BusyBox v1.00-pre1 (2009.05.07-06:36+0000) Built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

And, nothing works after this.. You need to enter the unlock code which is 5784468, and hit the enter key. Then type the usermod and store-password commands shown above. Thanks to http://forum.nas-tweaks.net/index.php?action=recent;start=20 for this little tip.. I almost thought I had to redo my NAS fun_plug install!)

Now that the root user has a password, we can go ahead and setup ssh (ssh REQUIRES a password)

cd /ffp/start                              //navigate to the /ffp/start folder
chmod a+x sshd.sh                  //allow all to execute the ssh daemon
./sshd.sh start                         //start the ssh server!

image

It will do its thing and finally setup the server. We are now ready to use an SSH client (like putty) to secure our communications with the DNS-323.

image

You will be prompted with a security message the first time you log in.. Click on the ‘Yes’ button.

image

Yeah connected via SSH!

image

Now, it is safe to disable the telnet connection.. we don’t want to leave the security hole unpatched in our box! (Update Nov 14, 2010 : A power failure caused my NAS to lose root password information.. This made it impossible to log on via SSH.. Also, since “root” is protected, it is not possible to go back into your ffp/start directory and restart telnetd!

So, unless you perceive a REAL threat from leaving your telnetd running, I strongly recommend you leave it as is)

cd /ffp/start                                 //navigate to /ffp/start
chmod a-x telnetd.sh                 //take away execute permissions for telnet

Restart your box.

Step 6:Securing Lighttpd

Our default web server is wide open for anyone to access.. It might not be desirable in some cases. You can setup directory level authentication. As always, telnet or ssh into the DNS-323:

cd /ffp/etc/

vi lighttpd.conf

uncomment:
#                               “mod_auth”,

Add following lines:

auth.backend = “htdigest”
auth.backend.htdigest.userfile = “/ffp/etc/lightpwd”
auth.debug = 2
auth.require               = ( “/” =>
(
“method”  => “digest”,
“realm”   => “Secure Pages”,
“require” => “valid-user”
)
)
Create password file ‘/ffp/etc/lightpwd’:
  cd /ffp/etc/
touch lightpwd
wget http://81.216.140.39/dns-323/packages/htdigest.sh

echo `sh htdigest.sh ‘myusername’ ‘Secure Pages’ ‘mysecretpassword’` >> lightpwd

Restart the NAS.

Step 7: Enable FTP

The DNS-323 comes with an inbuilt FTP server. Once enabled, it will permit you to upload (and download) files remotely.

Activating the FTP server requires you to create a userid using the DNS-323 web interface. Navigate to http://192.168.1.4/ and login using your admin credentials. Click on the “Advanced” tab and setup a new user:

image

Once the ftp user is setup, click on the “ftp server” option and setup the folder permissions for the user. Hit the ‘Add’ button when done:

image

Next up, FTP server settings:

image

The “Report external IP in Passive mode’” checkbox MUST  be checked.

Leave the other defaults…That’s all there to it. FTP server is now started on port 21.

I use FireFTP (firefox plugin) to connect with my NAS. Here are my settings:

image

Note that my host is set to “my.dnsalias.com”. this is the globally accessible DNS address that I setup so I can access my NAS box from anywhere in the world! (after all, it really does not make sense using FTP to transfer files over a LAN!) Dynamic DNS is a really neat feature offered for free by dyndns.com. This is described in the next section.

image

The “Passive mode” box is checked and security is set to “Auth TLS”. This is the most secure configuration, and all data to and from your server will be encrypted. Before you try and connect, note that you must also open ports 55563-55663 on your router (Take a look at the port forwarding screens shown in the following section for more information)

Most modern browsers allow you to view/download files on your ftp server.. so, you could open up your browser and navigate to  ftp://myserver.dnsalias.com to view files on your NAS.

You can also connect to your ftp server using windows explorer. Right click on  “My Network Places” on windows explorer, Select “Map network drive”.. then click on the “Sign up for online storage..” (yeah..not the most intuitive.. I agree!)

image

Then, follow the wizard..

image

Enter your ftp address in the dialog box:

image

Make sure you uncheck “Anonymous access”. Enter your username and password when prompted. Now, you have the familiar windows interface to drag and drop files/folders into your NAS box.

Using a Dynamic DNS & Port Forwarding

This is the final phase of our NAS setup that will truly expose your NAS to the world.

So far, we have been accessing our NAS using the internal IP assigned by our router (192.168.1.4). In order to access our NAS from outside the LAN, we need to first setup a DNS name (i.e. a Domain Name Server Name) for our box. Head over to http://dyndns.com and setup an account (it is a free service!).

Update 4/3/2011: DLink also offers a free dynamic DNS service (in collaboration with dyndns)  – head over to https://www.dlinkddns.com, create an account and setup your own domain name. In fact, I recommend creating your domain name at dlinkddns because it never expires!

The name that you select (say my.dnsalias.com) will now point to your router IP address (Note that in order to test if the newly setup dns redirection is functional, you should be on a computer OUTSIDE your LAN)

The next crucial step that ties everything together is to setup “Port forwarding” on your router so that requests to your router are forwarded to the NAS box at 192.168.1.4. This is a feature provided on most routers. Here is how I set it up on my WPN824:

1. Open up the admin interface of the router (mine is at 192.168.1.1)

2. Click on “Port forwarding/port triggering”.. Here’s how I setup various ports to forward to my NAS:

image

Port forwarding is a simple concept.. What the first line literally means is “Please forward all requests that come into port 8080 of the router to port 8080 of the device at 192.168.1.4”. If the start-port and end-port differ (like in the case of FTP and FTP_Passive above), the router forwards requests received in that PORT RANGE to the corresponding ports on the designated server.

So, after the above rules are setup, the addresses to access the various servers that we have setup are:

URL SERVICE
http://myserver.dnsalias.com:8080 lighttpd on NAS
http://myserver.dnsalias.com:8080/flatpress flatpress service on NAS
http://myserver.dnsalias.com:9091 transmission web-client on NAS
http://myserver.dnsalias.com (port 21) FTP server on NAS

By The Way…

Always be mindful of the fact that the DNS-323 is extremely underpowered (It runs on 64MB of RAM on a 500Mhz clock!). Even with the above installations, we are stretching its limits. It was not designed to house databases or index terabytes of images or do video encoding/decoding on the fly. You are asking for trouble if you go overboard in your customization – After all, we do not want to take away from its MAIN function which is keeping your data safe.

NAS free memory under minimum load (Just after startup):

image

And, here’s a snapshot of my NAS memory utilization under load (transmission running, and RAID 1 active). Note that I have just 1.5M of ‘free’ memory (but 0 swap used). If you install too many extras, and exceed your physical RAM, thrashing will result, and the processor will spend all its time paging.

image

It has been a long journey this far.. but I now have my NAS setup exactly the way I want 🙂

53 thoughts on “Setting up My DNS-323 NAS

  1. Wow – great job. Out of all the dns 323 setup instructions, I found yours the most useful. I was stuck specifically at the ‘busybox’ login problem. Thanks for taking the time to post this.

  2. Thanks so much for this post! It has helped me breath new life into my old dns-323 that I had abandoned for use as backups since I couldn’t ssh to it. I was using portable usb drives instead. Now I’m using the 323 NAS with rsync via ssh and very happy!

  3. Thanks so much for this tuto.
    I’m stuck in the step 3. Could you please give me more details of what we should write in Telnet?
    Could you put a print screen of how it should be like for the step 5?
    Sorry for this question but i just a rookie.

    Thanks
    Rod

  4. This is a great post! I was originally just looking for confirmation that fun_plug would work with firmware 1.09 but I ended up following the rest of your guide for SSH setup and more. This has saved my rear in upgrading my Raid1 hard disks! Very much appreciated.

  5. Hi Expert,
    Could you please sort out my D-Link DNS-323 log on problem?. I have a LAN network of 10 PCs with Workgroup of Windows XP and Server 2003. I already setup D-link DNS-323 for user sharing. But whenever any user re-starts its system its always looking for log username and password. Moreover main problem is I gave a full access to folder on NAS storage but it doesn’t give access to that folder.
    As an Example >> Thers is one ABC Folder on NAS device there is another subfolder XYZ folder in ABC folder. User A has full access to both folders but it gives access to ABC but not to XYZ folder.
    But same thing is not happen with UserB. Please help I don’t know where is permissions are conflicting in this dive.

    Regards,

    Sanjay

    1. Hi Sanjay,
      I used ftp://files.dlink.com.au/products/DNS-323/REV_A/SetupGuides/How_to_set_folders_and_permissions.pdf as my guide to setup networking from XP and have not had a problem. Couple of pointers : 1. Windows sends the userid and password of the logged in user to DNS. So, if there is no match, a login prompt will be displayed. 2. Permissions are inherited from the parent folder. The above document provides and example of how this works. Good luck!

  6. Thanks for the excellent tutorial. I wasn’t sure with the ssh login and your tutorial helped me run SSH successfully. Great Job. Thanks!!

  7. MNShankar: This is a great post. I was stuck with the ssh shell – nowhere is there a mention of the “secret” unlock code.

    Can you help me with the following problem: It seems that the usb functionality (attaching a line printer, SharePort utility etc) is missing or somehow locked out. The SharePort utility says: “no servers discovered on the network”. (Ditto for “SX Virtual Link”). Is there a way to troubleshoot it? Which daemon should be up on the DNS-323 in order to enable this functionality?
    TIA – Gail

  8. Thank you for this post! I have a dns-323 gathering dust – I had no idea it could do this much. SSH and Rsync are going to bring mine back to life!

    Dale

  9. Hi Jason
    A couple of things..
    1.Make sure that the transmission-daemon is infact running (ps -el) – you should see 4 processes.
    2. Make sure that the json file is error free
    3. Try with a different browser (IE8 sometimes refuses to load it without going into compatibility view)
    If none of these work, I would recommend a reinstall. Good luck!

  10. Hi
    Thanks for this great list works the job.

    I am looking to setup a forum on my nasbox.

    Has anyone set one up or has come across info like this one.

    Thanks again.

  11. GREAT TUTORIAL..I’m curious if you ever got your DNS-323’s USB port to work with an external hard drive. I’m aware there is a way to do that but it would be great to see how you did it. I know squat about Linux and programming so the wikis available are a little confusing. I’m however very computer savvy. THANKS in Advance!

    1. Hi,
      Thanks for your message.
      Yes.. In fact, I have moved my fun_plug to an 8 gig usb drive. I then marked /mnt/usb as the storage location for transmission downloads. That way my drives don’t have to spin for overnight downloads!
      I followed instructions here exactly to get this up and running:
      http://bfg100k.blogspot.com/2008/11/upgrading-ffp-05-and-moving-it-to-usb.html
      Note that I had to preformat my usb drive to ext3.

      And, if you are interested in just the external USB option, here is a blog detailing that:
      http://www.horto.ca/?p=27

      Good Luck!

  12. Hi, great instructions, thanks. I have just taken delivery of my DNS 323 so will be applying the above as soon as I have the time!

  13. Man this is a sweet tutorial! I was looking all over for exactly this when I first bought my 323. Can’t wait to get all this goodness up and running.

    Great job!

  14. Hi. Really love this- have had a great time modding my 323. However, just have one problem: transmission seems to generate loads of Internet traffic (500mb per day) even when not downloading anything as far as I can tell. I don’t know what it’s doing or how to stop it. Tried to use prtg but I’m clueless. Any ideas?

    Thanks in advance, and keep the updates coming

    Cheers
    Will

    1. Hi,
      It is probably uploading torrents.. You may have a lot of peers connected to your NAS ..You can throttle upload speeds if it is slowing down your connection (click on the little turtle icon on the status bar).

      1. Even when all torrents are inactivated, the traffic continues. It only stops if I stop the transmission daemon. What do u reckon the problem might be?

  15. i just set up several of the things as you describe above, but after setting up SSH, I am no longer to write files from my Windows 7 network browser thing. I think it may have something to do with assigning a root password (?). is that correct, and do you know how I can enable drag and drop file writing from windows?

    Thanks!

    1. Hi,
      Setting up ssh should not affect samba (which is the service that the NAS uses to communicate with Windows) – you can always disable/stop SSH (REMEMBER to enable telnet), restart the NAS, and check. Also, there is nothing special required to make Drag and drop file operations work.
      Is the error message you get related to user privileges?

      1. yes – it says in windows 7 “you need permission to perform this action.” i guess this is from assigning the root password. i’ll have to keep looking in 7 to see how i can connect using a password.

        thanks!

      2. so I ended up “chmod 777”-ing everything, and it’s working now. i think those are the default permissions right?

  16. Thanks for this walkthrough. I got through most of it and am having some difficulty getting the transmission settings edited.
    Once I get it open, I can’t save the changes. I tried esc’+’:wq’ and :wq but it doesn’t work. When I try to login using the Ip address:9091 after a reboot I get a ‘Access Forbidden’ error.
    How do I save the changes?
    Also, when I try the next step (#mkdir /mnt…etc) it says it cannot create the directory because no directory exists. Am I missing something?
    Thanks in advance,

    David

      1. Thanks again. I managed to stop the daemon and then save the changes. It’s still not working. Do you know what the command to generate a log of my transmission .config file is?

        I can then paste it here….

    1. Also, the ‘/share’ subdirectory under /mnt/HD_a2 was created by me.. you probably did not create that prior to issuing the mkdir commands.

  17. Can you please have a look at my config log and let me know what’s missing?

    / # chmod a+x /ffp/start/transmission.sh;
    / # sh /ffp/start/transmission.sh stop
    Stopping transmission-daemon
    killall: transmission-daemon: no process killed
    / # vi /mnt/HD_a2/.transmission-daemon/settings.json
    “ratio-limit”: 2,
    “ratio-limit-enabled”: false,
    “rename-partial-files”: true,
    “rpc-authentication-required”: false,
    “rpc-bind-address”: “0.0.0.0”,
    “rpc-enabled”: true,
    “rpc-password”: “mypassword”
    “rpc-port”: 9091,
    “rpc-url”: “/transmission/”,
    “rpc-username”: “myusername”
    “rpc-whitelist”: “192.168.0.15”,
    “rpc-whitelist-enabled”:true,
    “script-torrent-done-enabled”: false,
    “script-torrent-done-filename”: “”,
    “speed-limit-down”: 100,
    “speed-limit-down-enabled”: false,
    “speed-limit-up”: 100,
    “speed-limit-up-enabled”: false,
    “start-added-torrents”: true,
    “trash-original-torrent-files”: false,
    “umask”: 18,
    “upload-slots-per-torrent”: 14
    }
    / # sh /ffp/start/transmission.sh stop
    Stopping transmission-daemon
    killall: transmission-daemon: no process killed
    / # vi /mnt/HD_a2/.transmission-daemon/settings.json
    {

    “alt-speed-down”: 50,
    “alt-speed-enabled”: false,
    “alt-speed-time-begin”: 540,
    “alt-speed-time-day”: 127,
    “alt-speed-time-enabled”: false,
    “alt-speed-time-end”: 1020,
    “alt-speed-up”: 50,
    “bind-address-ipv4”: “0.0.0.0”,
    “bind-address-ipv6”: “”,
    “blocklist-enabled”: false,
    “blocklist-url”: “http://www.example.com/blocklist”,
    “cache-size-mb”: 2,
    “dht-enabled”: true,
    “download-dir”: “/home/nobody/Downloads”,
    “encryption”: 0,
    “idle-seeding-limit”: 30,
    “idle-seeding-limit-enabled”: false,
    “incomplete-dir”: “/home/nobody/Downloads”,
    “incomplete-dir-enabled”: false,
    “lazy-bitfield-enabled”: true,
    I /mnt/HD_a2/.transmission-daemon/settings.json 1/64 1%
    “bind-address-ipv4”: “0.0.0.0”,
    “bind-address-ipv6”: “”,
    “blocklist-enabled”: false,
    “blocklist-url”: “http://www.example.com/blocklist”,
    “cache-size-mb”: 2,
    “dht-enabled”: true,
    “download-dir”: “/home/nobody/Downloads”,
    “encryption”: 0,
    “idle-seeding-limit”: 30,
    “idle-seeding-limit-enabled”: false,
    “incomplete-dir”: “/home/nobody/Downloads”,
    “incomplete-dir-enabled”: false,
    “lazy-bitfield-enabled”: true,
    “lpd-enabled”: false,
    “message-level”: 2,
    “open-file-limit”: 32,
    “peer-congestion-algorithm”: “”,
    “peer-limit-global”: 240,
    “peer-limit-per-torrent”: 60,
    “peer-port”: 51413,
    “peer-port-random-high”: 65535,
    “peer-port-random-low”: 49152,
    “peer-port-random-on-start”: false,
    “peer-socket-tos”: “default”,
    “pex-enabled”: true,
    “port-forwarding-enabled”: true,
    “preallocation”: 1,
    “prefetch-enabled”: 0,
    “ratio-limit”: 2,
    “ratio-limit-enabled”: false,
    “rename-partial-files”: true,
    “rpc-authentication-required”: false,
    “rpc-bind-address”: “0.0.0.0”,
    “rpc-enabled”: true,
    “rpc-password”: “mypassword”
    “rpc-port”: 9091,
    “rpc-url”: “/transmission/”,
    “rpc-username”: “myusername”
    “rpc-whitelist”: “192.168.0.15”,
    “rpc-whitelist-enabled”:true,
    “script-torrent-done-enabled”: false,
    “script-torrent-done-filename”: “”,
    “speed-limit-down”: 100,
    I /mnt/HD_a2/.transmission-daemon/settings.json 53/64 82%

    1. Hi David,
      The best way to debug this is to
      1. Stop transmission
      2. Delete the settings.json file
      3. Restart transmission.
      A new working settings.json file will be created.. you can then tweak it as required.

      1. First stop transmission:
        #./ffp/start/transmission stop
        Next delete the settings.json file:
        #cd /mnt/HD_a2/.transmission-daemon
        #rm settings.json
        When you restart transmission (./ffp/start/transmission start), the default settings.json file should be recreated.

  18. You obviously know your stuff! Typing at a command prompt utterly terrifies me. Great post! I may try it since I want to host a website locally with permissions to only friends/family as well as utilize the FTP, music streaming and shared folders options. That being said, is there any chance of an even easier way? Or am I being optimistically ignorant in wanting a simple Windows type, graphically simple program that does it all? Regardless of possibility, your instructions were so great, I may actually try it! Well done.

  19. hey this is an extreamely GREAT post.. thanks for taking time posting this guide. would you mind helping out (sorry to ask for more..) on how to create/enable an authentication logging for dns 323? i have the fun plug installed, ssh enabled etc.. i was just wondering that it would be helpful to see if there are login failure attempts on my box, eg, when ssh is open to the outside world…
    cheers!

    1. Hi,

      Thanks for your comment. Here is how you can setup ssh to log messages:

      1. Edit ssh daemon to activate logging: telnet/ssh into your device and navigate to your sshd installation directory and edit sshd_config (which, in my case looks like: root@dlink-9D0942:/mnt/usb/ffp/etc/ssh# vi sshd_config)

      2. Uncomment the following lines in the file :

      SyslogFacility AUTH

      LogLevel INFO

      3. Navigate to your “ffp” start directory and enable syslogd.sh to start automatically by setting the correct permissions like so: root@dlink-9D0942:/mnt/usb/ffp/start# chmod 755 syslogd.sh

      4. Restart your NAS device

      5. Navigate to /var/log and view the file named “messages” (root@dlink-9D0942:/var/log# vi messages)

      6. You will find auth messages from sshd logged in it.. alternatively you can use the command “cat messages|grep auth” to display only the authentication messages.

      1. this is terrific! i can now see auth (and file system i think) logs registering… moving forward, how can we make a script that continously monitor /var/log/messages then send an email alert for any failed authentication? you have already given your left hand, sorry for asking for your right as well 😦 ….. mnshankar you are the man!

  20. Hey!
    First of all, congratulations for this amazing tutorial!

    But i’m stucked in the php part…

    When i wirte:

    wget http://www.inreto.de/dns323/fun-plug/0.5/extra-packages/net/php-5.2.9-1.tgz

    The file downloads only till 31 % and than the following message appears:

    get: short write

    When i try to download it again, all i receive is that:

    Connecting to http://www.inreto.de (217.119.59.48:80)
    wget: can’t open ‘php-5.2.9-1.tgz’: File exists

    After that, it’s impossible to acces the hard drive… and because of that i must restart the dns 323…

    I’m new to all this prompt thing…
    Can you please help me?

    1. Hi Pedro,
      Thanks for your note.
      1. Make sure you are logged in as root (if you are using telnet, you are using root privileges by default)
      2. Make sure you are in a directory that has sufficient space (for ex: in /mnt/hd_a2)
      Hope this helps.

  21. Hey, great instructions compared to what ive seen on the net, but im stuck, my lighttpd wont start, i get an error, i follow the exact directions, im running firmware 1.10 could that be the issue? i can funplug it and telnet into it no problem, all is good except when i run this line “sh /ffp/start/lighttpd.sh start ” then i get a busybox error, i check the link like you suggested but nothing, get page error on browser

  22. Excellent tutorial!!! I had a DNS-321 (same as DNS-323 for all intents and purposes) set up just like you described it in your post, and had been running for at least 3 years without a hitch! A few days ago, I couldn’t access either drive. I also noticed that the front power button had stopped working. I suspected that the primary disk (Volume_1) had failed …yes the one with the fun_plug utilities. I unplugged the power from the NAS and then plugged it back on, and reconnected to it. However, this time I saw that Volume_1 was not accessible but Volume_2 was fine. Now the problem is this: I had the 2 drives configured as individual disks and relied on rsync (using a cron job) to backup data from Volume_1 to Volume_2 nightly. Why trying to manually create another backup of Volume_2 yesterday (by coping files to my external drive via my desktop), I found that some files/directories (which had been backed up from my mac, another machine in my network) had ownership set to “root” or “nobody”, and I am not sure why. The directories have only root privileges, and thus one needs to be logged in as root to change their permissions. Now I have this Volume_2 with directories having root only permissions, and I’m unable to log in as root because of the failed Volume_1 which had the ssh, telnet etc. Would installing the drive called Volume_2, in the primary bay (Volume_1) , and then installing fun_plug on it work? OR would installing a new hard drive in primary bay (Volume_1), adding fun_plug to it to get root access again be the preferred method? Is this even possible? I’m open to any other suggestions as well. Thanks in advance!

  23. is it paossible to rucn a chat client on our DNS-323? I would love to be able to set up a client that I can use through a web based GUI (similar to the way I am using transmission)

      1. Hi there, thanks for the reply, but that is not really what I meant, I want to run an irc chat client, not host a chatroom.

  24. Having problems with Flatpress.

    I get the following error:

    Fatal error: Call to undefined function ctype_alnum() in /mnt/HD_a2/share/www/flatpress/setup/lib/main.lib.php on line 105

    I added “;extension=ctype.so” in php.ini (under dynamic extension) but still no go, also tried ;extension=php_ctype.so and without ” ;”.

    Can you help me? 😦

    Fred

  25. Wow, mnshankar, awesome tutorial!! 😀

    Thank you SO much for it!

    Unfortunately, I’m stuck trying to install fun pack. 😦

    I copied both the fun_plug.txt and fun_plug.tgz files to the Volume_1 folder (root?) as a user with administrative permissions, and rebooted the NAS, but it didn’t create any folder.
    I’m logging to the NAS as an administrator.

    I’m trying to install fun plug to gain access to the NAS, and be able to resolve a bigger problem: to troubleshoot and rebuild my RAID 1.

    The thing is my RAID 1 was reported degraded, I’m trying to rebuild , but the DNS 323 has been syncing for more than 5 days, now. Both the Status and the Tools > RAID section of the Web UI report around 240 minutes to go (It started @ around 360). The counter decreases continuously, but then it increases back to 240. Initially, there were 2 identical 2TB WD20EARS-00MVWB0 HDDs on a RAID1 and the left one failed. I replaced it with a SIMILAR WD20EURS-63SPKY0 (I couldn’t afford a new WD20EARS) and, on reboot, I was prompted to rebuild the array. However, the “rebuild to RAID 1” check-box could NOT be checked. I was greyed out. So I proceeded with the manual rebuild, where I’m currently stuck.

    I still can access my WebUI and my Samba share (mapped as a drive), and my data is backed up. Current Firmware Version: 1.10

    – What am I doing wrong when installing the fun plug (v 0.5)??
    – Is it strictly necessary to use an identical HDD for the mirror or a similar one can do it?
    – Is it normal that the “rebuild to RAID 1” check-box is greyed out?
    – Am I doing anything wrong in the RAID 1 rebuild process?

    To be honest, this is my second attempt to rebuild RAID1. At the first one I discovered the tough way why RAID 1 is NOT a back up (lost all my data!). Then, I used formatted HDDs (Write Zeroes option from WD application) to build the current RAID 1 from scratch. Took out the left HDD, reformatted and inserted it back, and here I am. I need to verify that the RAID can be rebuilt!!

    I’ve being trying to fix this for weeks, so, please ANY help from any of the forum members, would be greatly appreciated 😀

  26. I am having issues with starting the transmission daemon and get the following error when attempting to start, cant resolve symbol ‘ __aeabi_atexit’ ??Anyone any ideas?

    – Curl-7.21.4-arm-1
    – Transmission-2.73-arm-1

    Thanks in advance

Leave a comment