December 10th, 2012Top StoryTurn Your FreeNAS Box Into the Ultimate Anonymous Downloading MachineBy Whitson Gordon A low-powered home server is one of the best ways to download files with BitTorrent and Usenet, but if you really want to stay safe on file sharing services, you need to anonymize your traffic. Here's how to turn your FreeNAS box into the ultimate downloading machine so you can download safely and monitor its activity from anywhere. We've shown you how to turn an old computer into a networked backup, streaming, and torrenting machine with FreeNAS, and even gone a little further and installed some Usenet and media management programs on it. But even with all that power, our downloading machine is missing a few things. Namely:
In this guide, we'll show you how to add both of these features, turning your home server into the ultimate anonymous downloading machine. Note: If you're just starting out, we recommend checking out our other FreeNAS guides first. Our original guide will show you how to set up FreeNAS 7, while our second guide will show you how to install programs manually, using Usenet as an example. Keep in mind that, while we're still referring to it as FreeNAS to keep some consistency with earlier guides, these guides use the FreeNAS 7 project, now known as NAS4Free, instead of the more current FreeNAS 8 (which we won't be using). This guide should work whether you have an old FreeNAS 7 box or a new NAS4Free box—they're essentially the same piece of software. Set Up a VPN for Anonymous DownloadingWe've said it once, and we'll say it again: the only way to stay anonymous is by using a proxy or VPN service. Yes, it costs money—usually around $10 a month or so—but these days, you shouldn't download without one. Unfortunately, FreeNAS doesn't come with a VPN, so you'll need to do it from scratch. Luckily, that isn't too hard—you just need to find a VPN service that works for you. What You Should Look For in a VPNThere are a lot of great VPN services out there, and everyone has different needs, so you'll want to find one that works for you. Here are the features you may need to look for:
For this guide, we'll be using a VPN service called Mullvad as an example, but I highly recommend you research other VPN services that fit your specific needs. Everyone is different, and what VPN you choose will be based on how you're using your NAS and what kind or privacy features or services you want. Photo by Pavel Ignatov (Shutterstock). Step One: Set Up a Jail for Installing New ProgramsWe'll need to install OpenVPN from the FreeBSD command line, just like we did with SABnzbd and Sick Beard in our previous guide. Before you do so, you'll need to set up a "jail" on your system, which allows you to install programs on one of your NAS' drives (since our FreeNAS installation resides on a flash drive). If you followed our guide to setting up SABnzbd and Sick Beard, you can skip this step and move on to step two of this guide, since you've already done all of this. First, SSH into your NAS. Windows users should download PuTTY, and type in the IP address of your NAS on the main page. You'll want to log in as ssh -l root 192.168.0.10 Where Once you've logged in as cd /mnt/SEAGATE mkdir extensions cd extensions mkdir var mkdir usr mkdir tmp mount_unionfs -o w /mnt/SEAGATE/extensions/usr/ /usr/ umount -f /var mount_unionfs -o w /mnt/SEAGATE/extensions/var/ /var/ This puts your mount_unionfs -o w /mnt/Media/extensions/usr/ /usr/ When you're done, head to step two. Step Two: Install OpenVPNWe're going to use OpenVPN to connect to our VPN service. Assuming you're running the newest version of NAS4Free, which is based on FreeBSD 9, run the following commands: setenv PKG_TMPDIR /mnt/SEAGATE/extensions/tmp/ setenv PACKAGESITE "ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-current/Latest/" pkg_add -rv openvpn If you're using an older version of FreeNAS, check what version of FreeBSD it's based on from the home page of the Web interface. Chances are, it's FreeBSD 7.3, in which case you'll want to install OpenVPN with the following commands instead: setenv PKG_TMPDIR /mnt/SEAGATE/extensions/tmp/ setenv PACKAGESITE "http://ftp6.us.freebsd.org/pub/FreeBSD-Archive/ports/i386/packages-7.3-release/Latest/" pkg_add -rv openvpn Everyone's NAS may be a little bit different, so make sure you're installing the correct package for your NAS' software. You'll also want to replace Step Three: Set Up OpenVPN with Your VPN ServiceThis is the trickiest part. Now, you need to head to your VPN provider's web site and look up their OpenVPN guide. Chances are, it'll have a ZIP file you can download with a config file and some certificates inside. With Mullvad, for example, you get a ZIP with a config file for Windows and Linux, as well as a client dev tun proto udp remote openvpn.mullvad.net 1194 resolv-retry infinite nobind persist-key persist-tun ca master.mullvad.net.crt cert mullvad.crt key mullvad.key remote-cert-tls server comp-lzo verb 3 ping-restart 120 ping 10 Usually it'll have some instructions inside, too, so you know what each setting does. Most of the defaults should be fine, but if you have any trouble, try some of the above settings and see if they work (obviously using your VPN's server under When you're done, SSH back into your NAS and run the following command: mkdir /mnt/SEAGATE/extensions/usr/local/etc/openvpn Rename your configuration file to Lastly, open up your NAS' web interface and head to System > Advanced > rc.conf and add the following variables:
Once you've saved those variables, continue to the next step to try running OpenVPN for the first time. Step Four: Start OpenVPNOnce all your config files are in place and your ports are forwarded, it's time to try running OpenVPN for the first time. Open up your NAS' web interface and go to Advanced > Command. Type the following command into the "Command" box and press Execute: /usr/local/etc/rc.d/openvpn start /usr/local/etc/openvpn/openvpn.conf Then, head to Diagnostics > Log to see if your VPN works properly. You should see a pretty big wall of text, ending with something like If it didn't work, you may need to change some settings in your config file. Look for any errors you see in your log and try it again. If OpenVPN is running but you can't connect, you'll need to go to Advanced > Command and run This is the hardest part of the process, and troubleshooting the problem is different for everyone depending on your VPN service and the other things you have running on your NAS. Don't give up, and make sure to follow all the instructions to the letter to get everything working. If you're using BitTorrent, now would be a good time to check your torrent client's IP using CheckMyTorrentIP.com, as described in step three of our BitTorrent anonymization guide. If you get your VPN's IP, then you've successfully set up an anonymous downloading NAS! Step Five: Set Up Your FirewallThe last thing you should do, once your VPN is up and running, is set up a firewall on your NAS that blocks all traffic except your VPN connection. That way, if your VPN goes down, your NAS won't fall back on your regular connection, which can expose your actual IP and destroy any anonymity you may have had. In your NAS' web interface, go to Network > Firewall. Everyone's firewall may be a bit different, but here's a template you can use to create your rules: Click on the image for a closer look. Going number by number in the image, here's what each set of rules does:
Again, your firewall may differ a bit, but this is a good place to start. Click the Plus sign to add each individual rule, and when you're done, check the Enable box and click "Save and Restart" in the bottom left corner. Head back to your SSH window and try to Once everything's working properly, give yourself a pat on the back, because you've now anonymized all the traffic coming in and out of your NAS! It's not an easy process, especially because it's a little different for everyone, but it can be done—it just takes a little patience and a little knowledge about how all everything works. Monitor Your Downloads From Afar with Dynamic DNSSo you've got yourself a kickass downloading machine, but what happens when you're out and about and come across a file you'd like to download? Or maybe you want to check in on your server and see what TV shows you've downloaded or ripped to your home theater PC? By default, you can't access your NAS from outside your home network, but all it takes is a few tweaks to make this possible. Then you can monitor downloads, start new ones, and check in with your NAS from your laptop, phone, or even someone else's computer while on-the-go. Step One: Sign Up for a Dynamic DNS ServiceWe've talked about how to do this before, and the process is pretty similar with your NAS. To start, you'll want to sign up for a service like DynDNS or No IP, which will give your home network an easy-to-remember domain name like Before you sign up, check your router's admin page to see which services your router supports. Mine only supports DynDNS, for example, so that was the one I had to use. Other routers may support different services, so check the Dynamic DNS settings of your router for more info. Step Two: Set Up Dynamic DNS on Your Router and NASOnce you've signed up for your service of choice, head back to your router's admin page and type in your credentials and domain name into the provided boxes. This will be different for every router, but yous hould find it in your router's settings under "Dynamic DNS," "DDNS," or something similar. Next, do the same thing on your NAS. Open up your NAS' web interface and go to Services > Dynamic DNS. Pick your provider, type in your domain name and credentials, then check the Enable box in the upper-right corner. Click the Save and Restart button to start the service. Step Three: Forward Any Necessary PortsLastly, you'll probably need to forward a few ports on your router so your NAS is accessible from the outside world. Once again, we've talked about this before, so check our guide to port forwarding if this is the first time you've done it. If you're using a VPN, all you need to do is forward the port that your VPN uses to connect. In our case, that's port 1194, as shown in our VPN config file. So, head to your router's configuration page and find the section for port forwarding, then forward port 1194 over the UDP protocol. You'll also need to set up port forwarding from your VPN service's web site. Otherwise, your VPN won't know who you are when you try to connect from the outside world (since a number of other users are using the same VPN as you). Head to your VPN's home page, log in, and look for the section on port forwarding. (If you're using Mullvad, it's on the main page after you log in). Click the New button to add a new port. Your VPN service decides how many you're allowed to have; many limit you to just a few so you don't hoard them from other users. Now, you don't get to choose which ports your VPN gives you, so after it's assigned a few ports to your account, you'll need to assign them to the services on your NAS. For example, if your VPN assigns you port 12345 after clicking "New," and you want to access your BitTorrent downloads from afar, you'll need to go into your BitTorrent settings on your NAS (Services > BitTorrent) and change the web UI's port number to 12345. If you're running other web-based services, like Sabnzbd or Sick Beard, you'll need to assign them each their own port as well, as provided to you by your VPN service. Note that you won't be able to access your NAS' web interface from afar, since you can't customize what port it uses, but you can access everything else, which is really what's important. Be sure to update your bookmarks with the new port numbers, too! Step Four: Try Accessing Your NAS From ElsewhereLastly, just try to access one of your web interfaces using your new hostname. For example, if your hostname is http://myawesomenas.dynalias.org:12345/transmission/web/ Again, repeat this process for any other services you have running, like SABnzbd or Sick Beard. If everything works, then congratulations! Now you can monitor your downloads, add new downloads, and otherwise keep track of your NAS from anywhere on any device. It isn't a simple process, and it can be a little different for everyone, but all the setup is well worth it. When you're done, you'll have a quiet, low-power machine that stays on 24/7 and downloads all your files for you, completely anonymously, with easy access from wherever you are. If you run into any problems during setup, be sure to check out the NAS4Free forums, the OpenVPN forums, the FreeBSD forums, or right here in the comments of this post. Good luck! |
|
A destination on the Interweb to brighten your day (now get back to work!)
Monday, December 10, 2012
Turn Your FreeNAS Box Into the Ultimate Anonymous Downloading Machine
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment