Skip to content

Instantly share code, notes, and snippets.

@zhhailon
Created October 7, 2017 05:34
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 zhhailon/35b9ca183f582841efb419646ece8dff to your computer and use it in GitHub Desktop.
Save zhhailon/35b9ca183f582841efb419646ece8dff to your computer and use it in GitHub Desktop.
sudo apt-get update
sudo apt-get dist-upgrade
sudo rpi-update
sudo apt-get install dnsmasq hostapd
sudo systemctl stop dnsmasq
sudo systemctl stop hostapd
# /etc/dhcpcd.conf
interface wlan0
static ip_address=192.168.4.1/24
static routers=192.168.4.1
static domain_name_servers=8.8.8.8
#/etc/dnsmasq.conf
interface=wlan0
domain-needed
bogus-priv
dhcp-range=192.168.4.8,192.168.4.250,12h
#/etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
ssid=RPiNet
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
#/etc/default/hostapd
DAEMON_CONF="/etc/hostapd/hostapd.conf"
#/etc/sysctl.conf
net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE
sudo iptables -A FORWARD -i ethX -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o ethX -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment