Test wpa_supplicant

To generate passphrase from ascii string:


      wpa_passphrase WIFINAME PASSPHRASE
      # network={
      #   ssid="mdlug"
      #   #psk="GNU-linux"
      #   psk=0655b4dfefffb865426998d1d5db60ce0b42755d1a55e83dcd7aaf40e51833a5
      # }
  

To associate interface with access point from command line.


      cat wpa.conf
      # ...
      # network={
      #   ssid="WIFINAME"
      #   psk="PASSPHRASE"
      # }
      sudo wpa_supplicant -D nl80211 -i wlan1 -c wpa.conf -f wpa.log &
      tail -f wpa.log
      # Successfully initialized wpa_supplicant
      # wlan1: SME: Trying to authenticate with b8:27:eb:f9:63:5e (SSID='mdlug' freq=2412 MHz)
      # wlan1: Trying to associate with b8:27:eb:f9:63:5e (SSID='mdlug' freq=2412 MHz)
      # wlan1: Associated with b8:27:eb:f9:63:5e
      # wlan1: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=US
      # wlan1: WPA: Key negotiation completed with b8:27:eb:f9:63:5e [PTK=CCMP GTK=TKIP]
      # wlan1: CTRL-EVENT-CONNECTED - Connection to b8:27:eb:f9:63:5e completed [id=2 id_str=mdlug]
      # ...
  

To verify radio traffic on access point host:


      cat /etc/hostapd/hostapd
      # ...
      # logger_syslog=15
      # logger_syslog_level=1
      tail -f /var/log/syslog | grep hostapd
      # ...
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr IEEE 802.11: associated
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr WPA: event 1 notification
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr WPA: start authentication
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr IEEE 802.1X: unauthorizing port
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr WPA: sending 1/4 msg of 4-Way Handshake
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr WPA: received EAPOL-Key frame (2/4 Pairwise)
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr WPA: sending 3/4 msg of 4-Way Handshake
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr WPA: received EAPOL-Key frame (4/4 Pairwise)
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr IEEE 802.1X: authorizing port
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr RADIUS: starting accounting session 593DB368-00000004
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr WPA: pairwise key handshake completed (WPA)
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr WPA: sending 1/2 msg of Group Key Handshake
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr WPA: received EAPOL-Key frame (2/2 Group)
      # ... hostapd: wlan0: STA wl:an:1m:ac:ad:dr WPA: group key handshake completed (WPA)
      # ...
  

To verify association while wpa_supplicant is running in background.


      iwconfig wlan1
      # wlan1     IEEE 802.11bgn  ESSID:"WIFINAME"  
      #   Mode:Managed  Frequency:...  Access Point: 11:22:33:44:55:66 ...