I tested an old setup I had laying around and it works. I tested it on a RPi3B+ using 2018-04-18 full version .
This is for Stretch ONLY!
DO NOT MODIFY /etc/network/interfaces FILE! The only uncommented line in that file should be
source-directory /etc/network/interfaces.d
First, insure your OS is up to date.
Code: Select all
sudo apt-get update
sudo apt-get upgrade
Open /etc/wpa_supplicant/wpa_supplicant.conf with a text editor.
Save as /etc/wpa_supplicant/wpa_supplicant-wlan0.conf.
Add this to wpa_supplicant-wlan0.conf
Code: Select all
network={
ssid="MySSID"
psk="MyPassphrase"
}
Then install the modules.
Code: Select all
sudo apt-get install dnsmasq hostapd
Edit /etc/rc.local and add this above "exit 0". Note that is two underscores.
Code: Select all
iw dev wlan0 interface add uap0 type __ap
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
The /etc/dhcpcd.conf addition:
Code: Select all
interface uap0
static ip_address=192.168.4.1/24
The /etc/dnsmasq.conf file
Code: Select all
interface=uap0
dhcp-range=192.168.4.20,192.168.4.100,255.255.255.0,12h
The /etc/hostapd/hostapd.conf file. If you change the wpa_passphrase, it must be 8 to 63 characters. No shorter or longer!
Code: Select all
interface=uap0
#driver=nl80211
ssid=RPiNet
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=mypassphrase
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
Edit /etc/default/hostapd, uncomment and change this:
Code: Select all
DAEMON_CONF="/etc/hostapd/hostapd.conf"
Edit /etc/sysctl.conf and uncomment
Reboot.