Results 1 to 6 of 6

Thread: Access point configuration problem on RPi3

  1. #1
    Join Date
    2018-Jan
    Posts
    9

    Question Access point configuration problem on RPi3

    Hi. I'm trying to establish AP on RPi3 with embedded wifi. So I was hoping for a quick start and tried a few tutorials:
    1. https://elinux.org/RPI-Wireless-Hotspot
    2. https://frillip.com/using-your-raspb...-with-hostapd/
    But none of them worked out.

    So I've tried manually start hostapd by running:
    Code:
    # hostapd /etc/hostapd/hostapd.conf
    Configuration file: /etc/hostapd/hostapd.conf
    wlan0: Could not connect to kernel driver
    Using interface wlan0 with hwaddr b8:20:eb:10:11:33 and ssid "my-wifi-ap"
    wlan0: interface state UNINITIALIZED->ENABLED
    wlan0: AP-ENABLED
    So it is kinda working. At least I see my AP in airodump
    Code:
    B8:20:EB:10:11:33  -26        2        0    0   6  54e  WPA2 CCMP   PSK  my-wifi-ap
    If I try to connect to AP with my phone I see a message on RPi side:
    Code:
    wlan0: STA 1c:5c:f5:23:c4:11 IEEE 802.11: Could not add STA to kernel driver
    There are other problems.
    If I run:
    Code:
    # service hostapd start
    Failed to start hostapd.service: Unit hostapd.service is masked.
    I've checked wifi interface with:

    Code:
    # iw list
    Supported interface modes:
    	 * IBSS
    	 * managed
    	 * AP
    	 * monitor
    	 * P2P-client
    	 * P2P-GO
    	 * P2P-device
    so I see it can work as AP.

    The idea is to establish a wifi connection and ssh to RPi.


    Additional info

    Code:
    # uname -a
    Linux kali 4.9.59-v7_Re4son-Kali-Pi+ #1 SMP Tue Nov 21 00:36:47 CST 2017 armv7l GNU/Linux
    Code:
    # iwconfig 
    eth0      no wireless extensions.
    
    wlan0     IEEE 802.11  ESSID:off/any  
              Mode:Managed  Access Point: Not-Associated   
              Retry short limit:7   RTS thr:off   Fragment thr:off
              Encryption key:off
              Power Management:on
              
    lo        no wireless extensions.
    Code:
    # cat /etc/dhcpcd.conf
    denyinterfaces wlan0
    Code:
    # cat /etc/network/interfaces
    auto lo
    iface lo inet loopback
    
    auto eth0
    iface eth0 inet dhcp
    
    # AP config for wlan0
    iface wlan0 inet static
    	address 192.168.1.1
    	netmask 255.255.255.0
    	network 192.168.1.0
    	broadcast 192.168.1.255
    Code:
    # cat /etc/hostapd/hostapd.conf
    interface=wlan0
    driver=nl80211
    ssid=my-wifi-ap
    hw_mode=g
    channel=6
    ieee80211n=1
    wmm_enabled=1
    ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
    macaddr_acl=0
    auth_algs=1
    ignore_broadcast_ssid=0
    wpa=2
    wpa_key_mgmt=WPA-PSK
    wpa_passphrase=mypass
    rsn_pairwise=CCMP
    Code:
    # cat /etc/default/hostapd
    DAEMON_CONF="/etc/hostapd/hostapd.conf"
    Code:
    # cat /etc/init.d/hostapd
    ...
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    DAEMON_SBIN=/usr/sbin/hostapd
    DAEMON_DEFS=/etc/default/hostapd
    DAEMON_CONF=/etc/hostapd/hostapd.conf
    NAME=hostapd
    DESC="advanced IEEE 802.11 management"
    PIDFILE=/run/hostapd.pid
    
    [ -x "$DAEMON_SBIN" ] || exit 0
    [ -s "$DAEMON_DEFS" ] && . /etc/default/hostapd
    [ -n "$DAEMON_CONF" ] || exit 0
    ...
    Code:
    # cat /etc/dnsmasq.conf
    interface=wlan0 
    listen-address=192.168.1.1 
    bind-interfaces      
    server=209.222.18.222,209.222.18.218    
    domain-needed    
    bogus-priv     
    dhcp-range=192.168.1.2,192.168.1.20,12h
    Could anyone help with that? Thanks.
    Last edited by n3tr4k; 2018-02-07 at 00:18.

  2. #2
    Join Date
    2016-Dec
    Posts
    207
    1. What adapter do you use?
    2. Configuration of dhcp, dnsmasq are irrelevant in this case since it doesn't go any further than hostapd.
    3. Have you looked up the error message "IEEE 802.11: Could not add STA to kernel driver"? What does it say about it?

  3. #3
    Join Date
    2018-Jan
    Posts
    9
    1. What adapter do you use?
    2. Configuration of dhcp, dnsmasq are irrelevant in this case since it doesn't go any further than hostapd.
    3. Have you looked up the error message "IEEE 802.11: Could not add STA to kernel driver"? What does it say about it?
    Hi, thanks for reply.

    1.
    Code:
    # lshw -C network
      *-network:1 DISABLED
           description: Wireless interface
           physical id: 3
           logical name: wlan0
           serial: b8:20:eb:10:11:33
           capabilities: ethernet physical wireless
           configuration: broadcast=yes driver=brcmfmac driverversion=7.45.41.46 firmware=01-f8a78378 multicast=yes wireless=IEEE 802.11
    3. Such problem could arise if too many clients are connected to AP which is clearly not my case. I'm trying to connect only one.

  4. #4
    Join Date
    2018-Jan
    Posts
    9
    Hostapd is running fine, association is OK, dhcp server is running and configured but still no connection.
    Code:
    # hostapd /etc/hostapd/hostapd.conf
    Configuration file: /etc/hostapd/hostapd.conf
    wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
    wlan0: Could not connect to kernel driver
    Using interface wlan0 with hwaddr XX:XX:XX:XX:XX:XX and ssid "myAP"
    wlan0: interface state COUNTRY_UPDATE->ENABLED
    wlan0: AP-ENABLED
    
    # dnsmasq -k -q -d
    dnsmasq: started, version 2.78 cachesize 150
    dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
    dnsmasq-dhcp: DHCP, IP range 192.168.42.2 -- 192.168.42.254, lease time 12h
    dnsmasq-dhcp: DHCP, sockets bound exclusively to interface wlan0
    dnsmasq: using nameserver 8.8.8.8#53
    dnsmasq: reading /etc/resolv.conf
    dnsmasq: using nameserver 8.8.8.8#53
    dnsmasq: using nameserver 194.168.4.100#53
    dnsmasq: using nameserver 194.168.8.100#53
    dnsmasq: read /etc/hosts - 6 addresses
    
    # netstat -tunal
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State
    tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN
    tcp        0      0 192.168.42.1:53         0.0.0.0:*               LISTEN
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
    tcp        0      0 192.168.0.3:22          192.168.0.4:54270       ESTABLISHED
    Config:
    Code:
    # cat /etc/hostapd/hostapd.conf
    interface=wlan0                          
    #driver=nl80211                          
    ssid=myAP                           
    country_code=US                          
    hw_mode=g                                
    channel=6                                
    macaddr_acl=0                            
    auth_algs=1                              
    ieee80211n=1                             
    wmm_enabled=1                            
    ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
    wpa=2                                    
    ignore_broadcast_ssid=0                  
    wpa_key_mgmt=WPA-PSK                     
    wpa_group_rekey=86400                    
    wpa_passphrase=mypass
    wpa_pairwise=CCMP                        
    wme_enabled=1                            
    
    # cat /etc/network/interfaces                
    auto lo                                              
    iface lo inet loopback                               
                                                         
    auto eth0                                            
    iface eth0 inet dhcp                                 
    iface wlan0 inet static                              
            address 192.168.42.1                         
            netmask 255.255.255.0                        
            network 192.168.42.0                         
            broadcast 192.168.42.255             
    
    
    # ifconfig | grep -C 1 wlan0                                       
    wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500                        
            inet 192.168.42.1  netmask 255.255.255.0  broadcast 192.168.42.255
    
    # cat /etc/dnsmasq.conf
    interface=wlan0                         
    listen-address=192.168.42.1             
    bind-interfaces                         
    server=8.8.8.8                          
    domain-needed                           
    bogus-priv                              
    dhcp-range=192.168.42.2,192.168.42.254,12h
    Here's the hostapd log file when I'm trying to connect
    Code:
    mgmt::auth
    authentication: STA=XX:XX:XX:XX:XX:XX auth_alg=0 auth_transaction=1 status_code=0 wep=0 seq_ctrl=0xf050
      New STA
    ap_sta_add: register ap_handle_timer timeout for XX:XX:XX:XX:XX:XX (300 seconds - ap_max_inactivity)
    wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: authentication OK (open system)
    wlan0: STA XX:XX:XX:XX:XX:XX MLME: MLME-AUTHENTICATE.indication(XX:XX:XX:XX:XX:XX, OPEN_SYSTEM)
    wlan0: STA XX:XX:XX:XX:XX:XX MLME: MLME-DELETEKEYS.request(XX:XX:XX:XX:XX:XX)
    authentication reply: STA=XX:XX:XX:XX:XX:XX auth_alg=0 auth_transaction=2 resp=0 (IE len=0)
    nl80211: send_mlme - da= XX:XX:XX:XX:XX:XX noack=0 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0xb0 (WLAN_FC_STYPE_AUTH) nlmode=3
    nl80211: send_mlme -> send_frame
    nl80211: send_frame - Use bss->freq=2437
    nl80211: send_frame(freq=2437 bss->freq=2437) -> send_monitor
    wlan0: Event RX_MGMT (19) received
    mgmt::assoc_req
    association request: STA=XX:XX:XX:XX:XX:XX capab_info=0x511 listen_interval=4 seq_ctrl=0xf060
    WMM IE - hexdump(len=7): 00 50 f2 02 00 01 00
    Validating WMM IE: OUI 00:50:f2  OUI type 2  OUI sub-type 0  version 1  QoS info 0x0
      new AID 1
    nl80211: Set beacon (beacon_set=1)
    nl80211: Beacon head - hexdump(len=60): 80 00 00 00 ff ff ff ff ff ff b8 27 eb 89 51 91 b8 27 eb 89 51 91 00 00 00 00 00 00 00 00 00 00 64 00 11 04 00 09 7a 65 75 73 2d 6c 69 6e 6b 01 08 82 84 8b 96 0c 12 18 24 03 01 06
    nl80211: Beacon tail - hexdump(len=115): 2a 01 04 32 04 30 48 60 6c 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 0c 00 2d 1a 2c 10 1f ff 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 3d 16 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7f 04 00 00 00 02 dd 18 00 50 f2 02 01 01 00 00 03 a4 00 00 27 a4 00 00 42 43 5e 00 62 32 2f 00
    nl80211: ifindex=3
    nl80211: beacon_int=100
    nl80211: dtim_period=2
    nl80211: ssid - hexdump_ascii(len=9):
         7a 65 75 73 2d 6c 69 6e 6b                        myAP       
      * beacon_int=100
      * dtim_period=2
    nl80211: hidden SSID not in use
    nl80211: privacy=1
    nl80211: auth_algs=0x1
    nl80211: wpa_version=0x2
    nl80211: key_mgmt_suites=0x2
    nl80211: pairwise_ciphers=0x10
    nl80211: group_cipher=0x10
    nl80211: SMPS mode - off
    nl80211: beacon_ies - hexdump(len=6): 7f 04 00 00 00 02
    nl80211: proberesp_ies - hexdump(len=6): 7f 04 00 00 00 02
    nl80211: assocresp_ies - hexdump(len=6): 7f 04 00 00 00 02
    HT: STA XX:XX:XX:XX:XX:XX HT Capabilities Info: 0x0130
    update_sta_ht STA XX:XX:XX:XX:XX:XX - 20 MHz HT, num of 20MHz HT STAs 1
    hostapd_ht_operation_update current operation mode=0x0
    hostapd_ht_operation_update new operation mode=0x0 changes=0
    wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: association OK (aid 1)
    nl80211: sta_remove -> DEL_STATION wlan0 XX:XX:XX:XX:XX:XX --> 0 (Success)
    wlan0: STA XX:XX:XX:XX:XX:XX WPA: event 7 notification
    nl80211: Add STA XX:XX:XX:XX:XX:XX
      * supported rates - hexdump(len=12): 82 84 8b 96 0c 12 18 24 30 48 60 6c
      * capability=0x511
      * ht_capabilities - hexdump(len=26): 20 00 03 ff 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00
      * aid=1
      * listen_interval=4
    nl80211: Ignore ASSOC/AUTH flags since driver doesn't support full AP client state
      * flags set=0xa8 mask=0x8
      * qosinfo=0x0
    nl80211: NL80211_CMD_NEW_STATION result: -95 (Operation not supported)
    wlan0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: Could not add STA to kernel driver
    nl80211: send_mlme - da= XX:XX:XX:XX:XX:XX noack=0 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0x10 (WLAN_FC_STYPE_ASSOC_RESP) nlmode=3
    nl80211: send_mlme -> send_frame
    nl80211: send_frame - Use bss->freq=2437
    nl80211: send_frame(freq=2437 bss->freq=2437) -> send_monitor
    nl80211: Event message available
    nl80211: Drv Event 19 (NL80211_CMD_NEW_STATION) received for wlan0
    nl80211: New station XX:XX:XX:XX:XX:XX
    nl80211: Event message available
    nl80211: Drv Event 20 (NL80211_CMD_DEL_STATION) received for wlan0
    nl80211: Delete station XX:XX:XX:XX:XX:XX
    nl80211: send_mlme - da= XX:XX:XX:XX:XX:XX noack=1 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0x50 (WLAN_FC_STYPE_PROBE_RESP) nlmode=3
    nl80211: send_mlme -> send_frame
    nl80211: send_frame - Use bss->freq=2437
    nl80211: send_frame(freq=2437 bss->freq=2437) -> send_monitor
    I'll try external ALFA dongle in case if there are some problems with last kali distro and internal wifi on RPi3. If anyone stuck (or solved) with the same problem please let me know.
    Last edited by n3tr4k; 2018-02-17 at 19:00.

  5. #5
    Join Date
    2015-Nov
    Location
    Australia
    Posts
    181
    Hi n3tr4k,

    the latest raspberry pi images include the nexmon patch for the internal wifi adapter, which requires an additional step:

    You must bring up a monitor interface before starting hostapd, e.g.

    Code:
    iw phy phy0 interface add mon0 type monitor && ifconfig mon0 up

    You can see a write up of this peculiarity here.

    For a working example of a hostapd implementation on the Raspberry Pi 3 with nexmon drivers, check "ras-ap.sh" & "mon0up" in this folder:

    https://github.com/Re4son/Kali-Pi/tr...r/Menus/RAS-AP

    Hope that helps
    ----------------------------------------
    https://re4son-kernel.com
    - - - - - - - - - - - - - - - - - - - - - -
    Check out "Sticky Fingers Kali-Pi":
    https://re4son.com/kali-pi

    Now with mana-toolkit and more goodies!

  6. #6
    Join Date
    2018-Jan
    Posts
    9
    Thanks a lot re4son, I only had to assign static IP to wlan0 after that and everything worked. Cheers.

Similar Threads

  1. fake access point clients can not access internet
    By --JayJay-- in forum General Archive
    Replies: 1
    Last Post: 2016-03-25, 14:02
  2. Replies: 23
    Last Post: 2015-11-26, 05:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •