LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   hostapd access point is unable to complete the connection (http://www.linuxquestions.org/questions/linux-networking-3/hostapd-access-point-is-unable-to-complete-the-connection-931395/)

ravi.xolve 02-26-2012 10:42 AM

hostapd access point is unable to complete the connection
 
Hi, I am using openSuse 12.1. I am trying to use hostapd v0.7.3 to make my laptop as an access point.

My network card is:

04:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)

And I am using b43 driver with firmware downloaded using b43-fwcutter. The wireless works fine and it connects to hotspots.

The hostapd config file I am using is:

Code:

interface=wlan0
#bridge=br0
driver=nl80211

ssid=SampleNetwork
hw_mode=g
channel=11

macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

The hotspot starts well, it is detected by other computer and it shows following output on the command prompt:

Code:

Configuration file: sample_hostapd.conf
Using interface wlan0 with hwaddr xx:xx:xx:xx:xx:xx and ssid 'MyNetwork'

But when I connect the other laptop with this access point I get the messages as:

Code:

wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: authenticated
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: associated (aid 1)
AP-STA-CONNECTED yy:yy:yy:yy:yy:yy
wlan0: STA yy:yy:yy:yy:yy:yy RADIUS: starting accounting session 4F4A5E40-00000000
wlan0: STA yy:yy:yy:yy:yy:yy WPA: pairwise key handshake completed (RSN)
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: authenticated
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: associated (aid 1)
wlan0: STA yy:yy:yy:yy:yy:yy RADIUS: starting accounting session 4F4A5E40-00000001
wlan0: STA yy:yy:yy:yy:yy:yy WPA: pairwise key handshake completed (RSN)
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: authenticated
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: associated (aid 1)
wlan0: STA yy:yy:yy:yy:yy:yy RADIUS: starting accounting session 4F4A5E40-00000002
wlan0: STA yy:yy:yy:yy:yy:yy WPA: pairwise key handshake completed (RSN)
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: authenticated
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: associated (aid 1)
wlan0: STA yy:yy:yy:yy:yy:yy RADIUS: starting accounting session 4F4A5E40-00000003
wlan0: STA yy:yy:yy:yy:yy:yy WPA: pairwise key handshake completed (RSN)
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: authenticated
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: associated (aid 1)
wlan0: STA yy:yy:yy:yy:yy:yy RADIUS: starting accounting session 4F4A5E40-00000004
wlan0: STA yy:yy:yy:yy:yy:yy WPA: pairwise key handshake completed (RSN)
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: authenticated
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: associated (aid 1)
wlan0: STA yy:yy:yy:yy:yy:yy RADIUS: starting accounting session 4F4A5E40-00000005
wlan0: STA yy:yy:yy:yy:yy:yy WPA: pairwise key handshake completed (RSN)
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: authenticated
wlan0: STA yy:yy:yy:yy:yy:yy IEEE 802.11: associated (aid 1)
wlan0: STA yy:yy:yy:yy:yy:yy RADIUS: starting accounting session 4F4A5E40-00000006
wlan0: STA yy:yy:yy:yy:yy:yy WPA: pairwise key handshake completed (RSN)


The configuration is never completed after sometime it shows to "Limited Connectivity" at the other laptop which just means no connectivity. What is the solution to this problem please help.

questionsasker 03-24-2012 05:45 PM

same problem here ( exactly the same one )

my system :
ubuntu 11.10
tplink TL-WN822N ( AR9287 + AR7010 )

questionsasker 03-29-2012 12:55 AM

i found a workaround :

first make sure you have dnsmasq-base package installed .

then :

stop hostapd

create an ad hoc network and enable "shared to other computers" on its settings

connect to that ad hoc network

start hostapd

now it works. your laptop will receive network addresses from 10.42.43.0/24 range and the hostapd host will get ip 10.42.43.1 on wlan0


edit:

please let me know if it worked for you

WizadNoNext 03-30-2012 10:40 AM

You need DHCP server or DHCP relay on computer with AP. You actually connect without any problem - you lack IP on connected interface.
Secondly I do not understand why you do not use bridge for this AP. It would make configuration easier.
Code:

brctl addbr br0
brctl addif br0 eth0
hostapd -B /etc/hostapd/hostapd.conf

and it is simply working!

At the moment I have two servers, both with ieee802.11 cards working as AP. On both servers ieee802.11 cards are in bridge br0. One of servers have DHCP server, which serves IPs to any computer connected to internal network.

Actually, if you would put your ieee802.11 card on bridge along with eth0, you do not need any DHCP server nor DHCP relay, as DHCP server in router (or whatever eth0 is connected to) would serve IPs to whatever would be connected to ieee802.11 card.
Why you people like to complicate your lives?

ravi.xolve 03-30-2012 12:47 PM

@WizadNoNext
When I create a bridge the Internet (DNS lookups) on laptop stop working. When I delete the bridge it start working fine.

WizadNoNext 03-30-2012 05:23 PM

ravi.xolve

I have solution for you:
Lets say you two NIC (eth0 and wlan0) on bridge br0 and bridge have address 192.168.170.1 and underlying network is 192.168.170.0/24 then:
Code:

iptables -I INPUT -i br0 -m physdev --physdev-in wlan0 -j ACCEPT
iptables -I INPUT -i br0 -m physdev --physdev-in eth0 -j ACCEPT
iptables -I INPUT -i wlan0 -j ACCEPT
iptables -I INPUT -i eth0 -j ACCEPT
ebtables -t broute -I BROUTING -p ipv4 --ip-src 192.168.170.0/24 --ip-dst ! 192.168.170.0/24 -j redirect --redirect-target DROP

Then it would work. The ! character is most important there, as it states everything "else then" 192.168.170.0/24.
DO NOT redirect or DROP anything destined for your network (especially, if you do not have keyboard and display or serial terminal for box on which you are doing so)!

NICs on bridge should not have IPv4 addresses and bridge should be in promisc mode (you could promisc NICs as well - it won't hurt).

ravi.xolve 04-09-2012 01:58 PM

Problem with creating bride and loosing the Internet connection on primary laptop happens a lot. Because I have no router at my premises and I directly connect to ISP with a modem (hence single IP), that might be the reason I cannot use bridge.

WizadNoNext 04-10-2012 06:01 AM

Then, you have to route it.


All times are GMT -5. The time now is 10:26 AM.