24

I have upgraded to Ubuntu 16.04. I was using ap-hotspot for wifi hotspot through terminal. It seems ap-hotspot is no more; is there any alternative to create a wifi hotspot? If there is, how can it be installed/used?

  • 4
    To those following the answers here and getting a message like "Connection X is not available on the device wlan0 at this time" while attempting to connect to hidden network: Your wifi device probably does not support master mode (cannot be an AP). To check, see help.ubuntu.com/community/WifiDocs/… – akom Jul 11 '16 at 17:47
38

In Ubuntu 16.04, there’s a Hotspot mode in the WiFi connection editings page that works directly for Android devices. Here’s the step by step:

  1. First disable WiFi and connect your laptop/PC to a wired network.

  2. Click Edit Connections on the network menu. Then click Add on the network connections to add a new connection:

  3. Choose WiFi from the drop-down box in the next window and click Create button.

  4. When the editing WiFi hotspot window pops up, follow these steps:

    1. Type in connection name, SSID, select Hotspot mode.

    2. In Wifi Security tab, select WPA & WPA2 Personal and type in a password.

    3. In IPv4 Settings tab, select mode “Share to other computers”

      Click link for example

  5. After you clicked the save button, enable WiFi and click Connect to Hidden Wi-Fi network and select connect to the connection you just created.

    Click link for example

  6. Your network menu should now have the WiFi hotspot connection:

Finally connect to this hotspot from your Android device and enjoy!

Update!

After following the guide and before enabling WiFi, restart the Network Manager with:

sudo service network-manager restart

Then enable WiFi and it should connect.

  • 11
    I tried this, but when I am connecting through hidden wifi network it says: Failed to activate connection: (2) Connection 'wifihotspot' is not available on the device wlp9s0 at this time. how to tackle this ? I was using ap_hostpot before upgrading to 16.04 without any trouble. – Kt Hafis Apr 30 '16 at 12:28
  • 2
    After following the guide and before enabling WiFi, restart the Network Manager with: sudo service network-manager restart Then enable WiFi and it should connect. – Andy Apr 30 '16 at 19:25
  • 3
    didn't work for me after even reboot, got this error (2) Connection 'k-hotspot' is not available on the device wlp3s0 at this time. – Karim Samir Aug 29 '16 at 11:39
  • 1
    I got the same errors as the above users: Failed to activate connection, (2) Connection 'wifishare' is not available on the device wlp5s0 at this time. – Clock ZHONG Dec 30 '16 at 0:30
  • 1
    You may need to install dnsmasq. – Richard Oct 26 '17 at 17:02
18

One line solution

First, you can try the one line solution based on the command line interface of NetworkManager.

nmcli device wifi hotspot con-name my-hotspot ssid my-hotspot band bg password jesuisunmotdepasse

if it does not work, you should try the 3 line solution here :

Three lines solution

Here is a solution based on the great command line tool of NetworkManager. It is very straight forward, works with WPA and Access Point Mode (so it works on smartphones), and do not need complex set up. Once it's set up, you can just use the graphical interface to toogle the access point. Just run the following lines to create and enable the access point :

# Create a connection
nmcli connection add type wifi ifname '*' con-name my-hotspot autoconnect no ssid my-local-hotspot
# Put it in Access Point
nmcli connection modify my-hotspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
# Set a WPA password (you should change it)
nmcli connection modify my-hotspot 802-11-wireless-security.key-mgmt wpa-psk 802-11-wireless-security.psk myhardpassword
# Enable it (run this command each time you want to enable the access point)
nmcli connection up my-hotspot

Now connect on your Smartphone... When you do not need it anymore, disable it with :

nmcli connection down my-hotspot

To enable it again, you will just need to use the last command of the 4 lines command. You can note that since the connection also appears in the available connections, you can enable/disable it from graphical interface.

  • You may need to install dnsmasq. – Richard Oct 26 '17 at 17:02
10

I use create_ap

Check the GitHub page for details:

This script creates a NATed or Bridged WiFi Access Point.

I usually use this two options :

  1. For Bridged Internet sharing : share your Ethernet or modem internet via WiFi

    create_ap -m bridge wlan0 eth0 MyAccessPoint MyPassPhrase
    

    where wlan0 is your WiFi interface, and eth0 is the interface that offer internet ( Ethernet or modem).

  2. Internet sharing from the same WiFi interface : this will allow you to share the internet from the same WiFi interface, useful if you want to re share the WiFi that you're already connected to it to extend WiFi area for example :

    create_ap wlan0 wlan0 MyAccessPoint MyPassPhrase
    
  • create_ap does not work for 16.04 on my PC. – Indian Apr 27 '16 at 13:52
  • could you please post comments to use it in terminal ? I am not a familiar to do it, and always get confused. thanks in advance – Kt Hafis Apr 30 '16 at 12:31
  • 2
    when I gave the comment, it says: 'wlan0' is not a WiFi interface I changed the command believing wifi interface must be 'wlp9s0' as it shown somewhere, but the response is: ERROR: Your adapter does not support AP (master) mode anything can be done ? – Kt Hafis May 1 '16 at 5:40
  • Yes you should use your interface name instead of wlan0, the second option require that the adapter supports this feature, my be it's not the case. try the first one – Boubouh Karim May 2 '16 at 0:47
  • Could somebody make this run on Ubuntu 16.04? – Filbuntu Jun 21 '16 at 1:54

protected by Community Aug 5 '16 at 22:26

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.