2017-03-01 4 views
0

J'ai un PI 2 framboise et j'ai configuré HOSTAPD et udhcpd comme point chaud. Le premier problème auquel j'ai été confronté était le conducteur. L'adaptateur WiFi que j'ai acheté était un jeu de puces Realtek. Ceci est maintenant résolu en suivant ce post. https://www.raspberrypi.org/forums/view ... hp? T = 62371Impossible d'authentifier en utilisant HostAPD

Maintenant, le deuxième problème auquel j'ai été confronté est l'authentification WPA2. Si je mets hostapd pour open \ no authentification cela fonctionne comme un charme. Si je définis l'authentification, je suis incapable de me connecter. Les appareils Andriod encerclent la connexion, l'iPhone revient avec un mot de passe incorrect - même si je saisis un mot de passe correct.

Voici la config dans hostapd.conf et journal de hostapd --ddK /etc/hostapd/hostapd.conf

interface=wlan0 
#driver= 
ssid=<removed> 
hw_mode=g 
channel=1 
macaddr_acl=0 
auth_algs=1 
ignore_broadcast_ssid=0 
wpa=2 
wpa_passphrase=<removed> 
wpa_key_mgmt=WPA-PSK 
wpa_pairwise=TKIP 
rsn_pairwise=CCMP 

#log 
logger_syslog=-1 
logger_syslog_level=2 
logger_stdout=-1 
logger_stdout_level=2 


[email protected] ~ $ sudo hostapd -ddK /etc/hostapd/hostapd.conf 
random: Trying to read entropy from /dev/random 
Configuration file: /etc/hostapd/hostapd.conf 
nl80211: interface wlan0 in phy phy0 
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0 
nl80211: Using driver-based off-channel TX 
nl80211: Add own interface ifindex 3 
nl80211: Set mode ifindex 3 iftype 3 (AP) 
nl80211: Create interface iftype 6 (MONITOR) 
nl80211: New interface mon.wlan0 created: ifindex=6 
nl80211: Add own interface ifindex 6 
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits) 
nl80211: Regulatory information - country=00 
nl80211: 2402-2472 @ 40 MHz 
nl80211: 2457-2482 @ 20 MHz 
nl80211: 2474-2494 @ 20 MHz 
nl80211: 5170-5250 @ 80 MHz 
nl80211: 5250-5330 @ 80 MHz 
nl80211: 5490-5730 @ 160 MHz 
nl80211: 5735-5835 @ 80 MHz 
nl80211: 57240-63720 @ 2160 MHz 
nl80211: Added 802.11b mode based on 802.11g information 
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=20 dBm 
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=20 dBm 
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=20 dBm 
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=20 dBm 
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=20 dBm 
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=20 dBm 
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=20 dBm 
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=20 dBm 
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=20 dBm 
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=20 dBm 
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=20 dBm 
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=20 dBm 
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=20 dBm 
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=20 dBm 
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=20 dBm 
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=20 dBm 
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=20 dBm 
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=20 dBm 
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=20 dBm 
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=20 dBm 
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=20 dBm 
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=20 dBm 
Completing interface initialization 
Mode: IEEE 802.11g Channel: 1 Frequency: 2412 MHz 
nl80211: Set freq 2412 (ht_enabled=0 sec_channel_offset=0) 
RATE[0] rate=10 flags=0x1 
RATE[1] rate=20 flags=0x1 
RATE[2] rate=55 flags=0x1 
RATE[3] rate=110 flags=0x1 
RATE[4] rate=60 flags=0x0 
RATE[5] rate=90 flags=0x0 
RATE[6] rate=120 flags=0x0 
RATE[7] rate=180 flags=0x0 
RATE[8] rate=240 flags=0x0 
RATE[9] rate=360 flags=0x0 
RATE[10] rate=480 flags=0x0 
RATE[11] rate=540 flags=0x0 
Flushing old station entries 
Deauthenticate all stations 
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0 
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0 
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0 
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0 
Using interface wlan0 with hwaddr 40:a5:ef:07:b4:0e and ssid 'kid' 
Deriving WPA PSK based on passphrase 
SSID - hexdump_ascii(len=3): 
    6b 69 64           <removed>    
PSK (ASCII passphrase) - hexdump_ascii(len=8): 
    4b 69 64 31 32 33 34 35       <removed>  
PSK (from passphrase) - hexdump(len=32): eb f3 9f 60 48 03 d8 c2 6d 29 b5 34 1f 22 fe cd 02 ff 43 6e 7e 35 88 d9 41 49 42 27 26 c5 08 ad 
random: Got 16/20 bytes from /dev/random 
random: Only 16/20 bytes of strong random data available from /dev/random 
random: Not enough entropy pool available for secure operations 
WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects 
Get randomness: len=32 entropy=0 
GMK - hexdump(len=32): 8b 1b 05 6b 6c a3 27 3b 7d 4c 8d 08 75 c0 94 2e e9 ad cd 06 90 6b c3 8f 10 74 96 6e 07 a7 44 b7 
Get randomness: len=32 entropy=0 
Key Counter - hexdump(len=32): 8d 5d 7d 92 d4 6c 8b 56 cd f2 10 a6 4a ba 4f c9 96 1d 93 28 db d2 3b 1d e2 a2 74 02 c8 41 cf 26 
WPA: Delay group state machine start until Beacon frames have been configured 
VLAN: vlan_set_name_type(name_type=2) 
nl80211: Set beacon (beacon_set=0) 
WPA: Start group state machine to set initial keys 
WPA: group state machine entering state GTK_INIT (VLAN-ID 0) 
Get randomness: len=16 entropy=0 
GTK - hexdump(len=16): ba 94 df 43 2f 11 50 e1 86 45 25 87 fb 9a f3 b8 
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0) 
wpa_driver_nl80211_set_key: ifindex=3 alg=3 addr=0x890c8 key_idx=1 set_tx=1 seq_len=0 key_len=16 
    broadcast key 
wpa_driver_nl80211_set_operstate: operstate 0->1 (UP) 
netlink: Operstate: linkmode=-1, operstate=6 
Failed to set TX queue parameters for queue 0. 
Failed to set TX queue parameters for queue 1. 
Failed to set TX queue parameters for queue 2. 
Failed to set TX queue parameters for queue 3. 
wlan0: Setup of interface done. 
random: Got 4/4 bytes from /dev/random 
RTM_NEWLINK: operstate=1 ifi_flags=0x1002() 
nl80211: Ignore interface down event since interface wlan0 is up 
RTM_NEWLINK: operstate=1 ifi_flags=0x1002() 
nl80211: Ignore interface down event since interface mon.wlan0 is up 
RTM_NEWLINK: operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP]) 
RTM_NEWLINK, IFLA_IFNAME: Interface 'mon.wlan0' added 
Unknown event 5 
RTM_NEWLINK: operstate=1 ifi_flags=0x1003 ([UP]) 
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added 
nl80211: if_removed already cleared - ignore event 
RTM_NEWLINK: operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP]) 
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added 
nl80211: if_removed already cleared - ignore event 
VLAN: vlan_newlink(wlan0) 
nl80211: Event message available 
nl80211: New station <iphone MAC address> 
nl80211: Event message available 
nl80211: Delete station <iphone MAC address> 
wlan0: WPA rekeying GTK 
WPA: group state machine entering state SETKEYS (VLAN-ID 0) 
Get randomness: len=16 entropy=0 
GTK - hexdump(len=16): 06 b2 b8 05 a7 b6 a6 03 81 1b a4 9a 01 bb 8c 29 
wpa_group_setkeys: GKeyDoneStations=0 
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0) 
wpa_driver_nl80211_set_key: ifindex=3 alg=3 addr=0x890c8 key_idx=2 set_tx=1 seq_len=0 key_len=16 
    broadcast key 
^CSignal 2 received - terminating 
Flushing old station entries 
Deauthenticate all stations 
nl80211: Remove interface ifindex=6 
netlink: Operstate: linkmode=0, operstate=6 
nl80211: Set mode ifindex 3 iftype 2 (STATION) 

J'ai essayé désinstaller et réinstaller hostapd

Répondre

0

Je n'ai pas vu un serveur DHCP mentionné - c'est un élément essentiel de l'infrastructure pour la mise en place d'un réseau sans fil avec hostapd. Plus d'informations sont fournies sous le saut de ligne lors de la configuration d'un serveur DHCP. Avant de couvrir cela, cependant, voici quelques liens avec des informations plus générales. Tous les liens sont à charlesreid1.com/wiki. Je les ai utilisés pour documenter mon processus de configuration du Raspberry Pi en tant que point d'accès sans fil. Toutes les pages font référence à l'utilisation de la Raspberry Pi pour créer un point accès réseau/wifi:

Voici quelques informations sur la configuration d'un serveur DHCP spécifique , dans le cas où c'est le problème avec la configuration de votre Raspberry Pi comme un AP sans fil.


Configurez un serveur DHCP en modifiant /etc/dhcp/dhcp.conf. Tout d'abord, ajoutez le mot "authoritative", qui indique qu'il s'agit du DHCP faisant autorité sur le réseau. (Vous devriez voir des commentaires et des lignes déjà rempli dans le fichier de configuration DHCP qui est installé sur le Raspberry Pi par défaut):

# If this DHCP server is the official DHCP server for the local 
    # network, the authoritative directive should be uncommented. 
    authoritative; 

Uncomment faisant autorité. Puis ajoutez un bloc dans le fichier de configuration DHCP pour configurer l'attribution/la configuration de l'adresse IP. J'utilise le sous-réseau IP 192.168.42.X sur mon réseau domestique.

subnet 192.168.42.0 netmask 255.255.255.0 { 
    range 192.168.42.10 192.168.42.50; 
    option broadcast-address 192.168.42.255; 
    option routers 192.168.42.1; 
    default-lease-time 600; 
    max-lease-time 7200; 
    option domain-name "local"; 
    option domain-name-servers 8.8.8.8, 8.8.4.4; 
    } 

Vous n'avez pas besoin de toutes ces options, mais essayez-les.

Ensuite, vous devrez indiquer au serveur DHCP l'interface à utiliser, de sorte que vous pouvez modifier /etc/default/isc-dhcp-server et mettre à jour la section INTERFACES pour pointer vers votre interface spécifique:

INTERFACES="wlan0" 

Maintenant, vous aurez besoin de mettre à jour votre interface réseau afin qu'il sache ne pas essayer de chercher une adresse IP.Apportez l'interface vers le bas,

$ sudo ifdown wlan0 

modifier ensuite /etc/network/interfaces et spécifier manuellement l'adresse IP de la Pi être l'adresse de la passerelle (encore une fois j'utilise schéma 192.168.42.X mais vous pouvez utiliser tout ce que vous souhaitez, tant qu'il correspond au fichier de configuration DHCP mentionné ci-dessus):

allow-hotplug wlan0 

iface wlan0 inet static 
    address 192.168.42.1 
    netmask 255.255.255.0 

la dernière étape est ensuite édition du fichier hostapd.conf, que vous avez déjà fait. Voici à quoi il ressemble avec WPA2 activé (semble que vous avez déjà cette partie a compris et travailler bien):

interface=wlan0 
driver=<insert driver here> 
ssid=<insert SSID here> 
hw_mode=g 
channel=6 
macaddr_acl=0 
auth_algs=1 
ignore_broadcast_ssid=0 
wpa=2 
wpa_passphrase=<insert passphrase here> 
wpa_key_mgmt=WPA-PSK 
wpa_pairwise=TKIP 
rsn_pairwise=CCMP 

espère que certaines de ces informations peuvent être utiles ... heureux hacking!