How can I turn on wifi and hotspot simultaneously in Ubuntu 20.04?

Solution 1:

Install Linux wifi hotspot

sudo add-apt-repository ppa:lakinduakash/lwh
sudo apt update
sudo apt install linux-wifi-hotspot

Then find the wifi hotspot program in your program menu

The create_ap hasn't been maintained since July 2020

Solution 2:

You will need hostapd package and create_ap utility to do this. hostapd (host access point daemon) is a background process that can be used to create authenticated servers and access points.

create_ap is actually a script that offers some useful Wireless features. One of the features is creating a bridged Wi-Fi access point. You can go through its features and commands here

First, install the hostapd package

sudo apt install hostapd
sudo apt update

Now, download the create_ap-master zip file from here

Extract the zip file, open a terminal in that directory (create_ap-master) and then run the following command

sudo make install

You have installed all the necessary tools. Now, you need to find out the Wi-Fi interface name which usually starts with wl. To get get this, simply run

ifconfig

If the above command did not work, install the net-tools package and run the above command again. The ifconfig stands for interface configuration and it gives all the possible interfaces that your network card can establish. You can see the results starting with en (ethernet), lo (loopback) and wl (wifi). Note down the wifi interface name e.g., wlo1

You can use the example commands in the official github page of create_ap that is given in the first link. For creating an ap sharing the same wifi interface, the given example isenter image description here

Note that wlan0 is the wifi interface name. Replace it with the wifi interface name you got from the results of ifconfig command. So, to creat an wifi access point with <hotspot_name> and <pass_word>, run the following command.

sudo create_ap wlan0 wlan0 <hotspot_name> <pass_word>

Don't forget to replace wlan0 with your wifi interface name. Also, choose your desired hotspot name and password. After successfully doing the above steps, you can see your device's wifi and hotspot running simultaneously. It can now share the internet connection through an access point you just created.