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:
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.