Use your Raspberry Pi as WiFi router

Using this guide I successfully turned my Raspberry Pi with an Edimax WiFi dongle into a WiFi hotspot. Here’s how:

  • setup customized hostapd
  • setup dhcp server
  • configure NAT

My network layout looked like this:

internet - router - Pi - tablet
             |---- PC

Now the tablet is able to connect to the PC, but not the other way round. To fix this, add a route to the PC’s IP configuration:

ip route add -net $PI_NETWORK netmask gw $PI_IP

Replace $PI_NETWORK and $PI_IP with your own values.