execute wpa_supplicant + wpa_cli with a virtual network interface

Stefano Cappa stefano.cappa
Thu Jan 8 08:48:50 PST 2015


Hi, with Android Kitkat or Lollipop i can execute this commands without problems and use wpa_cli for p2p:


1) wpa_supplicant -B -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -N -B -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf

2) wpa_cli -ip2p0 -p/data/misc/wifi/sockets


Now, i want to create another network interface created in this way (with a "custom android kernel" to enable macvtap, from Android Open Source Project) :

1) ip link add link wlan0 name INTERFACE_NAME type macvtap

2) busybox ifconfig INTERFACE_NAME 10.169.129.42 netmask 255.255.248.0 up

3) busybox ifconfig -a                                   // and i can find the new network interface with MAC, IP... --> PERFECT


Now i want to execute wpa_supplicant and wpa_cli with this network interface called in this example "INTERFACE_NAME":

If i try with

1) "wpa_supplicant -B -iINTERFACE_NAME -Dnl80211 -c/data/misc/wifi/INTERFACE_NAME_supplicant.conf"

with a conf file like wpa_supplicant, exactly the same with ctrl_interface=/data/misc/wifi/sockets, i get this error code "255".

Probably there are no available sockets in /data/misc/wifi/sockets ? Or, I need to use another conf file? I really don't know.


I thought, mmm, i can use wpa_cli interface_add INTERFACE_NAME "" nl80211 /data/misc/wifi/sockets,

but i get this error: "Failed to connect to non-global ctrl_ifname: wlan0  error: No such file or directory 255"


My questions are:

 A)   How can i execute wpa_supplicant + wpa_cli on a virtuale network interface in android?

 B)   I need to create new sockets? How? I can use socat?

 C)   The syntax of  wpa_cli interface_add  is correct? Because i can't find a good documentation to this command. I searched in the source code to pass the parameters, but i'm not completely sure.


Thank u very much,

please help me,  i'm working on this, since...i don't know... days days and days :(


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.shmoo.com/pipermail/hostap/attachments/20150108/8705176b/attachment-0001.htm>



More information about the Hostap mailing list