Type to search

Android Arena featured Linux Tutorials

Procedure to create Wifi Hotspot on Linux |Creating Wireless Access point on Linux [Ubuntu/LinuxMint/Fedora/OpenSUSE]


Many times, we need to share our Internet Connection to our mobile devices/other laptops or gadgets, but we do not have a wifi router or wireless access point at our disposal. In such cases we can use our PC/laptop itself as a wireless access point to share the internet connection to other devices, and its free and doesn’t require any extra hardware too. while Windows OS contains softwares such as connectify.me,virtual router which do the same, Linux on the  other hand has fewer alternatives, one of those alternatives is : hotspotd by prahladyeri@github . Lets have a look on how to create wifi hotspot linux . I have personally tested this on Ubuntu and LinuxMint but it should work on most linux distros.

Hotspotd is a small daemon to create a wifi hotspot on linux, it works by creating a virtual NAT (Network address transation) table between your connected device and the internet using linux iptables.

Requirements/Pre-requisites for using hotspotd to create access point

  • dnsmasq (typically pre-installed on most linux distributions).
  • hostapd for AP provisioning.

hostapd must be installed for hotspotd to be installed, you can install hostapd by running these commands in the terminal —

For Ubuntu based terminal command issudo apt-get install hostapd

And for RHEL based distros

terminal command : yum install hostapd

hostapd install is quick in process and will get processed in 2 seconds maximum :)shown in the figure below – .

Now after you have installed hostapd , we need to install our hotspot app – hotspotd

Installation of hotspotd –

To install hotspotd, just follow these steps: , type them one by one in the terminal :

First of all we will download the hotspotd package from wget command –

wget https://github.com/prahladyeri/hotspotd/raw/master/dist/hotspotd-0.1.tar.gz

Now,we uncompress the tar file and navigate to the extract directory –

tar xvf hotspotd-0.1.tar.gz
cd hotspotd-0.1/

Here, in this installation directory we give the setup command from the terminal by —

sudo python setup.py install

If everything goes fine, hotspotd will be installed successfully 🙂

Using the Hotspot

To start hotspot:

sudo hotspotd start

To stop hotspot:

sudo hotspotd stop

The first time you run hotspotd, it will ask you for configuration values for SSID, password, etc. Thus enhancing the security of your hotspot and giving you more customizable options to play with 🙂

Alternatively, you may also run:

sudo hotspotd configure

Precutionary Measures / Troubleshooting

  • Make sure all dependencies (hostapd, dnsmasq and python 2.7) are installed.
  • hotspotd creates the NAT by manipulating iptables rules. So if you have any other firewall software that manipulates the iptables rules (such as the firewalld on fedora), make sure you disable that.
  • To create a hotspot, your wifi must support AP mode. To find that out, use this process:
    • Find your kernel driver module in use by issuing the below command:lspci -k | grep -A 3 -i network(example module: ath9k)
    • Now, use the below command to find out your wifi capabilities (replace ath9k by your kernel driver):modinfo ath9k | grep depend
    • If the above output includes “mac80211” then it means your wifi card will support the AP mode.

Rejoice, Now you  can use and share your Internet Connection on as many devices as you want  🙂 also, you can create a wifi hub for Gaming too 🙂 , If any doubts/queries/suggestions feel free to comment 🙂

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.