Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
projects:tor_hostspot [2013/10/29 17:05] – virii | projects:tor_hostspot [2014/06/02 00:56] (current) – removed prometheus | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Want Tor on a Router? For fun and profit? Well here we go! \\ | ||
- | |||
- | ====== Hardware ====== | ||
- | |||
- | We need the following: | ||
- | * Raspberry Pi (Modell B, REV1 or REV2) ~40€ | ||
- | * A case for our Pi ~10€ | ||
- | * Transcend Extreme-Speed SDHC 16GB SDCARD ~12€ | ||
- | * Micro-USB 5V 1500mA Power Supply ~4€ | ||
- | * LAN Cable ~1€ | ||
- | * TP-Link TL-WN722N Wireless adapter ~12€ | ||
- | * D-Link DUB-H4 USB HUB ~18€ | ||
- | |||
- | Makes a total of ~97€ for a rady-to-go Tor Hotspot. (amazon prices!) | ||
- | |||
- | ====== Setup ====== | ||
- | |||
- | Prepare the SDCard with the latest version of Raspbian. | ||
- | |||
- | '' | ||
- | dd if=/ | ||
- | '' | ||
- | {{ : | ||
- | |||
- | * Plug the SDcard into the Pi | ||
- | * Connect it with the LAN cable to your router/ | ||
- | * Connect the Pi with an HDMI cable to a monitor | ||
- | * Connect the USB Hub to the Pi. | ||
- | * On the HUB, connect an USB Keyboard and the Wireless adapter. | ||
- | * Connect the USB Hub and the Pi to their power supplies and fire it all up. | ||
- | |||
- | ===== Config ===== | ||
- | |||
- | When raspi-config opens, tell it to expand the filesystem to the full size of your SDcard. \\ Next, go and enable the SSH daemon. Now you can change the hostname to something like " | ||
- | |||
- | Switch to the root user! \\ | ||
- | '' | ||
- | Install Hostapd (does the Hotspot/ | ||
- | '' | ||
- | For our setup we must compile Hostapd by hand as our TP-Link TL-WN722N uses a driver that's not enabled by the default raspbian hostapd. | ||
- | '' | ||
- | wget http:// | ||
- | tar xzvf hostapd-2.0.tar.gz \\ | ||
- | cd hostapd-2.0/ | ||
- | cp defconfig .config \\ | ||
- | nano .config'' | ||
- | Uncomment the following line \\ | ||
- | ''# | ||
- | Compile it! \\ | ||
- | '' | ||
- | make install'' | ||
- | Edit dhcpd.conf \\ | ||
- | '' | ||
- | Comment the following lines out \\ | ||
- | ''# | ||
- | # option domain-name-servers ns1.example.org, | ||
- | Uncomment the following line \\ | ||
- | ''# | ||
- | Now add the following block of lines to the config (at the end of the file)\\ | ||
- | '' | ||
- | 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 " | ||
- | option domain-name-servers 8.8.8.8, 8.8.8.4; \\ | ||
- | }'' | ||
- | Edit / | ||
- | '' | ||
- | Change the INTERFACES value to this \\ | ||
- | '' | ||
- | Now open / | ||
- | '' | ||
- | iface eth0 inet dhcp \\ \\ | ||
- | allow-hotplug wlan0 \\ | ||
- | #iface wlan0 inet manual \\ | ||
- | #wpa-roam / | ||
- | #iface default inet dhcp \\ \\ | ||
- | iface wlan0 inet static \\ | ||
- | | ||
- | | ||
- | Enable wlan0 \\ | ||
- | '' | ||
- | Now we create / | ||
- | '' | ||
- | Fill it with the following lines \\ | ||
- | '' | ||
- | driver=nl80211\\ | ||
- | ssid=TorRouter\\ | ||
- | hw_mode=g\\ | ||
- | channel=6\\ | ||
- | macaddr_acl=0\\ | ||
- | auth_algs=1\\ | ||
- | ignore_broadcast_ssid=0\\ | ||
- | wpa=2\\ | ||
- | wpa_passphrase=YOURSECRETPASSWORDGOESHERE\\ | ||
- | wpa_key_mgmt=WPA-PSK\\ | ||
- | wpa_pairwise=TKIP\\ | ||
- | rsn_pairwise=CCMP'' | ||
- | Enable DAEMON mode in hostapd.\\ | ||
- | '' | ||
- | Edit it \\ | ||
- | '' | ||
- | Now we need to download some more firmware for the chipset on our TP-Link\\ | ||
- | '' | ||
- | Go ahead and start the 2 services!\\ | ||
- | '' | ||
- | service isc-dhcp-server start'' | ||
- | Enable autostart\\ | ||
- | '' | ||
- | update-rc.d isc-dhcp-server enable'' | ||
- | Add the following line to / | ||
- | '' | ||
- | Activate the changement\\ | ||
- | '' | ||
- | Delete any old IPtables rule (if any)\\ | ||
- | '' | ||
- | iptables -t nat -F'' | ||
- | Add the following ip-forwarding rules\\ | ||
- | '' | ||
- | iptables -t nat -A PREROUTING -i wlan0 -p udp --dport 53 -j REDIRECT --to-ports 53\\ | ||
- | iptables -t nat -A PREROUTING -i wlan0 -p tcp --syn -j REDIRECT --to-ports 9040\\ | ||
- | iptables-save > / | ||
- | |||
- | |||
- | |||