Install TOR on Raspberry Pi

In the previous post I wireless installed a clean version of Raspbian on a Raspbian Pi 3.
Now it’s time to do something useful with this clean install, like install TOR.
In this post I will layout the steps needed to do this

This post is mostly a copy paste from the official article found here

sudo apt-get install hostapd isc-dhcp-server
sudo nano /etc/dhcp/dhcpd.conf
...
sudo nano /etc/default/isc-dhcp-server
...
sudo ifdown wlan1
sudo nano /etc/network/interfaces
...
sudo ifconfig wlan1 192.168.42.1
sudo nano /etc/hostapd/hostapd.conf
...
sudo nano /etc/default/hostapd
...
sudo nano /etc/sysctl.conf
...
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo iptables -A FORWARD -i wlan0 -o wlan1 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan1 -o wlan0 -j ACCEPT
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf
sudo service hostapd start
sudo service isc-dhcp-server start
sudo apt-get install tor
sudo nano /etc/tor/torrc
...
sudo iptables -F
sudo iptables -t nat -F
sudo iptables -t nat -A PREROUTING -i wlan1 -p tcp --dport 22 -j REDIRECT --to-ports 22
sudo iptables -t nat -A PREROUTING -i wlan1 -p udp --dport 53 -j REDIRECT --to-ports 53
sudo iptables -t nat -A PREROUTING -i wlan1 -p tcp --syn -j REDIRECT --to-ports 9040
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
sudo touch /var/log/tor/notices.log
sudo chown debian-tor /var/log/tor/notices.log
sudo chmod 644 /var/log/tor/notices.log
sudo service tor start
sudo update-rc.d tor enable
sudo reboot now
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s