Silversonic
Posts: 34
Joined: Wed Aug 27, 2014 8:42 pm

Combining tor with my wireless access point gives issues

Sat Oct 04, 2014 2:35 am

I have followed this guide in setting up a wireless access point:

https://learn.adafruit.com/setting-up-a ... l-software

And it is completely successful. However when using the follow-up guide to install Tor:

https://learn.adafruit.com/onion-pi/install-tor

I run in to issues - my iPhone still sees my OnionPi but cannot connect to it anymore. I think my issue comes after the lines

Code: Select all

Type the following to flush the old rules from the ip NAT table
sudo iptables -F
sudo iptables -t nat -F
And then it asks me to do a bit more routing

Code: Select all

If you want to be able to ssh to your Pi after this, you'll need to add an exception for port 22 like this (not shown in the screenshot below)
 sudo iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 22 -j REDIRECT --to-ports 22
Type the following to route all DNS (UDP port 53) from interface wlan0 to internal port 53 (DNSPort in our torrc)
 sudo iptables -t nat -A PREROUTING -i wlan0 -p udp --dport 53 -j REDIRECT --to-ports 53
Type the following to route all TCP traffic from interface wlan0 to port 9040 (TransPort in our torrc)
 sudo iptables -t nat -A PREROUTING -i wlan0 -p tcp --syn -j REDIRECT --to-ports 9040
The "flushing" of old rules seems to delete everything added to iptables in the WAP guide, i.e.

Code: Select all

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
So this seems to remove everything I've done in relation to setting up the network. Is this my issue? How do I combine both of these routings? (I've tried just not flushing and writing both the WAP and Tor routes, but that doesn't seem to work).

As an additional, the /var/log/syslog fail notes this after a few minutes of failing to connect with my iphone:

raspberrypi hostapd: wlan0: STA 24:ab:81:5b:cf:53 IEEE 802.11: disassociated

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: Combining tor with my wireless access point gives issues

Sat Oct 04, 2014 3:06 am

As stated "Type the following to flush the old rules from the ip NAT table" removing the old rules is intentional.

Code: Select all

sudo service tor status
tail /var/log/tor
?
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

Return to “Troubleshooting”