How to Create a WiFi Hotspot for Sharing a Wireless Internet Connection in Linux

It’s very simple and easy to create a hotspot from your network card to get other devices to connect with the internet using the linux-wifi-hotspot tool that turns your network card into a hotspot.

There might be a situation where you want to create a hotspot from your network card and use it with other devices like your laptop, mobile phone, tablet, etc., but it is not convenient at all to create a hotspot on the Linux platform.

because you have to make the changes yourself, which takes some skill and time and can be confusing for a new user. As a result, I’m here to show you how to easily create a WiFi hotspot in just a few simple steps using the linux-wifi-hotspot tool.

All you need to do is install the linux-wifi-hotspot tool, run it in your terminal, or use the graphic interface to enter the details like a hotspot name, password, and security key, and that’s all you need to do in order to create the hotspot.

Some features

I won’t be able to tell you the features of this tool once you start the installation step, so now it’s time to familiarize yourself with the features of this tool.

  • linux-wifi-hotspot has both CLI and GUI support
  • Create a wifi access point from any network interface
  • You can share wifi connection via QR code
  • Information connected devices
  • Support both 2.4GHz and 5GHz 
  • Choose between IEEE 80211n, IEEE 80211ac modes
  • Modify things like wifi channel, mac address, and etc

There is one thing I like to tell you before heading ahead like some WiFi adapters do not support Access Point (AP), which is necessary to create a hotspot, so you may not be able to use it, especially if your device is equipped with a Realtek NIC.

Installation

If you use Ubuntu/Debian-based distributions like Linux Mint, Pop! OS, and others, you can add a PPA for linux-wifi-hotspot, or you can download the.deb binary file from the release section and install it manually.

For other Linux based distros, you can install it from the source file, so don’t worry about it.

Install linux-wifi-hotspot on Ubuntu using PPA

To install linux-wifi-hotspot on Ubuntu based distributions, open the Terminal and run the following command to add the PPA for linux-wifi-hotspot:

$ sudo add-apt-repository ppa:lakinduakash/lwh

After that, you need to update your repository to fetch the linux-wifi-hotspot package by running the following command, which will first update the repository, and then the next command will install the linux-wifi-hotspot:

$ sudo apt update
$ sudo apt install linux-wifi-hotspot

Once the installation is done, you can start configuring the linux-wifi-hotspot on your machine by looking for wihotspot in the Application menu.

Install linux-wifi-hotspot using .deb file

If you’re using a Debian-based distribution or don’t want to install a PPA, you can use this method, in which I’ll show you how to download and install a.deb binary file on your system.

So let’s begin by downloading the deb binary file of linux-wifi-hotspot from the release section of the project. From there, you can fetch the latest version of this application, or else you can use the below command to download the .deb binary file directly from the terminal.

$ wget https://github.com/lakinduakash/linux-wifi-hotspot/releases/download/v4.4.0/linux-wifi-hotspot_4.4.0_amd64.deb

Once you’ve downloaded the .deb file, run another command to install the.deb binary file.

$ sudo apt install ./linux-wifi-hotspot_4.4.0_amd64.deb

Install linux-wifi-hotspot using the source file

Alternatively, you can also install linux-wifi-hotspot from the source file, for which you need to fulfill a few dependencies such as make gcc and g++, build-essential, pkg-config, gtk, libgtk-3-dev, libqrencode-dev (for qr code generation), and libpng-dev (for qr code generation).

For instance, if you want to install linux-wifi-hotspot on RHEL-based distributions like Fedora/CentOS/Rocky Linux/Oracle Linux, then you can run the below command to fulfill dependencies.

$ sudo dnf install -y gtk3-devel gcc gcc-c++ kernel-devel pkg-config make hostapd qrencode-devel libpng-devel

After that, execute the following set of commands to start the installation.

$ git clone https://github.com/lakinduakash/linux-wifi-hotspot
$ cd linux-wifi-hotspot
$ make
$ sudo make install

Once you complete the above step, move on to the next section, where I’ll show you how to use linux-wifi-hotspot to create a hotspot with your network card.

Create a WiFi Hotspot on Linux

You can create a hotspot using the command line and its GUI tool by using the linux-wifi-hotspot tool, which allows you to easily set up your own wireless hotspot in just a few steps.

Create WiFi Hotspot using GUI

The linux-wifi-hotspot tool provides a graphical user interface that makes the process of setting up a wireless hotspot easier with just a few simple clicks.

To get started, you must first go to the Applications menu and search for “wihotspot” or “Wi-Fi hotspot.”

After you have found the application, click on it to launch the programme, and once you have opened the application, you will find a similar kind of interface on your end.

Wi Hotspot Interface
Wi Hotspot Interface

On the main interface of the application, you will find various options, such as SSID, the Password check box to enable WPA2 encryption, which you can use to protect the hotspot, the WiFi interface to select the network card on which to activate the hotspot, and the Internet interface drop down menu to use the internet connection from the specific nic.

So let me show you how it will look once you make some basic changes to it.

Create a hotspot from you current wifi interface
Create a hotspot using your existing WiFi interface

If you want, you can further customise by selecting the “Advanced” menu, which will bring up a list of options such as changing the frequency band, hiding the SSID, setting a custom Mac, and many more.

Wi Hotspot Advanced menu
Wi Hotspot Advanced settings

After that, I’ll click on “Create hotspot” to start the hotspot from the active wifi interface, and once it activates, the “Open QR” and “Stop” buttons will be enabled for you to use.

But when I clicked “Create hostpot,” I found that my Realtek card wasn’t compatible with this feature. So I used another network card to make the hotspot.

If you want to check how many devices are connected to your hotspot, you can click on “Connected devices” to get information about each connected device.

Connected devices
Connected devices

Create WiFi Hotspot using terminal

On the other hand, you can use the create_ap command to create a hotspot, which is actually a fork of oblique/create_ap that is designed to easily create a wireless access point from the command line.

So let’s see how you can use create_ap to create a wireless hotspot on your Linux machine.

// Create open hotspot 
$ sudo create_ap wlan0 eth0 MyAccessPoint   
// Create hostpot with WPA + WPA2 passphrase:                                 
$ sudo create_ap wlan0 eth0 MyAccessPoint MyPassPhrase
// Create hostpot using the same WiFI interface
$ create_ap wlan0 wlan0 MyAccessPoint MyPassPhrase
// Create hotspot using different wireless card
$ sudo create_ap --driver rtl871xdrv wlan0 eth0 MyAccessPoint MyPassPhrase

Once you execute any command from the above, it will start running in the foreground, so you cannot use the current terminal for other tasks.

To avoid this, you can use the --daemon option, which will run the process in the background.

$ sudo create_ap --daemon wlan0 wlan0 MyAccessPoint MyPassPhrase

It sounds simple enough, doesn’t it?

Wrap up

That’s all for this article, where you learned how to create a wifi hotspot for sharing a wireless internet connection in Linux. If you are having trouble with a Realtek WiFi adapter, you can get help from this guide.

Also Read: How to generate QR code from Linux Terminal

If you have any questions or comments, please feel free to leave them in the comments section below. Until then, put your feet up and relax. As always, the next article will be up shortly.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments