How Fix Hostapd Invalid/Unknown Driver 'Nl80211' Error?
  • I have Intel Centrino Wireless-N 1000
  • I installed hostapd from Ubuntu Software Center
  • When I run this command hostapd hostapd-minimal.conf I get this:

    root@tarek-PC:~# hostapd hostapd-minimal.conf
    Configuration file: hostapd-minimal.conf
    Line 2: invalid/unknown driver 'nl80211 '
    Line 4: unknown hw_mode 'g '
    2 errors found in configuration file 'hostapd-minimal.conf'
    

After doing make first I had this error:

driver_nl80211.c:25:26: warning: netlink/attr.h: No such file or directory

I solved it by installing libnl-1.0pre8

Now I have this error when doing make command:

../src/crypto/crypto_openssl.c:10:30: fatal error: openssl/opensslv.h: No such file or directory
compilation terminated.
make: *** [../src/crypto/crypto_openssl.o] Error 1

Can anyone help me with that error I am running Ubuntu 13.04?

4 Answers

You need to build, or obtain, a different copy of hostapd. The one you have has been built with the option CONFIG_DRIVER_NL80211 set to N, rather than Y.

There are simple and detailed instructions how to rebuild it here → Hostapd building instruction. Rebuild it with the option enabled. You may have to google for hostapd.2.0.tar.gz, but do exactly as it mentioned in link.

As for the follow-up question/error try to install this library libssl-dev using this command:

sudo apt-get install libssl-dev
4

You see the spaces after the values? Remove them.

  • Line 2: invalid/unknown driver 'nl80211 '

  • Line 4: unknown hw_mode 'g '

2

Check for EOL format. It should be in UNIX format as < LF > and not < CR >< LF >. That fixed mine error.

I had a similar Problem, but without the spaces after the values and managed to solve it:

Before I encountered the Problem, I copied the hostapd.conf file from my Windows pc onto my Raspberry Pi. And I believe the problem was, that the text had special characters. Maybe some returns were different (Because I had a return instead of a space after the values in the errors)

But enough speculation, let's come to my solution:

  1. I renamed the old hostapd.conf file (to hostapdOld.conf)
  2. I created a new file with the name hostapd.conf
  3. And then I copied the whole content of the old file to the new one. (I just selected the whole text, didn't use Ctrl+A, if this even matters)

Then I ran hostapd as usual, with:

sudo hostapd -d /etc/hostapd/hostapd.conf

And it worked again

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest