How to create an Access Point from the current WiFi connection?

5

2

On Ubuntu 14.04, can an adapter have both a hotspot and be connected to a WiFi network at the same time?

If so, how do I share the Internet of the currently connected network over a hotspot in Linux?

If not, why?

Raghav

Posted 2016-11-23T05:26:27.117

Reputation: 53

Answers

5

can an adapter have both a hotspot and be connected to a WiFi network at the same time?

Yes , it's possible to create a hotspot wifi from the same wifi connection

How do I share the Internet of the currently connected network over a hotspot in Linux?

You should use create_ap

Install the dependencies :

sudo apt-get install dnsmasq haveged hostapd build-essential

To install create_ap run:

git clone https://github.com/oblique/create_ap
cd create_ap
sudo make install

enable/start the service:

service create_ap start

To check the status run:

service create_ap status

Using the systemd features (it is not available on Ubuntu 14.04):

sudo systemctl start create_ap.service
sudo systemctl enable create_ap.service

Create the AP

To create your access point run:

sudo create_ap wlan0 wlan0 MyAccessPoint MyPassPhrase

Update for Ubuntu 14.04:

the hostapd version in Ubuntu 14.04 is buggy and doesn't work properly. To get AP-Hotspot to work with hostapd in Ubuntu 14.04, you need to downgrade hostapd and use apt to hold the package so it's not upgraded.

Remove the current version of hostapd:

sudo apt-get remove hostapd

64bit

cd /tmp
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_amd64.deb
sudo dpkg -i hostapd*.deb
sudo apt-mark hold hostapd

32bit

cd /tmp
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/w/wpa/hostapd_1.0-3ubuntu2.1_i386.deb
sudo dpkg -i hostapd*.deb
sudo apt-mark hold hostapd

GAD3R

Posted 2016-11-23T05:26:27.117

Reputation: 2 677

1Thanks a lot, But there's one small problem though. I am using Ubuntu 14.04 and it seems like systemctl cannot be used. Is there any other known alternative to this command? – Raghav – 2016-11-24T19:03:02.923

It also disconnects itself from initially connected network. So effectively only the hotspot is created, without any internet sharing. Here's the output from my terminal : http://pastebin.com/rEBgLBtc

– Raghav – 2016-11-24T19:17:03.310

@Raghav It work very well for you , just keep the running terminal openned. – GAD3R – 2016-11-24T19:24:24.587

1

Yes, the hotspot gets created, but my computer which is connected to Wi-Fi disconnects itself from the AP (WiFi-Router). Only after that, the hotspot turns on. Thus there is no internet connection on my computer's hotspot which I created from this script.

https://www.youtube.com/watch?v=KnBNTE40VJg

– Raghav – 2016-11-25T05:38:38.167

@Raghav I edit my answer , check the current version of hostapd with hostapd -v then downgrade it – GAD3R – 2016-11-25T10:27:22.557

1Is this applicable to Ubuntu 16.04 ? – RoCk RoCk – 2016-11-26T06:28:55.737

@RoCk it work without downgrading hostapd – GAD3R – 2016-11-26T18:20:33.383

1For me this worked also for a 'wwan0' interface connected to the internet. – Nikos Alexandris – 2018-11-10T11:32:43.267

1

See this question.

Basically, find your wifi interface, then sudo iw dev wlp8s0 interface add wlp8s1 type station to create the new interface.

You can use this method to create a virtual interface, use one interface to connect to a network and use another one to create an ad-hoc network for hotspot. This should be pretty straight-forward (googling, of course), since NetworkManager has (a nice) UI. For example, this should do it.

vfsoraki

Posted 2016-11-23T05:26:27.117

Reputation: 1 927

-1

Just try this one, I found this working in my Windows 10 PC while my PC is connected to my internet, it also serves as a server (host) during my Android development.

Install WINE (Ubuntu Store) in your Ubuntu 14.04 it makes .exe runs on Ubuntu.

And Run this one WLAN Launcher which will make your PC - turn to Hotspot mode (host).

Provide a password you like and network name. Then Start .

WLAN

RoCk RoCk

Posted 2016-11-23T05:26:27.117

Reputation: 155

I might as well resort to Windows for this! – Raghav – 2016-11-24T19:18:12.123

What do you mean by that? – RoCk RoCk – 2016-11-25T04:39:19.617

Wine is an emulator for running .exe files. Doing that everytime I wanna create a hotspot is a pain in the ass. What I asked in my question was, was there a way to create a hotspot using Linux itself. Anyway, thank you for your response. :) – Raghav – 2016-11-25T10:41:55.563

Oopps, I didn't noticed. But did you try this one? Did it work? – RoCk RoCk – 2016-11-26T06:25:42.833