wifi2wifi

Get started:

We need to get a working Internet connection via WiFi:

auto wlan0

iface wlan0 inet dhcp

wpa-ssid SSID

wpa-psk PASSWORD

The Pi also needs to become an access point:

interface=lo,uap0

no-dhcp-interface=lo,wlan0

dhcp-range=192.168.2.100,192.168.2.200,12h

interface=uap0

ssid=SSID

hw_mode=g

channel=6

macaddr_acl=0

auth_algs=1

ignore_broadcast_ssid=0

wpa=2

wpa_passphrase=PASSWORD

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP

auto uap0

iface uap0 inet static

address 192.168.2.1

netmask 255.255.255.0

iw dev wlan0 interface add uap0 type __ap

service dnsmasq restart

sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -s 192.168.2.0/24 ! -d 192.168.2.0/24 -j MASQUERADE

ifup uap0

hostapd /etc/hostapd/hostapd.conf &

Only allow SSH access to the Pi from the wireless interface:

ListenAddress 192.168.2.1:22

Finish up and test:

I want to give credit to anthony19114 for his forum posting at: https://www.raspberrypi.org/forums/viewtopic.php?t=138730. His instructions were the most complete I was able to find.