Thursday, November 20, 2014

wpa_supplicant connect to hidden ssid

*** Access point information
- ssid: linux-ap
- password: 1234567890

1- generate the configuration file for connecting to AP
root@wireless:/# wpa_passphrase  linux-ap 1234567890 > /etc/wpa_supplicant/linuxap.conf

2- add option scan_ssid=1 to file /etc/wpa_supplicant/linuxap.conf so final configuration will look like below

network={
    scan_ssid=1
    ssid="linux-ap"
    #psk="1234567890"
    psk=d64cce6bd10fe70caf6bd9befccd3c758634d18a352bc1f0ee1490999a45a6db
}

3- use wpa_supplicant to connect to the AP
root@wireless:/# wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/linuxap.conf
 Successfully initialized wpa_supplicant
wlan0: CTRL-EVENT-SCAN-STARTED
wlan0: SME: Trying to authenticate with d4:ca:6d:c6:c5:ba (SSID='linux-ap' freq=2412 MHz)
wlan0: Trying to associate with d4:ca:6d:c6:c5:ba (SSID='linux-ap' freq=2412 MHz)
wlan0: Associated with d4:ca:6d:c6:c5:ba
wlan0: WPA: Key negotiation completed with d4:ca:6d:c6:c5:ba [PTK=CCMP GTK=CCMP]
wlan0: CTRL-EVENT-CONNECTED - Connection to d4:ca:6d:c6:c5:ba completed [id=0 id_str=]

wlan0: WPA: Group rekeying completed with d4:ca:6d:c6:c5:ba [GTK=CCMP]
wlan0: WPA: Group rekeying completed with d4:ca:6d:c6:c5:ba [GTK=CCMP]
wlan0: WPA: Group rekeying completed with d4:ca:6d:c6:c5:ba [GTK=CCMP]


4- show wlan0 connection
 root@wireless:/# iwconfig wlan0
wlan0     IEEE 802.11bgn  ESSID:"linux-ap" 
          Mode:Managed  Frequency:2.412 GHz  Access Point: D4:CA:6D:C6:C5:BA  
          Bit Rate=6.5 Mb/s   Tx-Power=20 dBm  
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=70/70  Signal level=-31 dBm 
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0



No comments:

Post a Comment