Showing posts sorted by relevance for query dns-323. Sort by date Show all posts
Showing posts sorted by relevance for query dns-323. Sort by date Show all posts

Sunday, August 5, 2007

Installing funplug-0.3 on the D-Link DNS-323

It took me a while to figure out how to get telnet access on the DNS-323. I'm a FreeBSD user, not a linux user. Even though the problem seems silly to me now, I will still blame it on the fact that this device runs linux instead of FreeBSD. Ok, enough rambling, here is how I installed funplug-0.3 on the DNS-323.

Download funplug-0.3.tar.gz from hxxp://www.inreto.de/dns323/fun-plug/0.3/

Extract the two files "fun_plug" and "fun_plug.tar" using WinZip onto Volume_1 of the NAS.

I then modified the "fun_plug" file using SCiTE4AutoIt3 by adding an extra space character on line 2. Changed the file format to UNIX (LF) type and saved the file.
I then removed the extra space character from line 2 and re-saved the "fun_plug" file.

Reboot.

What happens next is the fun_plug script extracts the fun_plug.tar file into its necessary folder and then launches the telnet daemon.





---------------------------------
www.CrazyOutdoorSports.com

Installing a Proof of Concept fun_plug on the D-Link DNS-323

So you want to dive into the inner workings of your new D-Link DNS-323 by installing the fun_plug. Well ok, here's how. Be careful though because if you screw up here, you might not have a bootable NAS anymore.

Make sure you have a current version of the firmware installed (currently 1.03).

Download a copy of either UltraEdit or SciTE4AutoIt3. You have to be sure that you save your file in UNIX (LF) file format.

Open a new file and paste this code.


#!/bin/sh
#
# Proof of Concept fun_plug
#
dmesg > /mnt/HD_a2/dmesg.out


Save this code as "fun_plug" (without quotes and no extention) in c:\ in UNIX (LF) format.

Enable FTP server on the NAS. You may need to create a FTP user account with read/write permission on Volume_1.

Open a Windows cmd window.

Type: ftp 192.168.0.32 or the ip address of your NAS.
login with your FTP username and password.

Make sure you are in the root directory.
Type: cd /

Change directories on the local system too
Type: lcd c:\

Uploads the fun_plug
Type: put fun_plug

Set permissions on fun_plug to 777
Type: chmod 777 fun_plug
or
Type: quote site chmod 777 fun_plug
if the first one didn't work.

Next instruct the NAS to reboot.
After the system has rebooted, browse to the Volume_1 share with Windows Explorer.
You will see a file named "dmesg.out".
Congratulations, you have just modified your NAS to be able to perform all kinds of linux tasks.


---------------------------------
www.CrazyOutdoorSports.com

Enable SSH on the D-Link DNS-323 using funplug-0.3

Once you have your funplug-0.3 installed you can connect to it using telnet, but telnet isn't very secure so we want to use ssh. I recommend getting a copy of PuTTY to use as your telnet and SSH client. This proceedure is fairly safe. The only time it writes to the firmware is when you run the store-passwd script. If you take your time and test each step before you commit the config to flash ram you will be ok. Use at your own risk.

Telnet to your DNS-323. You will be presented with a # prompt (meaning you are logged in as root).

Telnet 192.168.0.32



cd /mnt/HD_a2/fun_plug.d/start
sh dropbear.sh start
chmod a+x dropbear.sh


What we did here is to change directory to the fun_plug startup directory, ran the dropbear ssh script and set ssh to auto-start on reboot.

Next set your root password by executing these commands:

echo "root::0:0:99999:7:::" >>/etc/shadow
passwd root


Finally, write the configuration to flash memory so it will be remembered on reboot. Be careful with this command. You can't fix a passwd mistake with a reboot after you run this command. If you are not 100% sure that your config is perfect, log in as root with your new password using ssh to test the config.

/mnt/HD_a2/fun_plug.d/bin/store-passwd.sh


Last but not least, lets turn off that unsecure telnet interface.

cd /mnt/HD_a2/fun_plug.d/start
chmod a-x telnetd.sh


and

reboot






---------------------------------
www.CrazyOutdoorSports.com

Saturday, August 4, 2007

D-Link DNS-323

I just got a new D-Link DNS-323 Network Attached Storage device. This thing is cool. I slapped a couple 500GB samsung SATA 3.0gb drives in it and setup a mirror. Internal temperature has been running at 118F. With samba built in for windows access, FTP server, iTunes server, DHCP server, etc, I am so far happy with this product.









---------------------------------
www.CrazyOutdoorSports.com

Monday, August 6, 2007

DNS-323 Time Sync with funplug-0.3 timezone.sh

I desired to configure the NTP functions of the DNS-323 so I dug right into the funplug-0.3 system again. I hade to rework the script a little bit to fix the errors, but this is what I came up with. Your time zone and server may vary. This is based on Pacific Daylight Savings Time. The next thing I will do is figure out how to add it to a cron job.



#!/bin/sh

# USA, Pacific Time. Daylight saving starts
# second Sunday of March and ends first
# Sunday of November.
timezone="PST8PDT,M3.2.0,M11.1.0"
timeserv=time-nw.nist.gov

timezone_start() {
echo "${timezone}" >/etc/TZ
/usr/sbin/sntp -r ${timeserv}
sleep 1
/usr/sbin/rtc -w
}

timezone_stop() {
echo "Stopping Timezone..."
}

timezone_status() {
cat /etc/TZ
}

case "$1" in
stop)
timezone_stop
;;
restart)
timezone_stop
sleep 1
timezone_start
;;
status)
timezone_status
;;
start)
timezone_start
;;
*)
echo "Usage: $0 start|stop|restart|status"
;;
esac


Make it executable.

chmod a+x timezone.sh



---------------------------------
www.CrazyOutdoorSports.com

Modding Cron on the D-Link DNS-323 using funplug-0.3

Well, I have successfully adjusted the timezone script on my DNS-323. I want to modify my crontabs without writing to flash memory so I edited my fun_plug file to inlude this code:


#Replace Cron Jobs
crontab -r
echo '*/10 * * * * /usr/sbin/getdhcp&' > /var/spool/cron/crontabs/root
echo '*/30 * * * * /mnt/HD_a2/fun_plug.d/start/timezone.sh start' >> /var/spool/cron/crontabs/root
crontab /var/spool/cron/crontabs/root

Tuesday, August 7, 2007

Mounting External USB Drive on DNS-323 with Readonly NTFS

I was successfully able to mount my 100GB USB drive formatted with NTFS in read only mode recently.

I began by creating a mount point.

mkdir /mnt/ext

Next, using the funplug-0.3 system previously installed I loaded the modules.

insmod /mnt/HD_a2/fun_plug.d/bin/modules/2.6.12.6-arm1/usb-storage.ko
insmod /mnt/HD_a2/fun_plug.d/bin/modules/2.6.12.6-arm1/ntfs.ko

Then I plugged in my usb drive and typed

dmesg

I looked throught the list to locate the device name. Mine is "sdc". Then I mounted the partition.

mount -t ntfs /dev/sdc1 /mnt/ext

After I was done with the drive I unmounted it.

umount /mnt/ext