Safeplug is a special router that creates an anonymous connection to the Internet through the Tor network (i.e. Tor?); it costs $50 — but you can make your own with a Raspberry Pi and USB WiFi.
In truth, you won’t be saving much: the cost of the Pi plus a suitable WiFi adapter will set you back about $50 or more. But do-it-yourself is fun, we’ll learn a lot, and you probably already have a pi sitting around, gathering dust.
Shopping list
- Raspberry Pi (Model B)
- SD card at least 4 gigabytes
- network cable
- Compatible USB Wifi adapter — this means it can work in structural mode with the hostapd package (for example, based on the RT5370 chipset)
- Micro USB power adapter
Theory
We will set up the Raspberry Pi to act as a router: it will connect to the Ethernet port on your existing internet router like any other device, but it will also connect to the anonymous Tor network. You can read our complete guide to Tor to learn more, but it essentially works by sending your internet requests through multiple computers — redirecting them all over the world — making you virtually untrackable. The Pi will broadcast the WiFi network just like your router probably does, so any WiFi traffic will be sent to the internet via Tor. In fact, if you don’t already have a WiFi enabled router and want to get one, just follow the first part of this tutorial.
This of course reduces the speed both through the routing element and through the actual Tor network.
However, be careful: browsing only through Tor will not completely anonymize your session. Your browser is full of cached files and cookies that can be used to determine your presence on a website (what is a cookie? a cookie is a cookie). Make sure they’re disabled and blocked (use incognito mode) — and obviously don’t start logging into websites.
Beginning
Write a fresh copy of the latest Raspian Wheezy image to your SD card; plug in power, ethernet, usb wifi adapter and boot up. You don’t need an attached monitor or keyboard — we’ll do it all from the command line.
Use an IP scanner. to find out the IP address of your Raspberry Pi (IP Scanner for OS X works fine for me) then SSH into it from the command line (how to use SSH on Windows) with the command:
ssh pi@xxxx
where xxxx is the IP address of your Pi. The default password is «raspberry»
Type of:
sudo raspi-config
run the graphics setup utility. Expand the file system, then exit the setup utility and restart. You must have the same IP address — go ahead and SSH back again.
Check if the Pi can access the internet by typing
ping google.com
from your SSH session (not on your local machine). You should see something like this:
Click ctrl-c, to stop him. Now check if your WiFi adapter is recognized by typing:
ifconfig -a
If you see wlan0 in list, all is well. If not, then your wireless adapter is not even recognized, let alone AP structure/mode capability.
Let’s update the system and install some software. Start the next one in line, going through the hints as needed. In the second step, we remove wolfram engine, to fix a bug in the math core — in the process we also save 450 megabytes.
sudo apt-get update sudo apt-get remove wolfram-engine sudo apt-get install hostapd isc-dhcp-server
Here we have set up a DHCP server so that WiFi clients can automatically obtain an IP address. Ignore the error — it just means we haven’t actually set it up yet.
sudo nano /etc/dhcp/dhcpd.conf
Comment out (add # to start) the following lines:
option domain-name "example.org"; option domain-name-servers ns1.example.org, ns2.example.org;
Uncomment (remove #) word authoritative from these lines:
# If this DHCP server is the official DHCP server for the local # network, the authoritative directive should be uncommented. authoritative;
Now scroll down and paste:
subnet 192.168.42.0 netmask 255.255.255.0 { range 192.168.42.10 192.168.42.50; option broadcast-address 192.168.42.255; option routers 192.168.42.1; default-lease-time 600; max-lease-time 7200; option domain-name "local"; option domain-name-servers 8.8.8.8, 8.8.4.4; }
Save with CTRL-X -> Y -> input .
Next enter:
sudo nano /etc/default/isc-dhcp-server
Change the last line to read: