Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi the question is simple.

How can i use one wifi adapter to recieve info and also host it. (AKA A WIFI HOTSPOT WHILE USING WIFI) the masquarade algorithm allows for this in my case. And other algorithms do too in other cases. People think its not possible with their respective drivers. But it is mostly.

Right now im using ubuntu12.04.3 but i have tried to solve this issue on fedora core, gentoo, linux mint, debian, and ubuntu12.04.3desktop. I dont see how my distro is relavant since its really just manipulation done via iptables. But maybe certain distros have services that can kill/break this. For example when i use fedora i need to kill nn-applet or network manager plasma and on ubuntu network-manager. Please tell me which linux distros are supported if mine is not. I have browsed the web for a long time on this.. Sadly my life has been dominated by windows. And i can fully write myself a program to do this in visual basics but dont know anything about linux.

Also i have tried various methods online all which create two seperate interfaces one which listens another which shares. All the methods online are basically the same and use tools like iw, udhcpc, hostapd... For reference throught the rest of this post ill be talking about this method which others also have problems with:

I have an eeepc1005hab running Ubuntu12.04.3 desktop

My first step is to connect to internet without network-manager.

sudo service network-manager stop

Yes i know this is harder, but I will need to do it later anyway.

So i tried configuring /etc/wpa_supplicant.conf with

  Proto=RSN  (i also tried WPA and WPA2)
  Pairwise=CCMP (i also tried TKIP AES and combinations)
  Group=CCMP (also tried the above)
} (i tried with "s and without lol)

Ok so I try it out... fail... in my bash script (which you can see in the link) i get many errors... Sometimes it says something about entropy (i tried using /dev/urandom) but since the problem isn't actually about entropy it still fails. Other times it repeats the forever that my interface is associating with the router (the mac address its associating with is correct) but then it says failed.

So I get mad and download the GUI. (Wpa_gui) I set it up and click connect And it says (adapter host):

Status: Completed (station).   (Good right?)
Authentication: WPA2-PSK 
Encryption: CCMP
SSID: Annequ
BBSID: 28:2c:b2:08:68
Ip address:                     (Nothing)

Ok so clearly I'm a noob..(is my problem with udhcpd.conf instead?). Its only my third day on linux so idk what exactly is stopping me from getting connection :( i tried

ifconfig host up And now it gives me an ip in wpa_gui but not connection.

ifconfig -a they are up and running and the wlan0/eth0 is down. My other virual interface can accept clients and evrything! But the problem is when my phone asks for an ipaddress none is given. And its disconnected, and reconnects again with another "handshake accepted"

As you can see trying to connect the host interface to the internet is my problem. if so eone can help me connect this interface, or link me somewhere i can read PLEASE Do!

I have a hacked ROM as my firmware on my android phone for obv reasons and i use my laptop to connect to a vpn and do some tunneling. As you can see doing all that on the laptop makes it a lot easier. (Although i also have it all on the phone) (but if you know about Google android you know about why vpning on pc is better)

"My script" for doing this all automatically is in the link and is actually that guys. And i thank him so much. I will mention îve tried my own little scripts. Actually ive even tried like 5 .sh files i found online also... I went through each line by line ofc... And they all seemed ok...

in the mentioned script i believe one line has an error, so i tried changing this line.

$sudo ifconfig ap1 ether hw 12:34:a3:4f:5g:4e To

$sudo ifconfig ap1 hw ether 12:34:a3:4f:5g:4e And now it works but also apparantly i cannot change my MAC completely. (i can with other tools), but what i did was just change the last digit which was allowed and now interface host gets assigned a seperate address)

So if you know why its not working for me please help :( either way i thank the linux community for the freedom they give me and am in utter shock i have never used linux before. It feels so good. It looks so amazing! Its so powerful

Although setting this up on windows was really easy :( but that's just because im a nooby to Linux.

Also if it helps i will post all my .conf files and i will post my terminal and system logs. Also i can post any other info people need. Maybe i need to reninstall the nl80211 driver. the output on my terminal is missing one obvious thing when i run the script btw.

Host is not associating with the real router propperly, and hence no internet, and hence ap1 is worthlessly accepting clients.

Busybox starts mini dhcp server. And the interfaces are up and broadcasting. And ap1 is functional.

share|improve this question
Perhaps I'm off topic, but have you considered adding another 802.11 adapter via the USB port? Might be a lot easier for you. – K7AAY Oct 21 '13 at 21:06
Yes but i need a portable one clickable solution eventually :/ buying an extra component is also not needed. But in my case i do that. – Leathan Oct 21 '13 at 21:44
Havent you tried with WICD network manager(wicd-gtk)? – user224082 Nov 19 '13 at 14:54
@DuminduMahawela wicd have been depreciated sometime now – Braiam Nov 19 '13 at 18:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.