- get raspberry pi 2
- setup ubuntu
- get usb wifi dongle that supports master (AP) mode, e.g. with RT5370 chip. Search on Amazon
This is based on WiFi AP (RT5370) on Raspberry Pi
don't forget to adjust to your adapters: eth0 and wlan1 used here
sudo su -, opens root console, that redirect>workslsusb, should show148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapterapt-get install hostapd dnsmasqnano /etc/network/interfaces
allow-hotplug wlan1
iface wlan1 inet static
address 10.10.10.1
netmask 255.255.255.0
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet manual
nano /etc/hostapd/hostapd.conf
interface=wlan1
driver=nl80211
ssid=MAPBOX-STUDIO-PROXY
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=MY_SUPER_SECRET_PASSWORD
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
nano /etc/default/hostapd
DAEMON_CONF="/etc/hostapd/hostapd.conf"
/etc/init.d/hostapd restartupdate-rc.d hostapd enablenano /etc/dnsmasq.conf
interface=wlan1
except-interface=eth0
dhcp-range=10.10.10.2,10.10.10.150,255.255.255.0,12h
/etc/init.d/dnsmasq restartupdate-rc.d dnsmasq enablenano /etc/sysctl.conf- uncomment
net.ipv4.ip_forward=1
- uncomment
sysctl -piptables -t nat -A POSTROUTING -o eth0 -j MASQUERADEiptables -A FORWARD -i eth0 -o wlan1 -m state --state RELATED,ESTABLISHED -j ACCEPTiptables -A FORWARD -i wlan1 -o eth0 -j ACCEPTiptables-save > /etc/iptables.natecho '#!/bin/bash' > /etc/network/if-up.d/forwarding && echo 'iptables-restore < /etc/iptables.nat' >> /etc/network/if-up.d/forwarding && chmod +x /etc/network/if-up.d/forwardingshutdown -r now
The author of WiFi AP (RT5370) on Raspberry Pi states that it doesn't work after a reboot. He solved it with:
nano /etc/default/ifplugd
INTERFACES="eth0"
HOTPLUG_INTERFACES="eth0"
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="stop"
Didn't work for me.
However, reissuing iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE after reboot works for me.
Findings:
The absoluteURI form is required when the request is being made to a proxy.