Configuration files to turn a Raspberry Pi Zero-W into wireless access point and client and act as a console server for a network device.
Raspberry Pi Zero-W https://www.raspberrypi.org/products/raspberry-pi-zero-w/
-
Micro usb cable with power converter https://www.amazon.com/Kasstino-Female-Micro-Adapter-Tablet/dp/B01ICSIZ3U/ref=sr_1_11?s=pc&ie=UTF8&qid=1525978767&sr=1-11&keywords=micro+usb+male+to+usb+converter
-
USB Power Bandit
https://www.amazon.com/Ziotek-ZT1120133-HC1-Power-Bandit/dp/B00529EP6E
-
sudo apt-get update
-
sudo apt-get upgrade
-
sudo apt-get install dnsmasq hostapd screen
-
Edit
/etc/rc.local
and add the following ABOVEexit 0
service hostapd stop
service dnsmasq start
iw dev wlan0 interface add uap0 type __ap
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
ifdown wlan0
ip link set uap0 up
ip addr add 192.168.99.1/24 broadcast 192.168.99.255 dev uap0
service hostapd start
ifup wlan0
service dnsmasq start
- Edit the
/etc/dnsmasq
file and add and/or adjust the following for your AP's DHCP network scope:
interface=uap0
dhcp-range=192.168.4.20,192.168.4.100,255.255.255.0,12h
- Edit your
/etc/hostapd/hostapd.conf
file and change your SSID and passphrase appropriately.
interface=uap0
driver=nl80211
ssid=YOUR-SSID
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=YOUR-PASSPHRASE
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
-
Edit
/etc/default/hostapd
and add this line:
DAEMON_CONF="/etc/hostapd/hostapd.conf"
-
If you intend to use an attached ethernet usb dongle or the Pi Zero as a wireless client WHILE it is an AP, you will need to allow for routing by editing
/etc/sysctl.conf
and uncommenting:net.ipv4.ip_forward=1
-
Reboot
-
Connect the Zero to the network device via USB.
-
Login to the Zero remotely and run
screen /dev/ttyUSB0
-
CTRL-A
then typeK
will break out and kill the "screen"