Onde o wpa-conf é documentado?

6

Eu uso wpa-conf em /etc/network/interfaces para fazer a interface WLAN se conectar automaticamente ao AP:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback


auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Na verdade, acabei de descobrir isso em um wiki em algum lugar. Parece que isso não está documentado em interfaces (5) ou em qualquer outra página man.

Então, o que é a palavra-chave wpa-conf ? Uma espécie de extensão? Ou está embutido em ifup ? E onde obtenho uma lista de todos os comandos que posso usar em /etc/network/interfaces ?

    
por wolf-revo-cats 13.02.2016 / 21:48

1 resposta

5

Quanto a /etc/network/interfaces , quando você instala wpa-supplicant , um gancho de script é instalado em:

  • /etc/network/if-down.d
  • /etc/network/if-post-down.d
  • /etc/network/if-pre-up.d
  • /etc/network/if-up.d ,

O gancho é chamado de wpasupplicant e é um link simbólico para /etc/wpa-supplicant/ifupdown.sh , que invoca por sua vez /etc/wpa-supplicant/functions.sh .

Esse gancho será invocado por runparts em ifup / ifdown , e o script que o link simbólico também testa se a interface é sem fio ou não. Se for esse o caso, o comando será passado para wpa-supplicant .

Para atuar nos comandos, passando-os para /sbin/wpa-supplicant , parece que o script /sbin/wpa_action e o binário /sbin/wpa_cli são usados.

Encontrei uma página antiga falando sobre isso aqui:

link

As mentioned earlier, each wpa_supplicant specific element is prefixed with 'wpa-'. Each element correlates to a property of wpa_supplicant described in the wpa_supplicant.conf(5), wpa_supplicant(8) and wpa_cli(8) manpages.

The supplicant is launched without any pre-configuration whatsoever, and wpa_cli forms a network configuration from the input provided by the 'wpa-*' lines. Initially, wpa_supplicant/wpa_cli does not directly set the properties of the device (like setting an essid with iwconfig, for example), rather it informs the device of what access point is suitable to associate with. Once the device has scanned the area, and found that the suitable access point is available for use, these properties are set.

The script that does all the work is located at:

/etc/wpa_supplicant/ifupdown.sh /etc/wpa_supplicant/functions.sh ifupdown.sh is executed by run-parts, which in turn is invoked by ifupdown during the 'pre-up', 'pre-down' and 'post-down' phases.

In the 'pre-up' phase, a wpa_supplicant daemon is launched followed by a series of wpa_cli commands that set up a network configuration according to what 'wpa-' options were used in /etc/network/interfaces for the physical device.

If wpa-roam is used, a wpa_cli daemon is lauched in the 'post-up' phase.

In the 'pre-down' phase, the wpa_cli daemon is killed if it exists.

In the 'post-down' phase, the wpa_supplicant daemon is killed.

    
por 14.02.2016 / 02:21