Making a Hotspot using Debian or Raspbian


Would you like to make an old laptop or Raspberry Pi into a WiFi Hotspot? It’s quite easy to do using hostapd.

Requirements


It’s very light work running a WiFi Hotspot, even an old single core Intel Atom CPU or Raspberry Pi 1 will be fine.

If you have any of these listed things then you’ll be able to follow this guide and set this up for yourself.

  • Computer/Laptop with a WiFi device that supports Access Point mode
  • Raspberry Pi 1/2 with a USB WiFi dongle
  • Raspberry Pi 3 using internal WiFi

This guide will presume you’re starting with a clean install of Debian or Raspbian without a desktop environment and with root permission. Don’t forget to do an ‘apt-get update’ before proceeding.

Install & Configure Hostapd


Install hostapd with this command:

root@hotspot:~ $ apt-get install hostapd

Now, using your editor of choice open ‘/etc/default/hostapd’ and change the line ‘#DAEMON_CONF=””‘ to ‘DAEMON_CONF=”/etc/hostapd/hostapd.conf”

root@hotspot:~ $ vim /etc/default/hostapd
DAEMON_CONF="/etc/hostapd/hostapd.conf"

Create the file we just pointed to

root@hotspot:~ $ vim /etc/hostapd/hostapd.conf

This is the config file we’ll use for hostapd, here you’ll need to input things according to what you want. If ‘wlan0‘ isn’t the right name then change it accordingly.

interface=wlan0
bridge=br0
driver=nl80211

# COUNTRY CODE
country_code=AU

# SSID (NAME)
ssid=DIYFI
hw_mode=g

# WIFI CHANNEL
channel=6
ieee80211n=1
wmm_enabled=1

wpa=2

# PASSPHRASE HERE
wpa_passphrase=1234567890

wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0

Here is a working config to get you started. The main ones you’ll want to change are country code, SSID, passphrase and possibly channel. You can run WiFi Analyzer on a smartphone to see what channel is least used.

 Creating a Network Bridge


Now we have to create the network bridge by installing ‘bridge-utils‘ and editing the ‘/etc/network/interfaces‘ file.

root@hotspot:~ $ apt-get install bridge-utils
root@hotspot:~ $ vim /etc/network/interfaces

In the config file I’ll be presuming ‘eth0‘ is your wired connection and ‘wlan0‘ is going to be your access point. If they aren’t then change the names accordingly. You may also have to change the IP according to your setup.

source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual

auto lo br0
iface br0 inet static
bridge_ports wlan0 eth0
address 192.168.1.2
network 192.168.1.0
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1

You’re ready to reboot now! Just type ‘reboot‘ and when it’s back on the login screen you’ll be able to see the hotspot.

If you have any trouble please post a comment and I’ll try to help.

Share this postTweet about this on TwitterShare on FacebookPin on Pinterest

One thought on “Making a Hotspot using Debian or Raspbian

  1. R4Z0R84

    Nice! I’ve done similar on an old netbook, though it didn’t share the internet and was to host an intranet website to deploy updated iPad wireless profiles.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *