Skip to content

Instantly share code, notes, and snippets.

@bewest
Created August 18, 2015 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bewest/1d0ac7e5016fa47cde3a to your computer and use it in GitHub Desktop.
Save bewest/1d0ac7e5016fa47cde3a to your computer and use it in GitHub Desktop.

Making the RPi2 an Access Point using the Edimax USB WiFi Adapter

To ensure connectivity with ambulatory use and irrespective of a mobile data connection, the Edimax USB WiFi adapter will be configured to act as if it were a router and broadcast a local personal area network.

Run these steps

curl -s https://gist.githubusercontent.com/bewest/1d0ac7e5016fa47cde3a/raw/c57f1eb26428464438ec8dfc1cbaaf44664343df/setup_rpi_hostapd.sh | sudo bash

Congratulations, a test network should be available.

#!/bin/bash
apt-get install -y bridge-utils hostapd
(mkdir updated-hostapd
cd updated-hostapd
wget http://www.daveconroy.com/wp3/wp-content/uploads/2013/07/hostapd.zip
unzip hostapd.zip
mv /usr/sbin/hostapd /usr/sbin/hostapd.bak
chown root.root hostapd
chmod 755 hostapd
mv hostapd /usr/sbin/hostapd.edimax
ln -sf /usr/sbin/hostapd.edimax /usr/sbin/hostapd
)
cp /etc/network/interfaces /etc/network/interfaces-backup
OUTFILE=${OUTFILE-/etc/network/interfaces}
echo installing network interfaces in $OUTFILE
cat <<EOF | tee $OUTFILE
#loopback adapter
auto lo
iface lo inet loopback
#wired adapter
iface eth0 inet dhcp
#bridge
auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan0
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment