[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Wifi, hostapd et mise à jour



Salut,

J'utilise la version 9.13 de Raspbian sur un RPi 3 en tant que point d'accès WiFi et il fonctionne toujours parfaitement avec hostapd via RaspAP (https://github.com/RaspAP/raspap-webgui).

$ openssl version
OpenSSL 1.1.0l  10 Sep 2019

$ rfkill list
0: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no

Note : le bluetooth n'apparaît pas car je l'ai volontairement désactivé, ne m'en servant pas.

Je n'ai qu'un seul canal désactivé (2484 MHz [14]) :

$ iw phy phy0 channels
Band 1:
	* 2412 MHz [1]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2417 MHz [2]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2422 MHz [3]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2427 MHz [4]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2432 MHz [5]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2437 MHz [6]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2442 MHz [7]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2447 MHz [8]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2452 MHz [9]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2457 MHz [10]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2462 MHz [11]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2467 MHz [12]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2472 MHz [13]
	  Maximum TX power: 20.0 dBm
	  Channel widths: 20MHz
	* 2484 MHz [14] (disabled)

Dans ma configuration j'ai spécifié le pays (country_code=FR), dans ton cas je vois que c'est 00. Peut-être changer dans le fichier et via raspi-config :

$ sudo raspi-config puis "Localisation Options" et "Change WiFi country"

$ cat /etc/hostapd/hostapd.conf
driver=nl80211
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
auth_algs=1
wpa_key_mgmt=WPA-PSK
beacon_int=100
ssid=AP
channel=4
hw_mode=g
ieee80211n=1
wmm_enabled=1
wpa_passphrase=SSIDPassphrase
interface=wlan0
wpa=2
wpa_pairwise=CCMP
country_code=FR
ignore_broadcast_ssid=0
max_num_sta=15

$ hostapd -v
hostapd v2.6

$ dpkg -l hostapd | grep ^ii
ii hostapd 2:2.6-21~bpo9~rpt1 armhf IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator

Tu n'as pas d'autres logs hormis ceux de hostapd ? dmesg par exemple ?

Charles.

Le 16/06/2021 à 23:23, BERTRAND Joël a écrit :
	Bonjour à tous,

	J'utilise depuis des années un rPI 3 comme point d'accès wifi. Ça
fonctionne parfaitement bien. Ou plutôt, ça fonctionnait jusqu'à ce
matin où j'ai dû mettre à jour openssl. Plutôt que de faire dans le
détail, j'ai fait un

	apt update/apt dist-upgrade.

	Tout s'est passé correctement, enfin à premier vue. Sauf que le daemon
hostapd ne démarre plus.

	Dans un premier temps, j'ai constaté que par défaut, l'interface wifi
est désactivé :

root@abel:/etc/hostapd# rfkill
ID TYPE      DEVICE      SOFT      HARD
  0 wlan      phy0     blocked unblocked
  1 bluetooth hci0     blocked unblocked
root@abel:/etc/hostapd#

	Bon, il faut scripter un truc pour l'activer par défaut. Mais il y a un
problème plus sérieux :

root@abel:/etc/hostapd# /usr/sbin/hostapd -dd /etc/hostapd/hostapd.conf
random: getrandom() support available
Configuration file: /etc/hostapd/hostapd.conf
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:6
nl80211: Using driver-based off-channel TX
nl80211: Supported vendor command: vendor_id=0x1018 subcmd=1
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 3 iftype 3 (AP)
nl80211: Setup AP(wlan0) - device_ap_sme=0 use_monitor=1
nl80211: Create interface iftype 6 (MONITOR)
Failed to create interface mon.wlan0: -95 (Operation not supported)
nl80211: Driver does not support monitor interface type - try to run
without it
nl80211: Enable Probe Request reporting nl_preq=0x1c0b630
nl80211: Register frame type=0x40 (WLAN_FC_STYPE_PROBE_REQ)
nl_handle=0x1c0b630 match=
nl80211: Register frame command failed (type=64): ret=-22 (Invalid argument)
nl80211: Register frame match - hexdump(len=0): [NULL]
nl80211: Failed to enable Probe Request frame reporting in AP mode
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
nl80211: Add own interface ifindex 3 (ifidx_reason -1)
nl80211: if_indices[16]: 3(-1)
phy: phy0
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
nl80211: Regulatory information - country=00
nl80211: 2402-2472 @ 40 MHz 20 mBm
nl80211: 2457-2482 @ 20 MHz 20 mBm (no IR)
nl80211: 2474-2494 @ 20 MHz 20 mBm (no OFDM) (no IR)
nl80211: 5170-5250 @ 80 MHz 20 mBm (no IR)
nl80211: 5250-5330 @ 80 MHz 20 mBm (DFS) (no IR)
nl80211: 5490-5730 @ 160 MHz 20 mBm (DFS) (no IR)
nl80211: 5735-5835 @ 80 MHz 20 mBm (no IR)
nl80211: 57240-63720 @ 2160 MHz 0 mBm
nl80211: Added 802.11b mode based on 802.11g information
nl80211: Mode IEEE 802.11g: 2412[DISABLED] 2417[DISABLED] 2422[DISABLED]
2427[DISABLED] 2432[DISABLED] 2437[DISABLED] 2442[DISABLED]
2447[DISABLED] 2452[DISABLED] 2457[DISABLED] 2462[DISABLED]
2467[DISABLED] 2472[DISABLED]
nl80211: Mode IEEE 802.11b: 2412[DISABLED] 2417[DISABLED] 2422[DISABLED]
2427[DISABLED] 2432[DISABLED] 2437[DISABLED] 2442[DISABLED]
2447[DISABLED] 2452[DISABLED] 2457[DISABLED] 2462[DISABLED]
2467[DISABLED] 2472[DISABLED]
Channel 11 (primary) not allowed for AP mode, flags: 0x1
wlan0: IEEE 802.11 Configured channel (11) not found from the channel
list of current mode (1) IEEE 802.11g
wlan0: IEEE 802.11 Hardware does not support configured channel
Could not select hw_mode and channel. (-3)
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED
wlan0: Unable to setup interface.
hostapd_interface_deinit_free(0x1c08050)
hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1
hostapd_interface_deinit(0x1c08050)
wlan0: interface state DISABLED->DISABLED
hostapd_bss_deinit: deinit bss wlan0
wlan0: Deauthenticate all stations
nl80211: sta_remove -> DEL_STATION wlan0 ff:ff:ff:ff:ff:ff --> 0 (Success)
wlan0: AP-DISABLED
hostapd_cleanup(hapd=0x1c08ec8 (wlan0))
wlan0: CTRL-EVENT-TERMINATING
hostapd_free_hapd_data: Interface wlan0 wasn't started
hostapd_interface_deinit_free: driver=0x14517c drv_priv=0x1c0b538 ->
hapd_deinit
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
nl80211: Remove beacon (ifindex=3)
netlink: Operstate: ifindex=3 linkmode=0 (kernel-control), operstate=6
(IF_OPER_UP)
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Teardown AP(wlan0) - device_ap_sme=1 use_monitor=1
hostapd_interface_free(0x1c08050)
hostapd_interface_free: free hapd 0x1c08ec8
hostapd_cleanup_iface(0x1c08050)
hostapd_cleanup_iface_partial(0x1c08050)
hostapd_cleanup_iface: free iface=0x1c08050
root@abel:/etc/hostapd#

	Le fichier de conf n'ayant pas changé, je comprends à la lecture de ce
qui précède que le canal ne lui convient plus (?).

	Effectivement :

root@abel:/etc/hostapd# iw phy phy0 channels
Band 1:
         * 2412 MHz [1] (disabled)
         * 2417 MHz [2] (disabled)
         * 2422 MHz [3] (disabled)
         * 2427 MHz [4] (disabled)
         * 2432 MHz [5] (disabled)
         * 2437 MHz [6] (disabled)
         * 2442 MHz [7] (disabled)
         * 2447 MHz [8] (disabled)
         * 2452 MHz [9] (disabled)
         * 2457 MHz [10] (disabled)
         * 2462 MHz [11] (disabled)
         * 2467 MHz [12] (disabled)
         * 2472 MHz [13] (disabled)
         * 2484 MHz [14] (disabled)
root@abel:/etc/hostapd#

	D'où ma question : pourquoi tous les canaux wifi sont-ils tout d'un
coup désactivés ? Et surtout, comment les réactiver ?

	Merci de vos lumières,

	JKB



Reply to: