3

Background

I am currently trying to build a portable Tor Router on my Raspberry Pi 3.

So I have my Pi 3 with two wireless interfaces, one is a station and the other is an AP.

wlan0 (station) - Connected to the internet via my desired SSID under /etc/network/interface

wlan1 (AP) - Other clients connect to it.

I would like the clients connected to wlan1 (AP) to be able to access the internet on wlan0.

Most tutorials out there on the Web have you do the following which routes traffic from eth0 to wlan0:

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

However, this defeats the purpose of being 100% portable because you still need to connect the Pi with an ethernet cable.

So, I modified the above line to route traffic from wlan1 to wlan0:

iptables -A FORWARD -i wlan1 -o wlan0 -j ACCEPT
iptables -A FORWARD -i wlan0 -o wlan1 -m state --state ESTABLISHED,RELATED \
         -j ACCEPT
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

I also modified the /etc/network/interface file to connect to my home router.

Issue

After modifying hostapd.conf to create a AP on wlan1 and starting the service, hostapd takes down wlan0 as well as all other interfaces that aren't involved with the AP.

How can I make it so that hostapd runs in the background and wlan0 is able to connect to my desired SSID using the configurations under /etc/network/interface?

Or even better, how can I make it so that wlan0 is able to connect to ANY SSID, at home, in public, anywhere?

0

Download and run the following script as sudo:

pifi.sh : https://github.com/NicholasAdamou/PiFi/raw/master/pifi.sh

It's a script that I made to fix the above issue.

How did I fix it?

The HostAPD binary didn't have the correct firmware for the wireless adapter I was using.

The above script will allow you to setup a a Raspberry Pi as a PiFi Wireless Repeater.

-2

Found this:

https://github.com/saysudo/raspberry-pi-vpn-hotspot/blob/master/Raspberry%20Pi%203%20Model%20B%20as%20VPN%20Hotspot.md

You can skip setting up VPN.

  • Please consider adding a little bit more description than just a link. – Shan-Desai Feb 27 '17 at 21:05
  • As @Shan-Desai mentioned, link only answers are discouraged on this site as they tend to suffer from link rot. Please expand on your answer so that it includes the highlights from your link. If you don't do so within 48 hours, your question will be converted to a community wiki post per the site's community policy. – Jacobm001 Feb 27 '17 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.