Creating a wifi subnet for the dash buttons

It could be useful to have the dash buttons working with the raspberry pi in a place where there is no wifi or internet coverage. The raspberry pi can be setup as a wifi hotspot and the dash buttons configured to join this network. Taking things a bit further, the raspberry pi could be set up to route requests received via the wifi subnet through the cabled network, to the internet router/home network and to the internet.

Yesterday I managed to do this successfully, following this tutorial. Fun times 🙂

The important files for this are:


recipe of steps I followed

  1. sudo apt-get update
  2. sudo apt-get install hostapd isc-dhcp-server
  3. sudo apt-get install iptables-persistent
  4. sudo vi /etc/dhcp/dhcpd.conf
    1. comment the lines
      1. #option domain-name “”;
        #option domain-name-servers,;
    2. uncomment the line
      1. authoritative;
    3. Add the following lines at the end
      1. subnet netmask {
        option broadcast-address;
        option routers;
        default-lease-time 600;
        max-lease-time 7200;
        option domain-name “local”;
        option domain-name-servers,;
  5. sudo vi /etc/default/isc-dhcp-server
    1. add wlan0 to the INTERFACES variable
      1. INTERFACES=”wlan0″
  6. sudo ifdown wlan0
  7. sudo vi /etc/network/interfaces
    1. allow-hotplug wlan0
      iface wlan0 inet static
  8. sudo ifconfig wlan0
  9. sudo vi /etc/hostapd/hostapd.conf
    1. interface=wlan0
  10. sudo vi /etc/default/hostapd
    1. DAEMON_CONF=”/etc/hostapd/hostapd.conf”
  11. sudo vi /etc/sysctl.conf
    1. net.ipv4.ip_forward=1
  12. sudo sh -c “echo 1 > /proc/sys/net/ipv4/ip_forward
  13. create NAT rules with iptables
    1. sudo iptables t nat A POSTROUTING o eth0 j MASQUERADE
    2. sudo iptables A FORWARD i eth0 o wlan0 m state state RELATED,ESTABLISHED j ACCEPT
    3. sudo iptables A FORWARD i wlan0 o eth0 j ACCEPT
  14. sudo sh -c “iptables-save > /etc/iptables/rules.v4”
  15. sudo service hostapd start
  16. sudo service isc-dhcp-server start
  17. sudo service hostapd status
  18. sudo service isc-dhcp-server status
  19. sudo update-rc.d hostapd enable
  20. sudo update-rc.d isc-dhcp-server enable
  21. sudo reboot
  22. tail -f /var/log/syslog

One thought on “Creating a wifi subnet for the dash buttons

  1. Pingback: Loading arduino programs from headless raspberry pi | My Map of things

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s