LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-16-2016, 06:58 AM   #1
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Rep: Reputation: Disabled
Why cann't connected to my ap with android phone?


I have created an ap according to the article.
http://www.niwi.cz/clanky/it-poznamk...figuration-730

For my wireless net card.

iw list
Supported interface modes:

* IBSS
* managed
* AP
* AP/VLAN
* monitor
* mesh point
* P2P-client
* P2P-GO

cat /etc/network/interfaces

auto dsl-provider
iface dsl-provider inet ppp
pre-up /bin/ip link set eth0 up
provider dsl-provider

auto eth0
iface eth0 inet static
address 192.168.22.1
netmask 255.255.255.0
dns-server 114.114.114.114
auto wlan0
iface wlan0 inet static
address 192.168.22.2
netmask 255.255.255.0

cat /etc/hostapd/hostapd.conf

hw_mode=g
channel=11
driver=nl80211

ssid=test
interface=wlan0

# encryption
wpa=2
wpa_passphrase=password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
ctrl_interface=/var/run/hostapd

# Only root can configure hostapd
ctrl_interface_group=0

cat /etc/dnsmasq.conf

interface=wlan0
listen-address=192.168.22.1
dhcp-range=192.168.22.2,192.168.22.150,12h
dhcp-option=3,192.168.22.1
dhcp-option=6,114.114.114.114

All the configuration files are listed here.
Now let's start ap.

nmcli radio wifi off
rfkill unblock wlan
ifconfig wlan0 192.168.22.2 up
service dnsmasq restart
service hostapd restart
hostapd /etc/hostapd/hostapd.conf

To connect the ap with my android phone with ssid `test` and password `password`.

The info displayed on pc's console:

hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Using interface wlan0 with hwaddr 00:1a:8c:30:08:b1 and ssid "test"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
wlan0: STA f0:79:59:cb:d8:eb IEEE 802.11: authenticated
wlan0: STA f0:79:59:cb:d8:eb IEEE 802.11: associated (aid 1)
wlan0: AP-STA-CONNECTED f0:79:59:cb:d8:eb
wlan0: STA f0:79:59:cb:d8:eb RADIUS: starting accounting session 5789EE90-00000000
wlan0: STA f0:79:59:cb:d8:eb WPA: pairwise key handshake completed (RSN)
wlan0: AP-STA-DISCONNECTED f0:79:59:cb:d8:eb
wlan0: STA f0:79:59:cb:d8:eb IEEE 802.11: authenticated
wlan0: STA f0:79:59:cb:d8:eb IEEE 802.11: associated (aid 1)
wlan0: AP-STA-CONNECTED f0:79:59:cb:d8:eb
wlan0: STA f0:79:59:cb:d8:eb RADIUS: starting accounting session 5789EE90-00000001
wlan0: STA f0:79:59:cb:d8:eb WPA: pairwise key handshake completed (RSN)

There is always in `authenticating` status in my android phone ,why can't connected?
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2016-07-16-09-58-36.png
Views:	9
Size:	103.2 KB
ID:	22476  
 
Old 07-16-2016, 09:56 AM   #2
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,405
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Why cann't connected to my ap with android phone?

Any iptable rules or firewall configured?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a windows phone be connected to a PC running Mint 16? nlgootee Linux Mint 1 11-05-2014 11:31 AM
How to get the details of a android phone connected to wifi ? pradiptart Linux - Wireless Networking 9 07-27-2012 09:32 PM
How to know my nokia phone connected port number ?? amritpalpathak Linux - Software 3 06-23-2011 05:35 PM
Loaded Ubuntu 7.04. Mobile phone connected with cable via usb. Phone is seen, Hec Linux - Newbie 1 02-09-2008 04:46 AM
at last i found out how can my phone be connected as modem via blue telnet_ping Linux - Hardware 0 09-09-2007 01:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration