9

I have been searching forever regarding this issue, and I'm not finding anyone with my unique circumstances. I'm trying to set up a wifi hotspot using Ubuntu. I was able to do this via Windows 7, however my laptop doesn't have Win7, so I'm trying to create the same setup on my laptop.

The adapter I am using is an ALFA AWUS036NHR V.2. As far as I can tell the drivers are pre-installed in Ubuntu, as it is able to connect to networks.

I set up the ap-hotspot per various instructions around the web.

I am using the command

sudo ap-hotspot config

sudo ap-hotspot start

All of my devices can see the network, however the android gets an authentication error, the iphone keeps getting "wrong passcode" and the raspberry pi is going in a "4 way handshake (station)" disconnect/reconnect loop.

When I went through this excercise on Windows 7, I had to manually force the adapter to use different drivers until I found one that worked as a hotspot. I'm concerned this may be the issue here as well, however I can't even get my system to install the drivers from the alfa.com.tw website. I am using a fresh Ubuntu 12.04 install on an HP Elitebook 8530 laptop. Below is the output of ap-hotspot debug

sudo ap-hotspot debug
Starting Wireless Hotspot...
* Stopping DNS forwarder and DHCP server dnsmasq
* (not running)
update-rc.d: warning: hostapd start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5)
update-rc.d: warning: hostapd stop runlevel arguments (none) do not match LSB Default-Stop values (0 1 6)
Disabling system startup links for /etc/init.d/hostapd ...
Removing any system startup links for /etc/init.d/hostapd ...
/etc/rc0.d/K20hostapd
/etc/rc1.d/K20hostapd
/etc/rc2.d/K80hostapd
/etc/rc3.d/K80hostapd
/etc/rc4.d/K80hostapd
/etc/rc5.d/K80hostapd
/etc/rc6.d/K20hostapd
Adding system startup for /etc/init.d/hostapd ...
/etc/rc0.d/K20hostapd -> ../init.d/hostapd
/etc/rc1.d/K20hostapd -> ../init.d/hostapd
/etc/rc6.d/K20hostapd -> ../init.d/hostapd
/etc/rc2.d/K80hostapd -> ../init.d/hostapd
/etc/rc3.d/K80hostapd -> ../init.d/hostapd
/etc/rc4.d/K80hostapd -> ../init.d/hostapd
/etc/rc5.d/K80hostapd -> ../init.d/hostapd
update-rc.d: warning: dnsmasq start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5)
update-rc.d: warning: dnsmasq stop runlevel arguments (none) do not match LSB Default-Stop values (0 1 6)
Disabling system startup links for /etc/init.d/dnsmasq ...
Removing any system startup links for /etc/init.d/dnsmasq ...
/etc/rc0.d/K85dnsmasq
/etc/rc1.d/K85dnsmasq
/etc/rc2.d/K85dnsmasq
/etc/rc3.d/K85dnsmasq
/etc/rc4.d/K85dnsmasq
/etc/rc5.d/K85dnsmasq
/etc/rc6.d/K85dnsmasq
Adding system startup for /etc/init.d/dnsmasq ...
/etc/rc0.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc1.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc6.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc2.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc3.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc4.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc5.d/K85dnsmasq -> ../init.d/dnsmasq
* Restarting DNS forwarder and DHCP server configuration syntax check
...fail!
net.ipv4.ip_forward = 1
Wireless Hotspot active

I'm fairly new at this so I'm not sure what is wrong, but it appears to be very many things. Please let me know if there's any further information needed.

4

3 Answers 3

1

Short answer: you probably have another instance of dnsmasq running. So kill all instances :

Edit 1 (thx to Andrea):

$ sudo killall dnsmasq

Original answer:

$ sudo netstat -taunp | grep -w LISTEN | grep dnsmasq | awk '{print $7}' | sed -r "s/([0-9]+).*/\1/" | xargs kill -9

and try to start the hotspot again :

$ sudo ap-hotspot debug

Starting Wireless Hotspot...
* Stopping DNS forwarder and DHCP server dnsmasq
* (not running)

[...]

* Restarting DNS forwarder and DHCP server dnsmasq
...done.
net.ipv4.ip_forward = 1
Wireless Hotspot active
2
  • Why not killall dnsmasq? Nov 4, 2014 at 17:13
  • Why make it easy when you can make it complicated, right ?
    – Ghis
    Nov 10, 2014 at 10:57
0

You need to uncomment the following line in /etc/sysctl.conf:

net.ipv4.ip_forward=1

Then reboot and everything should work fine.

1
  • It does not work ....and i still get the same error in debug.. Nov 9, 2014 at 15:11
-1

You can use the in-built hotspot function of Ubuntu. Just go to network and into wireless and click start using as hotspot. It works for me to connect Win laptops, android devices, palm devices.

You can also change various other settings from network connections and editing the network type

net settings

7
  • When I set up an ad-hoc network like that, none of my devices even see it. In addition I need infrastructure mode since I need to have an IP address assigned to my raspberry pi Apr 1, 2014 at 22:54
  • look at the screenshot i posted after i edited my answer. it might help you Apr 2, 2014 at 12:46
  • Thanks, however I've been through that setup, and a few of my devices don't see this network. I suspect this is because it is ad-hoc. I need to have an infrastructure mode set up since I require my raspberry pi to have an ip address, so that I can stream video from it. A guy here at work informed me that I may not have DHCP and DNS installed, so I plan to look at that when I get home. Apr 2, 2014 at 18:23
  • if you can see the screenshot, you will realize that the mode has a menu which can be changed to infrastructure. Before you ask questions, do your research on why the person showed a screenshot. You can set dhcp and dns through the same window in the screenshot Apr 3, 2014 at 11:17
  • As per the research I've done I cannot set a hotspot up in this fashion. That appears to be the method to connect to a network. When I search for methods to create networks I can only find a way to create an ad-hoc network via the network manager, and this is the menu option "Create new wireless network". When I follow through with that, my devices can not see it, and I get a "system problem" type of error. If there is a way to actually host the infrastructure network from this window, I can not seem to find it. It just puts it on the list of networks the computer will connect to :/ Apr 4, 2014 at 0:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .