1 .TH WPA_ACTION "8" "26 May 2006" "" ""
3 wpa_action \- wpa_cli action script
5 \fBwpa_action\fR \fIIFACE ACTION\fR
7 \fBwpa_action\fR is a shell script designed to control the \fBifupdown\fR
8 framework according to \fIACTION\fR events received from \fBwpa_supplicant\fR.
9 \fBwpa_cli\fR receives \fICONNECTED\fR and \fIDISCONNECTED\fR events from
10 \fBwpa_supplicant\fR via the crtl_iface socket and gives the \fIACTION\fR event
11 to the \fBwpa_action\fR script as an argument, along with the \fIIFACE\fR to be
14 \fBwpa_action\fR also receives an environment variable from \fBwpa_cli\fR,
15 \fIWPA_ID_STR\fR, containing an alphanumeric identification string for the
16 \fICURRENT\fR network block. \fIWPA_ID_STR\fR is provided by the 'id_str'
17 network block option of \fBwpa_supplicant.conf\fR, and provides a means to map
18 the \fIACTION\fR to a \fILOGICAL\fR interface configured in the \fBinterfaces\fR
21 If either the ifupdown \fBinterfaces\fR or \fIifstate\fR file cannot be found,
22 \fBwpa_action\fR will exit silently (status 0). \fBwpa_action\fR will search
23 the following locations for their existance:
25 /etc/network/run/ifstate
26 /var/run/network/ifstate
27 /etc/network/interfaces
31 Network interface to be acted upon, for example 'eth1' or 'wlan0'.
33 An \fIACTION\fR to be performed on the \fIIFACE\fR.
36 \fBwpa_supplicant\fR has completed authentication.
37 \fBifup\fR \fIIFACE=WPA_ID_STR\fR is invoked and the action is logged to
38 \fI/var/log/wpa_action.IFACE.log\fR. Network settings for the \fILOGICAL\fR
39 interface \fIWPA_ID_STR\fR are applied.
42 \fBwpa_supplicant\fR has detected disconnection.
43 \fBifdown\fR \fIIFACE=WPA_ID_STR\fR is invoked and the action is logged to
44 \fI/var/log/wpa_action.log\fR. Network settings for the \fILOGICAL\fR
45 interface \fIWPA_ID_STR\fR are undone.
48 The 'stop' \fIACTION\fR is a called manually by the user, to stop the
49 \fBwpa_cli\fR daemon, invoke \fBifdown\fR \fIIFACE\fR (if the \fIIFACE\fR is
50 present in the \fIifstate\fR file) and stop the \fBwpa_supplicant\fR daemon.
51 The action is logged to \fI/var/log/wpa_action.log\fR. 'down' is a
52 synonym for 'stop' and can be used equally.
55 The 'reload' \fIACTION\fR can be used to reload the \fBwpa_supplicant\fR
56 configuration file specified by \fIwpa-roam\fR . 'restart' is a synonym
57 for 'reload' and can be used equally. The action is logged to
58 \fI/var/log/wpa_action.log\fR.
60 An alphanumeric identification string provided by the 'id_str' network block
61 option of \fBwpa_supplicant.conf\fR is exported to \fBwpa_action\fR as an
62 environment variable, \fIWPA_ID_STR\fR. When 'id_str' is not configured for the
63 \fICURRENT\fR network block, 'default' is substituted for the absent
64 \fIWPA_ID_STR\fR environment variable.
66 A unique network identifier, \fIWPA_ID\fR, is exported to \fBwpa_action\fR. It
67 is the number assigned to the \fICURRENT\fR \fBwpa_supplicant\fR network block
70 The only reasons for \fBwpa_action\fR to be explicitly executed by the user is
71 to stop \fBwpa_cli\fR from controlling \fBifupdown\fR or reload the
72 \fIwpa_supplicant.conf\fR file after editing.
75 \fBwpa_action\fR \fIeth1 stop\fR
78 Otherwise, \fBwpa_action\fR is given as an argument to a \fBwpa_cli\fR
82 \fBwpa_cli\fR \fI-i eth1 -a /sbin/wpa_action -B\fR
85 This can be done by using the \fIwpa-roam\fR option in the \fBinterfaces\fR
86 file. \fIwpa-roam\fR takes one argument, a user provided
87 \fBwpa_supplicant.conf\fR file.
89 The inet \fIMETHOD\fR must be 'manual' for this interface, as it will
90 be configured according to \fBwpa_cli\fR action events. Also supply a 'default'
91 \fBinterfaces\fR stanza using the dhcp inet \fIMETHOD\fR so that networks
92 without an 'id_str' option can fallback to attempting to receive an ip via
93 dhcp. If one or more networks requires additional network configuration,
94 provide an unique 'id_str' for each network, and an \fBinterfaces\fR stanza
95 using the 'id_str' value as a \fILOGICAL\fR interface. The following interfaces
96 file is configured to use dhcp for any network without an 'id_str', a static ip
97 for the network with an 'id_str' of 'home_static' and dhcp plus an additional
98 post-up command for the network with an 'id_str' of 'uni'.
100 An example wpa_supplicant.conf configured to roam between 3 different networks:
123 The corresponding \fBinterfaces\fR file would contain \fILOGICAL\fR interfaces,
124 that correlate to each unique 'id_str' provided by the configuration file:
128 iface eth1 inet manual
130 wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
132 iface default inet dhcp
136 iface home_static inet static
138 netmask 255.255.255.0
140 broadcast 192.168.0.255
146 \fBwpa_cli(8)\fR, \fBwpa_supplicant(8)\fR, \fBwpa_supplicant.conf(5)\fR,
147 \fBifup(8)\fR, \fBinterfaces(5)\fR
149 This manual page was written by Kel Modderman <kel@otaku42.de> for
150 the Debian GNU system (but may be used by others).