Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On Debian, I am trying to set up my network to use ad-hoc mode with a static IP address. I also want wpa_supplicant to be running so that I can scan use it to scan for WiFi networks in range.

To get the ad-hoc network with static IP address working I modified the /etc/network/interfaces file so that it looks like this:

auto lo
iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet static
  wireless-channel 1
  wireless-essid MyNetworkName
  wireless-mode ad-hoc

But with this configuration, if I try to access wpa_supplicant using wpa_cli I get an error which indicates that wpa_supplicant is not running. Is there something I can add to this configuration that will allow wpa_supplicant to start up but not be used to connect up to a network?

I suppose I could just use iwlist scan to find the list of available wireless networks in range... but I already have my parsing setup for the output of wpa_cli scan_results :)

share|improve this question
Read this wiki.debian.org/WPA – rMistero Mar 31 '14 at 19:49

wireless-tools (i.e. iwlist, iwconfig, iwpriv ...) are prehistoric and should be replaced by invocations of iw. The wireless- things in /etc/network/interfaces are not handled by wpa_supplicant, but by those old wireless-tools, which ships scripts in /etc/network/if-*.d/wireless-tools.

Compare with the script shipped by wpa_supplicant in /etc/network/if-*.d/wpasupplicant which are just symlinks to scripts in /etc/wpa_supplicant/. They handle options of the form wpa-*

To start wpa_supplicant without an active config, just specify an empty configuration file, like ... /dev/null. Remember to use the nl80211 driver, because everything else (including wext) is just outdated, but is still the default in the old 1.1 version of wpa_supplicant that Debian ships.

auto wlan0
iface wlan0 inet static
    netmask 24
    wpa-conf /dev/null
    wpa-driver nl80211
share|improve this answer
I'm a little confused by your answer. First of all if I just type iw, it is not recognized as a command. Does that mean I am using an older version of Debian? Second you said that /etc/network/interfaces is used to configure the older wireless tools. Does that mean I shouldn't need to use that file at all? I tried updating my interfaces file above by adding the two lines in the bottom of your answer but I get the following error: wpa_supplicant: cannot read contents of /dev/null ... exited with error code 1 – PICyourBrain Mar 31 '14 at 23:29
Ok. I installed the iw tools. Unfortunately, it looks like my network adapter doesn't support the nl80211 driver. I am using an Edimax nano usb wifi adapter. – PICyourBrain Apr 1 '14 at 12:40
@PICyourBrain: What old version of Debian are you using ? – BatchyX Apr 2 '14 at 18:12
The latest Raspian image for the RaspberryPi – PICyourBrain Apr 5 '14 at 15:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.