wpa_supplicant.: Simulating handoff between wifi's access points.

Carlos Patricio Amigo Haering camigo at udec.cl
Wed Dec 19 15:05:25 EST 2012


Thank you for the reply Dan, your tips will be very useful, especially 
about the roaming.

I'll upgrade my Ubuntu for use the "nl80211" for sure because i need 
the best roaming's simulation as possible. Meanwhile i'm trying to learn 
how use the supplicant but i'm still having problems in the simple task 
of connect the client to the AP.

I did some changes because i couldn't do 'ifup my_static_lan'. This 
give me several errors: "my_static_lan: ERROR while getting interface 
flags: No such device" and "SIOCSIFNETMASK: No such device".

# cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant

network={
	ssid="OF"
	bssid=20:aa:4b:48:7e:ca
	key_mgmt=WPA-PSK
	group=CCMP TKIP
	pairwise=CCMP TKIP
	proto=RSN
	psk=4825dfb64863f17ff2db453445a123191468752148d88ffe4491bc79cae5f95f
	id_str="wlan0"
}

# cat /etc/network/interfaces
auto lo
iface lo inet loopback

wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface wlan0 inet static
	address 192.168.1.11
	netmask 255.255.255.0
	network 192.168.1.0
	broadcast 192.168.1.255

# wpa_supplicant -B -Dwext -i wlan0 -c 
/etc/wpa_supplicant/wpa_supplicant.conf

# ifup wlan0
ssh stop/waiting
ssh start/running, process 13151

# ip addr show wlan0
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state 
DORMANT qlen 1000
     link/ether 00:1b:77:15:7d:d1 brd ff:ff:ff:ff:ff:ff
     inet 192.168.1.11/24 brd 192.168.1.255 scope global wlan0
     inet6 fe80::21b:77ff:fe15:7dd1/64 scope link
        valid_lft forever preferred_lft forever

# ping -c3 192.168.1.13 (trying to ping a iphone who is connected to 
the same AP)
PING 192.168.1.13 (192.168.1.13) 56(84) bytes of data.
 From 192.168.1.11 icmp_seq=1 Destination Host Unreachable
 From 192.168.1.11 icmp_seq=2 Destination Host Unreachable
 From 192.168.1.11 icmp_seq=3 Destination Host Unreachable

--- 192.168.1.13 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 
2015ms
pipe 3

Now i have IP but still doesn't work. I don't know where is the 
problem, i don't know if i'm doing something wrong or i'm having 
problems because all is deprecated (my ubuntu and wext).

Note: I connect without problems two smartphones ( android and  iOS) 
using static IP to the AP and they can ping each other.

Thanks in advance.

Regards.



El 2012-12-18 18:39, Dan Williams escribió:
> On Tue, 2012-12-18 at 17:03 -0300, Carlos Patricio Amigo Haering 
> wrote:
>> Hi everybody,
>>
>> I'm working on a seamless handover but i don't want to walk long
>> distances with the client to trigger the handover so i need to 
>> simulate
>> it. Basically i have two AP with the same SSID and different MAC and 
>> i
>> want to disconnect a client from one of them to connect it to the 
>> other
>> one.  First i tried with iwconfig(iwconfig wlan0 ap <mac>)  but this 
>> did
>> not do nothing, apparently this tool it's deprecated.
>>
>> Reading and asking, somebody told me about wpa_supplicant and i've 
>> been
>> looking for some good tutorial but all of them are a little bit 
>> simple
>> and normally uses dhcp and my AP doesn't have dhcp server. Anyway 
>> i've
>> made something using a mix of info of internet but without good 
>> results,
>> indeed i can't connect the client to a AP yet. I hope that you help 
>> me
>> to figure out what i'm doing wrong.
>>
>> I'm using Ubuntu 10.10 with kernel 2.6.35-22-generic and a network
>> controller: Intel Corporation PRO/Wireless 4945ABG.
>>
>> # ifconfig wlan0 down
>> # ifconfig wlan0 up
>> # iw wlan0 scan
>> BSS 20:aa:4b:48:7e:ca (on wlan0)
>> 	TSF: 3914550832 usec (0d, 01:05:14)
>> 	freq: 2462
>> 	beacon interval: 100
>> 	capability: ESS Privacy ShortSlotTime (0x0411)
>> 	signal: -15.00 dBm
>> 	last seen: 1500 ms ago
>> 	SSID: OF
>> 	Supported rates: 1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0
>> 	DS Parameter set: channel 11
>> 	ERP: Barker_Preamble_Mode
>> 	Extended supported rates: 24.0 36.0 48.0 54.0
>> 	RSN:	 * Version: 1
>> 		 * Group cipher: CCMP
>> 		 * Pairwise ciphers: CCMP
>> 		 * Authentication suites: PSK
>> 		 * Capabilities: 16-PTKSA-RC (0x000c)
>> 	WMM:	 * Parameter version 1
>> 		 * BE: CW 15-1023, AIFSN 3
>> 		 * BK: CW 15-1023, AIFSN 7
>> 		 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec
>> 		 * VO: CW 3-7, AIFSN 2, TXOP 1504 usec
>>
>> # wpa_supplicant -v
>> wpa_supplicant v0.6.10
>> Copyright (c) 2003-2009, Jouni Malinen <j at w1.fi> and contributors.
>>
>> # cat /etc/wpa_supplicant/wpa_supplicant.conf
>> ctrl_interface=/var/run/wpa_supplicant
>>
>> network={
>> 	ssid="OF"
>> 	bssid=20:aa:4b:48:7e:ca
>> 	key_mgmt=WPA-PSK
>> 	group=CCMP TKIP
>> 	pairwise=CCMP TKIP
>> 	proto=RSN
>> 
>> 	psk=4825dfb64863f17ff2db453445a123191468752148d88ffe4491bc79cae5f95f
>> 	id_str="my_static_lan"
>> }
>>
>> Note: The psk= was the output of wpa_passphrase <ssid> <password>.
>
> Note that you can just put the passphrase here, in quotes:
>
> psk="my wifi network passphrase"
>
> and the supplicant will do the right thing.
>
>> # cat /etc/network/interfaces
>> auto lo
>> iface lo inet loopback
>>
>> wpa-driver wext
>> wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
>
> With Ubuntu 10.10, you may want to continue using wext.  However, if 
> you
> ever upgrade to newer versions, you'll most definitely want to use 
> the
> "nl80211" supplicant driver instead.  wext, like iwconfig, is 
> deprecated
> and you'll get better results from nl80211.  These are just the 
> kernel
> API for wifi control that the supplicant uses to tell the wifi device
> what to do, and nl80211 is more flexible and better featured.  It 
> also
> typically works better for roaming between access points.
>
>> iface my_static_lan inet static
>> 	address 192.168.1.11
>> 	netmask 255.255.255.0
>> 	network 192.168.1.0
>> 	broadcast 192.168.1.255
>>
>> # wpa_supplicant -B -Dwext -i wlan0 -c
>> /etc/wpa_supplicant/wpa_supplicant.conf
>
> As above, if you ever update to after 10.10, you'll want "-Dnl80211"
> instead.
>
>> # ip addr show wlan0
>> 3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq 
>> state
>> DOWN qlen 1000
>>      link/ether 00:1b:77:15:7d:d1 brd ff:ff:ff:ff:ff:ff
>>      inet6 fe80::21b:77ff:fe15:7dd1/64 scope link
>>         valid_lft forever preferred_lft forever
>
> The supplicant only handles the wifi bits.  Something else handles 
> the
> actual IP addressing.  So if you just run wpa_supplicant, the 
> supplicant
> will connect to the wifi and you'll have no IP address.  You then 
> need
> to kick off whatever tool gets the IP address.  Not specifically sure
> how that's supposed to work on Ubuntu, but it could be just "ifup
> my_static_lan" or something like that.
>
> Next if you're about to simulate roaming, look at the wpa_cli tool.  
> You
> want the "roam" command which lets you tell the supplicant to roam to 
> an
> access point of your choosing.
>
> Dan
>
>> (Doesn't seem connected.)
>>
>> # ping 192.168.1.13 (pinging a iphone connected to the same AP)
>> connect: Network is unreachable
>>
>>
>> As you see i don't have any error but the client is not associated 
>> to
>> the AP. I really appreciate a little help.
>>
>> thanks in advance.
>> _______________________________________________
>> HostAP mailing list
>> HostAP at lists.shmoo.com
>> http://lists.shmoo.com/mailman/listinfo/hostap



More information about the HostAP mailing list