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
wlan1 (AP) - Other clients connect to it.
I would like the clients connected to
wlan1 (AP) to be able to access the internet on
Most tutorials out there on the Web have you do the following which routes traffic from
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
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.
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
Or even better, how can I make it so that wlan0 is able to connect to ANY SSID, at home, in public, anywhere?