Setting up Alt-f Firmware on Dlink DNS-320L NAS
![](https://zorruno.com/wp-content/uploads/2020/05/images-1.jpeg)
As a 2024 update, note that you shouldn’t have a D-Link NAS in place any more unless you do actually put alternate firmware on, due to remote vulnerabilities that will never be fixed… https://www.howtogeek.com/disconnect-your-d-link-nas-from-the-internet
Summary
- These are cheap 2-bay NASs
- I have DNS-320L (3 of them)
- Firmware is rubbish
- Alt-F is an open source replacement
- Alt-F is minimalistic, but does what is needed, has a plug-in system and is efficient
Non persistant File system
On Alt-F, by contrary, any change will be lost in the next reboot. The exception is a set of well defined files, the “Settings”, that are saved in flash memory and loaded on the next reboot (or on demand), and that overrides the defaults.
To override this, there is a set of files in /Alt-F that will be pulled on boot to overlay on the existing file system. eg to change loadsave_settings
aufs.sh -n
mkdir -p /Alt-F/usr/sbin
cp /usr/sbin/loadsave_settings /Alt-F/usr/sbin/loadsave_settings
edit /Alt-F/usr/sbin/loadsave_settings and fix the error
aufs.sh -r
You then need to go into the web panel and save your changes (the save to flash memory option under system settings)
THIS WOULD NOT WORK FOR ME FOR /etc/httpd.conf specifically for some reason. it kept getting overwritten (but not completely?) so I’m guessing Alt-F was updating it on reboot after the file overlay. The above worked for me for modifying smb.conf though (you can also do this though the web panel and SWAT – although I didn’t try this)
I ended up modifying the bootscript file. You can tell it where this is in the web panel (services/user). Edit in the web panel directly I suggest. On reboot, after 30 secs or so my httpd config was implemented.
My bootscript file is in /mnt/sda2/bootscript.sh (the same place that has the /Alt-f files )
#!/bin/sh
# Script to execute as the root user at boot time.
# You can loose your data or make the system inaccessible
# if using the wrong commands. You have been warned!
exec >> /var/log/user.log 2>&1
case "$1" in
start)
echo "Starting $0"
;;
stop)
echo "Stopping $0"
;;
esac
grep -qxF "A:192.168.2.0/255.255.255.0" /etc/httpd.conf || echo "A:192.168.2.0/255.255.255.0" >> /etc/httpd.conf
Links
- The replacement Firmware I used (Archived) – ONLY for DNS-320L revA. https://drive.google.com/file/d/15bBEyWhuXV1UIV_O1EGKclKxeYK93Gcv/view?usp=sharing
- Sourceforge site: https://sourceforge.net/projects/alt-f/
- Alt-F FAQ https://sourceforge.net/p/alt-f/wiki/Alt-F%20FAQ/
- You can put the Alt-f packages etc on USB if you want to https://groups.google.com/forum/#!topic/alt-f/MVBtEyocMUo
- Deactivate the Alt-F file system part https://groups.google.com/forum/#!topic/alt-f/xnykQUhEvHE
- Windows 10 and wsdd2 package https://groups.google.com/forum/#!topic/alt-f/vsTMlB4Mzr4
Notes
- By default, the web admin panel and samba are not available across subnets, (in the web you’ll just get a “403 Forbidden” error). You have to use the overlay file system changes or modify the /etc/httpd.conf and /etc/samba/smb.conf files with the bootscript.
- By default you need to create a user, and then you can log in with SSH with this user. The web password is admin (to begin with) so change it obviously. When in SSH you can su to root, with the password admin.. then change it with passwd straight away.
http.conf default file
$ cat /etc/httpd.conf
A:127.0.0.1 #!# Allow local loopback connections
D:* #!# Deny from other IP connections
A:192.168.1.0/255.255.255.0 #!# Allow local net
#port=80 #!# keep commented!