Tag Archives: router

Raspberry Pi as wifi router

Install required packages

  • rfkill: a wireless utility
  • zd1211-firmware: common firmware that works with many Wi-Fi dongles
  • hostapd: the hostap wireless access point daemon
  • hostap-utils: supplemental hostap tools
  • iw: wireless configuration utility
  • dnsmasq: DHCP and DNS utility
  • bridge-utils:  used for connecting multiple Ethernet devices together

Getting WiFi adapter running

Check that the RPi recognizes the Wi-Fi dongle.


Verify that the Wi-Fi dongle supports AP mode

Configure the Wireless Interface

Make a backup of /etc/network/interfaces and then open it in a text editor:

edit /etc/network/interfaces as below:

Restart the wlan0 interface:

Configure hostapd Settings

edit /etc/hostapd/hostapd.conf as below:


Configure dnsmasq Settings

configure /etc/dnsmasq.conf with

After saving the file, you can easily verify all the settings were correct with the following command (it just parses out the comments and blank lines):

Restart the dnsmasq service to apply the settings:

Enable Forwarding to Reach the Internet

Enable IPv4 forwarding

Enable NAT