6

I have a Debian Wheezy machine with hostapd running. I want it to make a WPA2-PSK secured WLAN Hotspot. I can see the Hotspot from my Android phone, but every time I try to connect to it, it shows "Getting IP-Address" for a very long time, and then it says "avoided weak web connection" ("Schwache Internetverbindung gemieden").

My /etc/hostapd/hostapd.conf file contains the following:

ctrl_interface=/var/run/hostapd
###############################
# Basic Config
###############################
macaddr_acl=0
auth_algs=1
# Most modern wireless drivers in the kernel need driver=nl80211
driver=nl80211
##########################
# Local configuration...
##########################
interface=wlan0
#bridge=br0
hw_mode=g
channel=1
ssid=HereIsMySSID
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=HereIsMyPassphrase
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

If I change the wpa_key_mgmt to WPA2-PSK, I get the following error:

# hostapd /etc/hostapd/hostapd.conf 
Configuration file: /etc/hostapd/hostapd.conf
Line 22: invalid key_mgmt 'WPA2-PSK'
FT (IEEE 802.11r) requires nas_identifier to be configured as a 1..48 octet string
2 errors found in configuration file '/etc/hostapd/hostapd.conf'
#

My hostapd version is:

# hostapd -v
hostapd v1.0
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2012, Jouni Malinen <[email protected]> and contributors
#

How can I make this working?

msrd0
  • 490
  • 2
  • 8
  • 22

4 Answers4

1

It sounds like you're missing a DHCP server.

If you haven't set one up, that's why it's getting stuck on "Getting IP-Address"

Eg. https://wiki.debian.org/DHCP_Server

fragmede
  • 94
  • 3
  • I get this error: `[FAIL] Starting ISC DHCP server: dhcpd[....] check syslog for diagnostics. ... failed!` – msrd0 Oct 04 '14 at 10:07
0

If you want it to make a WPA2-PSK connection

wpa_key_mgmt=WPA-PSK

is where the mistake. Rename it to

wpa_key_mgmt=WPA2-PSK

If it doesn't work, I would spend more time tweaking the configuration.

unixmiah
  • 348
  • 1
  • 12
  • This shows me the error `Line 22: invalid key_mgmt 'WPA2-PSK'` – msrd0 Sep 27 '14 at 08:49
  • And what do you mean with _I would spend more time tweaking the configuration_? – msrd0 Sep 27 '14 at 08:52
  • I meant taking a deeper look into your hostapd: http://wireless.kernel.org/en/users/Documentation/hostapd setup configuration. Make sure you restart the wifi and services before you make another attempt to connect via wifi. – unixmiah Sep 28 '14 at 00:07
0

You must add a DHCP server, you can follow a tutorial to configure isc-dhcp-server or udhcpd with hostapd.

And to test that your AP works, you can just try to connect with a Static IP address.

NOTE: You won't have an internet connection if you don't configured Nat and forwarding on Iptables :D

EDIT : I saw that you're using isc-dhcp-server, it says that you need to look in syslog (This file is located in /var/log/syslog and it's the most important log of your system, everything is logged here, from ssh auth fail, to kernel error refer to -> https://en.m.wikipedia.org/wiki/Syslog). So to look in syslog for isc-dhcp-server errors just type cat /var/log/syslog | grep -e isc-dhcp-server -e dhcpd and show us the result :D

Nurrl
  • 61
  • 8
  • unfortunately I asked this question a few years ago and cannot provide you my syslog. I'm currently using [this script in ArchLinux user repository](https://aur.archlinux.org/packages/create_ap-git) which is working quite well (yep I changed operating system in the meantime) – msrd0 Jan 22 '17 at 11:03
0

The reason it gets stuck on "Getting IP-Address" is because nothing is giving it an IP address. In order for you to assign IP addresses, you will need to have a DHCP server. The quickest and easiest way I know of to set one up for a wifi-hotspot is to actually use dnsmasq:

sudo apt-get install dnsmasq

Once that is done you need to edit /etc/dnsmasq.conf and make sure it has the following settings

no-resolv
interface=wlan0 # or whatever wifi card you're using for the AP
dhcp-range=192.168.0.20,192.168.0.50,12h
server=8.8.8.8
server=8.8.4.4

Save and exit.

Restart dnsmasq:

sudo service dnsmasq restart
user3573987
  • 168
  • 2
  • 4
  • 15