154

I know how to create a hotspot when connected to a wired network, but when I am using internet from a WiFi connection, this disconnects the wireless connection the moment I activate the hotspot.

In Windows I can use Connectify Hotspot, which enables me to share the internet connection from the same wireless adapter as I am creating an access point on. As you can read on the technology overview page:

Access Point mode allows you to create a hotspot using the same Wi-Fi card that you are using to access the Internet.

How do I do this on Ubuntu?

Braiam
  • 67,791
  • 32
  • 179
  • 269
Ruppesh Nalwaya
  • 1,641
  • 3
  • 11
  • 4
  • 3
    Do you have two Wifi-Sticks or built-in-wifi? Because you need always one to receive and one to send. Even with connectify I think. If you look on their website they alsways show how to share 3G/4G via wifi, but never two wifi like they say in their advertisments. It IS possible, but only with two wifi adapters. I have never heard of a software technology that avoids that. There are other possibilities, though. – verpfeilt Jul 11 '13 at 15:53
  • 6
    I've voted to reopen this question, because it is different from the "How to Share your Internet Connection" question. First of all, the OP found that option already (so does not need the answers there) and secondly, it is about the situation to use a single networking device to share the connection from and to. See also Hotspot and Internet access together — why not? – gertvdijk Jul 25 '13 at 18:07
  • Very Interesting. I like to add, that from the hardware site of things, you need a capable Wireless Card (I know that the lenovo in office is not able to create wireless AP's, it's simply not possible by hardware, business security means) Another thing, is, that you need at least two Antennas to really make it work, or a magic software that can emulate two connections on one Antenna. P.S.: I am not a hardware technician. It is possible that I understood nothing and talk rubbish. ;) – mondjunge Jul 26 '13 at 08:59
  • @mondjunge The single antenna will only force you to use the same frequency/channel. But yes, of course this could be disabled in hardware completely. However, most chipsets are universal by hardware. It's just firmware + drivers that make the difference for most. – gertvdijk Jul 26 '13 at 10:10

11 Answers11

75

Simple steps: Create wifi hotspot in ubuntu

  1. Disable Wifi (Uncheck Enable Wi-Fi)
  2. Go to network connection (Edit Connections...)
  3. Click "Add"
  4. Choose "Wi-Fi" and click "Create"
  5. Type in Connection name like "wifi-hotspot"
  6. Type in SSID as you wish
  7. Choose Device MAC Address from the dropdown (wlan0)
  8. Wifi Security select "WPA & WPA2 Personal" and set a password.
  9. Go to IPv4 Settings tab, from Method drop-down box select Shared to other computers.
  10. Then save and close.
  11. Open Terminal (Ctrl+Alt+T) and type in the following command with your connection name used in step 5.

    sudo gedit /etc/NetworkManager/system-connections/wifi-hotspot
    
  12. Find mode=infrastructure and change it to mode=ap

  13. Now check the network section where wi-fi will be connected to the created hotspot automatically. If you can not find it, go to Connect to Hidden Network... Find the connection and connect to it.

Source: http://ubuntuhandbook.org/index.php/2014/09/3-ways-create-wifi-hotspot-ubuntu/

Purushoth
  • 919
  • My wifi-hotspot was created successfully but when I was connect my phone It Connected but no Internet access So How can I access my Internet access Plz help – Gagan Aug 10 '17 at 13:00
  • Using a USB WiFi adapter as the hotspot, so that my internal card can be the receiver of internet, I get this error: Connection failure. Failed to activate connection. (32) Access Point (AP) mode is not supported by this device. Any way to fix this? – Gabriel Staples Dec 15 '17 at 19:16
  • Great answer!...but....I couldn't get it to work--not on my external USB WiFi adapter nor on my internal Wi-Fi card as the hotspot. :( Here's my answer I just wrote that worked for me instead: https://askubuntu.com/a/986714/327339. – Gabriel Staples Dec 16 '17 at 02:30
  • 2
    Awesome :D, Step 14 -> Connect your laptop to lan and use it on mobile via the created hotspot. Super Awesome :D – Satys Dec 30 '17 at 06:17
  • 2
  • Enable wifi, 15. in terminal ctrl+alt+t sudo service network-manager restart
  • – Ferroao Jan 17 '18 at 15:21
  • 3
    Can't understand the last point 13. I am connected to a wifi names "Wifi", I created another using above path "hotspot". Now what to do? If I disconnect to Wifi from where will internet source come? – ahmadalibaloch Mar 30 '18 at 07:23
  • In Ubuntu 16.04 (may be in future or even in previous version) pause at step 6 to change the mode of connection to 'Hotspot'. – Koushik Shom Choudhury Aug 20 '18 at 14:30
  • It worked, but I had to restart my computer. – Cequiel Oct 27 '18 at 15:44
  • 1
    this wont work as expected. this is only half of work. it create wifi hotstop but not connected to internet – QkiZ Feb 12 '19 at 19:22
  • 11
    From @Purushoth's source(http://ubuntuhandbook.org/index.php/2014/09/3-ways-create-wifi-hotspot-ubuntu/), don't forget the very first step: 1. Disable WIFI and plug in an internet cable to your laptop so that your Ubuntu is connect to a wired internet and wireless is disabled. In other words, this answer REQUIRES INTERNET IN THROUGH ETHERNET before it can share it OUT AS A WIRELESS ACCESS POINT through a wifi adapter. It does not receive internet and broadcast internet all wirelessly on a single wifi adapter. Rather, it receives wired and broadcasts wirelessly. – Gabriel Staples Feb 12 '19 at 20:25
  • #11 is the only useful point from your answer. thank you – stackunderflow Mar 23 '19 at 05:35
  • 2
    On 18.04 you can run nm-connection-editor from the CLI to get the "network connections" screen. – Leopd Sep 24 '19 at 17:33
  • This is the way you create wifi hostspot no more than that – Bawantha Oct 02 '19 at 04:44
  • Downvote because important steps mentioned in comments are ignored – polynomial_donut Mar 21 '20 at 19:35
  • Seems like for some reason, it's also important to check 'Automatically connect to this network when it is available'. Tried connecting once or twice without this checkmark and couldn't even see the network being listed on my other device. Also, seems like 5Ghz being available during setup doesn't mean it is supported (didn't work for me, even though the other device was once connected to another 5Ghz Wi-Fi network) – polynomial_donut Mar 21 '20 at 20:51
  • do the people posting these kinds of responses realize that not everyone uses the same window manager or even an xwindows setup? – Scott Jul 02 '20 at 07:58
  • I get: Connection 'wifi-hotspot' is not available on the device wlx00e62d022ffd at this time. – Nathan B Sep 01 '20 at 13:26
  • Please include @Ferroao 's comment, step #14. And thanks for this great answer! – Yan King Yin Dec 12 '21 at 07:39