I am using my Ubuntu 18.04 laptops hotspot to share the network with mobile and other devices.
for that everytime, I need to go to settings then select WiFi and then need to turn on hotspot hush😰.
So I thought that can I start this via terminal instead of this process.
I searched for it but didn’t get a good solution and after searching for an hour I am able to start it using terminal only so I decided to share this simple command to start hotspot in Ubuntu.
$ nmcli device wifi hotspot con-name my-hotspot ssid my-hotspot band bg password P@ss123456
when you run this command you will see the following output.
So your WiFi Hotspot is enabled, enjoy your surfing on your mobile as well. 🙂
Edit 1: Some of my colleagues asked me to do with windows machine so I created 1 BAT file to start hotspot as well, so here is the process to start hotspot on windows 10 laptop.
For Windows we need to create BAT file so when we click on it then it can run in the background and start hotspot.
So let’s get started.
- Go to Desktop, right click and create a New Text Document.
- Write the following code in the file.
netsh wlan set hostednetwork mode=allow
netsh wlan set hostednetwork mode=allow ssid=free key=123456789
netsh wlan start hostednetwork
- Now Save it on Desktop As [filename].BAT also select Save As type to All.
- Now when you click on newly created BAT file WiFi will turn on.
That’s it so Now your laptop turns to mobile hotspot as well.