Query: can wpa_supplicant set up an ad-hoc network

Dan Williams dcbw at redhat.com
Thu Oct 15 10:47:41 EDT 2009


On Thu, 2009-10-15 at 12:20 +0800, Soh Kam Yung wrote:
> Can wpa_supplicant be used to create an ad-hoc network in linux?  If
> yes, what are the configuration options to use?

Yes.  Something like:

ap_scan=2

network={
	ssid="my ad-hoc network"
	mode=1
	key_mgmt=NONE
}

network={
	ssid="my WEP ad-hoc network"
	mode=1
	key_mgmt=NONE
	wep_tx_keyidx=0
	wep_key0=11111111111111111111111111
}

network={
	ssid="my WPA ad-hoc network"
	mode=1
	key_mgmt=WPA-NONE
	proto=WPA
	pairwise=NONE
	group=TKIP
	psk="blahblahblahblahblah"
}

> I am using wpa_supplicant-0.5.11
> 
> I have tried to look this up but the search results are about using
> wpa_supplicant to join an ad-hoc network.

Join == create for adhoc.  There is no difference.  This also requires
driver support, because the *driver* is the part that decides to join or
create the network.  The driver scans, and if there is an existing
ad-hoc network with the same SSID as you've specified, then the driver
will proceed to join that network.  Otherwise, it will create that
network.  Older kernel version (previous to 2.6.27 I believe) had
problems with mac80211 drivers and the join/create operations, so you'll
get better luck with later kernels.

Dan




More information about the HostAP mailing list