Powered by Blogger.

How to make a NAS with an external hard drive and DD-WRT Router

While commercial NAS devices have the edge on convenience, if you’re not too keen on paying out for a brand name or prefer to get hands-on with your tech, then a DIY NAS might suit you better.

There are two popular ways of doing this - creating your own from scratch using reclaimed hardware or, for a simpler approach, combining a DD-WRT-enabled WiFi router with an external storage device.

If you’re interested in building your device from the ground up, check out our page on Building Your Own DIY NAS from an Old PC. Also check our best online backups for NAS, or read on for more info on how to turn a DD-WRT router and an external storage device into your own personal NAS.
Getting started

Affordable and not mind-bogglingly complicated, using a router and an external storage device is a great way to create your own NAS device without having to get too involved in hardware, although the composite parts will need to meet a few basic requirements:
WiFi Router

To successfully create your own DIY NAS, you’ll need a router with at least one USB port that’s compatible with DD-WRT firmware. For a list of models that fit DD-WRT criteria, check out their website, or keep reading for more on the DD-WRT firmware and how it works.

When it comes to picking your router, modern models are more likely to feature USB ports, and it’s worth trawling through some reviews to find the best one for you, as you’ll get better performance from a better router. BestVPN has an excellent list of the 5 Best DD-WRT Routers if you’re looking for a place to start!
External Hard Drive

This bit is up to you, as pretty much any removable storage device will work, so long as it has a USB cable that can be plugged into your network router. 
So why use a DD-WRT NAS?
Pros

It’s cheap!

DD-WRT is the best route to a quick, easy and cheap NAS. While commercial NAS devices will set you back several hundred dollars, you can get hold of a DD-WRT-compatible router by brands such as TP-LINK, Buffalo and Linksys for less than $60 - some are even available for as little as $20 if you order from Amazon.com. On top of that, a 1TB external hard drive will set you back around $50, or you can get 2TB for approximately $90 - giving you a minimum total spend of well under $100. Not bad.

Don’t forget as well that you may already be using a DD-WRT-compatible router (you can find a list of which models support the firmware here), and that any external hard drive with a USB connection will do the trick. Once you’ve got the hardware sorted, you’re done - DD-WRT itself is completely free to download and use, and unless you use paid subscriptions to external services, there shouldn’t be any more outgoings to worry about.

Relatively simple startup

You won’t need to play around with hardware to make this setup work, and there are some great tutorials on offer from DD-WRT themselves to guide you through both basic and complex processes. The steps might be a little intimidating to technophobes, but in reality they’re a lot less painful than they look.

Pick and choose NAS capabilities

Although commercial NAS devices have loads of great apps available, the sheer volume of apps, settings, and extra capabilities can be a bit overwhelming. If you’re just looking for a simple network storage solution, making your own from an external drive and a router can save you from trawling through a lot of unwanted extras.
Cons

Limited storage space

One major downside of a simple DIY NAS is that you’re bound by the restrictions of the gear you’re using. In this case, that means that your maximum storage capacity is the same as that of your external storage device. While most can handle 1 or 2TB of data, if you’re serious about space, there are a few fairly heavy-duty 4TB and 5TB models available too. However, this is still significantly less than the space provided by larger commercial devices, or by making your NAS entirely from scratch.

Time consuming

Although pretty simple to do, setting up your router with DD-WRT and initiating all of the processes that you want to use can take some time. If it’s speed and convenience you want, then a commercial device might be the best option for you.

Not much scope for data redundancy

If you want to use extensive data redundancy settings to protect your files, a router-plus-external-drive NAS might not be the best option, as you’ll be hard pressed to find a router that can handle a RAID configuration while still maintaining decent speeds.

For a significantly more basic setup, you’ll find plenty of routers on the market with two USB ports, giving you the option to keep two copies of the same data in case one drive fails - though be aware that you’ll have to update them both manually at every turn. If a RAID setup is an essential part of your NAS plan, take a look atcommercial setups, or consider building your own from an old PC.
Understanding DD-WRT

DD-WRT is an open source firmware designed to increase the functionality of your router so that you can configure it to do much more than just manage internet connections. While there are alternative providers out there, including Tomato,OpenWRT, and Gargoyle, DD-WRT has a decent range of compatible devices, and is fairly user-friendly, making it the best choice for most home and small business users.

For the purposes of this guide, we’re going to look exclusively at those functions that can be used to adapt your router into a NAS device, facilitate file transfers and provide remote file access. For a much more detailed rundown of everything that DD-WRT can do (and how to make it happen), check out this excellent guide from BestVPN.com.

Warning:

While some manufacturers offer routers with DD-WRT already installed, downloading the firmware onto a standard router carries the potential risk of bricking it, but is fairly unlikely if you follow the instructions properly. If you’re starting from scratch then it's easier to find a model that comes preconfigured - or if not, then make sure that you’re confident in the process before you get started!
Creating a DIY NAS device with DD-WRT
Plug your USB storage device into your router. 
NOTE: The router can be on or off when you do this - if it’s off, turn on before step 2.
Type 19.2168.1.1 into your browser’s address bar, to access your router’s WebGUI - effectively the dashboard from where you can manage your router’s processes.
If this doesn’t work, it’s possible that your router’s IP address has been manually changed - to find out what it is, open your computer’s command prompt (you can type cmd into a Windows search if you’re not sure where to find it), then type ipconfig. You can then type the address that appears into your address bar to access the WebGUI.
Navigate to ‘Services’ and select ‘USB’
Click to enable USB Storage Support’, ‘Automatic Drive Mount‘ and ‘Core USB Support’. Click ‘Save’, then ‘Apply Settings’ for this to take effect.
If you see some info about your storage device appear in the ‘Disk Info’ section, everything’s going well. If not, restart your router, reload the page, and repeat this step if needs be.
Navigate to the ‘NAS’ tab, enable SAMBA, enter a Server String (a name to identify the device by), and add your Workgroup. For instructions on how to find and change your Workgroup name, Windows users can check out thisofficial tutorial, while DigitalCitizen has a handy alternative for Mac. 
If you’re a Linux user, you’ll need to enter the following command in a terminal window: sudo apt-get install samba smbfs (you’ll need to give your sudo password as part of the process). You can then navigate to the /etc/samba/smb.config file, where you’ll find the ‘workgroup = WORKGROUP’ line.
Find ‘File Sharing’, and click ‘Add share’. Then look at the ‘Path’ drop-down menu, pick a device partition or storage device, and name it.
Set your access permissions by checking ‘Public’ if you want all network devices to be able to use the device, and (if so) deciding whether you want to grant Read Only or Read/Write access to other users. 
If you’d prefer to only allow selected users to view/edit files, click ‘Add User’ and fill in their details - making sure that ‘Samba’ is checked for all of them.
Click ‘Save’, then ‘Apply Settings’.

Once this has been done, you’ll be able to access your NAS over your Network in one of the following ways:

Windows

Start -> Network -> [Router name] -> [drive or partition name]

OSX

File Manager -> Shared pane or Network folder -> -> [Router name] -> [drive or partition name]

Linux / Ubuntu

Follow this guide.

“Unsupported Filesystem” Warning

If this appears after you’ve set up your NAS, you’ll need to follow one of these guides - Windows, Mac - to reformat your drive into an ext2, ext3, NTFS or VFAT file system.
Using FTP for remote access

Once you’ve got your NAS up and running, things can start getting interesting. NAS devices don’t have to be limited to local storage - they can also act as a personal Cloud, letting you access your data from anywhere, at any time. While this can of course also be achieved by using an online backup service, managing your files with NAS can feel much more secure than handing them over to an external company.

Setting up remote access requires you to manually enable FTP (file transfer protocol) on your router or NAS device - a means of transferring files over the internet that can be applied to personal devices. You can do that by following our guide below: 
To enable FTP on your DD-WRT-enabled router, you’ll first need to have set it up as a NAS device by following the steps above. Once this is done, return to your WebGUI by entering your IP address into your browser’s address bar, then navigate to ‘Services’, then ‘NAS’.
Check the boxes to enable WAN access and ProTFPD (you can change the port number here if you want to), then click ‘Save’, and ‘Apply Settings’. 

Authentication: When setting up WAN access, the Radius method of authentication will give you maximum security, while a password list is the simplest to run. We’d recommend giving Anonymous logins a miss, as it can compromise the privacy of your data.
Navigate to ‘Administration’, select ‘Commands’, and enter: 

wanf=`nvram get wan_iface`
iptables -I INPUT 2 -i $wanf -p tcp --dport 21 -j logdrop
iptables -I INPUT 2 -i $wanf -p tcp -m state --state NEW --dport 21 -m limit --limit <em>A</em>/minute --limit-burst <em>B</em> -j logaccept
Click ‘Save as Startup’, ‘Apply Settings’ and, finally, ‘Reboot Router’. Your router should now be running an FTP server.
Using an FTP Client

Once the server has been setup, you’ll need to give yourself a way to use it. This can be done by downloading an FTP Client such as WinSCP or FileZilla , from where you’ll be able to manage and transfer your files.

To access data remotely, you’ll simply need to enter ftp. followed by the IP address of the storage device you’re trying to access - eg. ftp.198.256.0.1 (use the process described in step 2 of our ‘Creating a NAS using DD-WRT’ guide above).

NOTE: If you’re using a modem as well as a router, you’ll need to create a port forward in order for FTP transfers to succeed. Methods for doing this vary depending on your modem and ISP, so we’d recommend searching for information on your particular model and provider to find out what you’ll need to do.

Protecting data transfers with a VPN

If you want to access your files remotely but are using a public internet connection that you don’t trust, it’s worth using a VPN to protect your data. Unlike the VPN services you might use to protect a regular laptop while browsing online, DD-WRT can be used to setup a local VPN client that encrypts all file transfers to and from your router.

This is a somewhat more complicated procedure than the ones we’ve discussed above, so if you’d like to know how to set your DD-WRT router up as a VPN, we’ll leave you in the very capable hands of DD-WRT’s own website.


Creating Rsync Backup Server

Rsync is a file synchronization tool used to backup and sync files - typically between a local server and a remote backup server. It’s a very useful way to keep a secondary copy of your data on a secondary device, and also allows you to keep a backup stored offsite - so if your office or home is damaged or burgled, you’ll still have access to an intact version of your files.

Take a look at DD-WRT’s wiki or Digital Ocean’s guide to using Rsync to sync local and remote directories for more information.
Online backups

Should you want to make an extra copy of your files online, many online backup providers such as Acronis, SOS, and IDrive will backup data from your NAS device if you first map it as a drive. Check out how to do this for Mac, Windows and Linux - or head over to our 5 Best NAS Backups for 2016 for a rundown of the most NAS-compatible online backup providers.
Conclusion

Creating a DD-WRT NAS using a router and an external drive is a great data storage solution for home users, as it’s easy to set up and won’t break the bank. For more information on how to use their firmware, DD-WRT’s website is the perfect place to start, and Newegg is an excellent place to shop for routers. 

If you’d prefer to just plug in your NAS and start backing up straight away, then you might want to consider a commercial NAS device, or those looking for more storage space and the chance to customise both features and hardware can look at our guide to building your own DIY NAS from an old PC.
    Blogger Comment
    Facebook Comment