Some time ago, I was pair programming with a friend. The location sadly provided internet access only through network cables. My friend had an Ethernet port, but I didn't (One of the few times I regretted having a newer laptop. At least I still have a headphone jack).
He promptly set up a hotspot for me; Voila, problem solved. He wondered out loud, "I can simultaneously use WiFi and set up a hotspot on Windows, but it never worked on Linux. I always have to plug in the cable first." Prior to this, I didn't know that was possible at all (Still noobish in networking).
I believed that a hack must exist; So I did what one must always do- ask Uncle Google. I managed to find this godsend- create_ap.
What should I do?
- Install the dependencies. Other than
hostapd, you should have most of it installed already:
sudo apt update && sudo apt install hostapd
2. Install create_ap:
git clone https://github.com/oblique/create_ap && cd create_ap && sudo make install
3. Find your Wi-Fi interface's name using the
ifconfig command. For me, it's
wlp2s0, for older versions it's
4. Create the Wi-Fi hotspot! I assume you'll be creating a password-protected Hotspot:
sudo create_ap wlp2s0 wlp2s0 MyHotSpotName MyPassword
That's it! The possible use cases for this are numerous: Maybe you're pretty far away from the router, and your laptop can pick up the signal stably but your phone struggles, or maybe you forgot the network's password but one of your devices is connected to it, etcetera. You can find more ways to use create_ap here.