So i had some free time and unused spare wifi connectors and i decided to create a tor access point using this guides.
https://learn.adafruit.com/onion-pi/overview
https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/overview
This access point is completely useless in my home, but i was curious about it, outside it was rainy and you know, cuorisity is the cure fore boredom.
Those guides are quite self-explaining, but what if you want to set up a Wi-Fi to Wi-Fi middlebox?
The guide does not provides so muchi infos about it.
Let's assume:
eth0: adapter you connect to the main router wlan0: adapter you want to connect to the main router wlan1: adapter you want to use as access point
what you have to do using iptables is:
Create a network translation between the adapter wlan1 and the adapter wlan0 (in my case also hostap uses as interface wlan1)
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 ACCEPTSet up new iptables rules, redirecting also wlan0 traffic to torrc TransPort 9040 (adding also the well knows exceptions)
sudo iptables -t nat -D PREROUTING -i wlan0 -p tcp --dport 22 -j REDIRECT --to-ports 22 sudo iptables -t nat -D PREROUTING -i wlan0 -p udp --dport 53 -j REDIRECT --to-ports 53 sudo iptables -t nat -D PREROUTING -i wlan0 -p tcp --syn -j REDIRECT --to-ports 9040That's all folks.
0 commenti:
Post a Comment
Because of a lot of SPAM about courses, I need to moderate all comments here.
I ensure you that I will answer whenever possible (if you are not a spammer).