newbie questions about wpa_supplicant

Osho GG oshogg at
Tue Nov 15 03:23:39 EST 2005

Many many thanks Jouni for your detailed response. It has helped me a great
deal in getting closer to "network interfaces just work no matter where I
am" ... I am still not quite there yet but I feel that it is possible with
some scripting.

By the way, my wired interface does not use any authentication. Normally, I
just plug the cable in and do dhcpcd eth1 and it starts working. Can I still
use wpa_supplicant for it?

My other question is regarding dhcpcd. Currently my scripts do dhcpcd -k
<interface> whenever wpa_supplicant indicates that the interface has been
disconnected and then I do dhcpcd <interface> whenever it is connected. Is
there a better way than "kill, restart" dhcpcd like that? I am using
2.0version of dhcpcd and its manpage mentions about using the -o
option with
wpa_supplicant, ifplugd etc. but I am not sure how exactly it should be
used. Any advise?


On 11/12/05, Jouni Malinen <jkmaline at> wrote:
> On Fri, Nov 11, 2005 at 03:52:33PM -0800, Osho GG wrote:
> > My question concerns regarding starting of dhcpcd. Everytime I have to
> > manually start the dhcpcd once wpa_supplicant establishes the connection
> > with the Access point. Is there a way wpa_supplicant can do it
> > automatically?
> Yes, or well, to be more exact, wpa_supplicant can be used to generate
> an event when network connection is established and an external program
> would be used to do whatever network configuration is needed. I believe
> some Linux distributions have already done this kind of integration.
> I added following description into the README file on how to do this
> with wpa_cli:
> wpa_cli can used to run external programs whenever wpa_supplicant
> connects or disconnects from a network. This can be used, e.g., to
> update network configuration and/or trigget DHCP client to update IP
> addresses, etc.
> One wpa_cli process in "action" mode needs to be started for each
> interface. For example, the following command starts wpa_cli for the
> default ingterface (-i can be used to select the interface in case of
> more than one interface being used at the same time):
> wpa_cli -a/sbin/ -B
> The action file (-a option, /sbin/ in this example) will
> be executed whenever wpa_supplicant completes authentication (connect
> event) or detects disconnection). The action script will be called
> with two command line arguments: interface name and event (CONNECTED
> or DISCONNECTED). If the action script needs to get more information
> about the current network, it can use 'wpa_cli status' to query
> wpa_supplicant for more information.
> Following example can be used as a simple template for an action
> script:
> #!/bin/sh
> CMD=$2
> if [ "$CMD" == "CONNECTED" ]; then
> SSID=`wpa_cli -i$IFNAME status | grep ^ssid= | cut -f2- -d=`
> # configure network, signal DHCP client, etc.
> fi
> if [ "$CMD" == "DISCONNECTED" ]; then
> # remove network configuration, if needed
> fi
> > My other question is can wpa_supplicant handle wired interfaces?
> Yes, driver_wired.c (-Dwired on command line) can be used to
> authenticate wired interfaces with IEEE 802.1X. Example from README:
> 6) Authentication for wired Ethernet. This can be used with 'wired'
> interface
> (-Dwired on command line).
> ctrl_interface=/var/run/wpa_supplicant
> ctrl_interface_group=wheel
> ap_scan=0
> network={
> key_mgmt=IEEE8021X
> eap=MD5
> identity="user"
> password="password"
> eapol_flags=0
> }
> --
> Jouni Malinen PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP at

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the HostAP mailing list