Saturday, August 31, 2013

Configuring CENTOS 6.4 minimal install for Wireless without NetworkManager using WPA_Supplicant

I found myself configuring a lot of CentOS based devices as nodes for my lab environment. Sometimes it is easier to connect them wirelessly than having a bunch of cables around. Since I use this nodes with CentOS 6.4 minimal install, getting the wireless to be the primary uplink interface requires a series of steps.

First we need to install the wireless tools and other tools that we need for wireless encryption configuration and so on. So, the first step is this:

yum install wireless-tools wpa_supplicant dbus

Once you have those installed in your system, then edit the ifcfg-wlan0 with the correct parameters. There are many parameters that are not needed but I kept them in case I want to use NetworkManager or similar tool in the future. Your wireless NIC configuration should look something like this:

[edited: May 2014]


Disable NetworkManager

# chkconfig NetworkManager off

If you don't know the wireless channel for your SSID you can use the iwlist command to scan and find out the channel information.

# iwlist wlan0 scan

Then you have to configure the wpa_supplicant options and devices:


OTHER_ARGS="-u -f /var/log/wpa_supplicant.log -P /var/run/"

Notice than I'm using the n180211 driver since the wext is considered legacy.

Now, lets create an entry for our SSID at the wpa_supplicant configuration. If you are using a passphrase you have to write the heximal representation for the configuration. Fortunately there is a tool that helps us with that. The tool generates the basic network configuration so you can append it to the wpa_supplicant.conf file directly.

# wpa_passphrase <ssid> <passphrase> >> /etc/wpa_supplicant/wpa_supplicant.conf

Using ssid=MyESSID with passphrase=12345678 the command will be:
# wpa_passphrase MyESSID 12345678 >> /etc/wpa_supplicant/wpa_supplicant.conf

For this example I'm using WPA PSK for my local wireless network so I have to add those parameters as well. In this case I'm adding the key_mgmt and scan_ssid statements.




Other common configuration options for wpa_supplicat are:

Plain text (no encryption) network

Static WEP keys

IEEE 802.1x with dynamic WEP keys using EAP-PEAP/MSCHAPv2
key_mgmt=IEEE8021X eap=PEAP phase2="auth=MSCHAPV2" identity="user name" password="password" ca_cert="/etc/cert/ca.pem" }

key_mgmt=WPA-PSK proto=WPA pairwise=TKIP group=TKIP psk="secret passphrase" }

key_mgmt=WPA-EAP proto=WPA2 pairwise=CCMP group=CCMP eap=TLS ca_cert="/etc/cert/ca.pem" private_key="/etc/cert/user.p12" private_key_passwd="PKCS#12 passhrase" }

Finally, make sure DBUS and WAP Supplicant services are set to start automatically with the system and/or manually start them for a test.

Enabling the services at boot time:

# chkconfig messagebus on
# chkconfig wpa_supplicant on

During the init boot process the network script will be executed before the messagebus and wpa_supplicant scripts so the wlan0 activation will fail. You should add "ifup wlan0" to your rc.local if you want for the wlan0 to be your primary connectivity.

echo "ifup wlan0" >> /etc/rc.local

Testing the configuration:

# service messagebus start
# service wpa_supplicant start
# ifup wlan0

Done. That should do it!


  1. Sorry for my bad english. :)

    1. file: /etc/sysconfig/network-scripts/ifcfg-wlan0
    NM_CONTROLLED=yes - this fatal error! need: NM_CONTROLLED=no
    ESSID= - this is right into: /etc/wpa_supplicant/wpa_supplicant.conf
    CHANNEL= - this is right into: /etc/wpa_supplicant/wpa_supplicant.conf
    MODE=Managed - this is right into: /etc/wpa_supplicant/wpa_supplicant.conf
    RATE=Auto - this is right into: /etc/wpa_supplicant/wpa_supplicant.conf
    2. metod:
    echo "ifup wlan0" >> /etc/rc.local
    - is not right!
    success execute internal metod OS! :)

    If exist question or ... please e-mail:

    1. This is great site and I think information is also helpful for us.
      Please come here

  2. It throws the error "cannot find the repo:base". Since wireless is not enabled, it cannot dynamically connect to mirrorlist url. Is there any way to download all those mirrorlist .
    Which all files are required?
    Thanks in advance

    1. Adding to above:running the basic command "yum install wireless tools" itself throws the above error

  3. Good job bro. Centos 6.5
    UUID= Don´t used
    USERCTL=yes >>>> Don´t used
    NM_CONTROLLED=no >>>>>> and >>>> chkconfig NetworkManager on

    That´s it.!!!!

  4. Securing information you transmit while using a wireless device has never been easier. I wish this was not the case but in the real world this happens every day, people go down to their local electronics store, buy a wireless router put the box under their arm and off they go.RouterReset

  5. Which means if you just take it out of the box and use it you could be allowing your neighbor, a person sitting in a vehicle down the road to access your now wireless Internet.

  6. Just pure brilliance from you here. I have never expected something less than this from you and you have not disappointed me at all. I suppose you will keep the quality work going on. Best Wireless Router

  7. This is the one I am looking for since days ago. Thank you very much for sharing such an awesome article.
    For Web Services Training

  8. If it's a second-hand router you may need to hard reset it to get it back to it's default. Hard resetting usually involves poking a paper clip into a tiny hole in the back of the router and holding it for 15 to 30 seconds and releasing.wireless routers review

  9. Thank you so much williams,you have clarified my doubts!nice putting efforts. visit my site for more information.

  10. Thank you For Your Wonderful Information Sir Thanks for Sharing..

  11. You have posted a very detail document. I read all of your article and I really like it, I understand your point of view.
    - USPS Tracking

  12. My heartfelt thanks for posting such a useful information, As per per my company policies they asked me to change the OS to Centos but I've not find any detailed info regarding this but this posts helps me in doing that, Once again thanks for posting this.
    Have a Nice Day :)
    Do Visit my site it may help to find the best trending articles in the industry


  13. Nice post. It is very useful and informative post.

    CEH Training In Hyderbad

  14. wpa is very helpful. Thanks for showing how to set it up.
    r&l tracking


  15. Thank you so much for posting this. I really appreciate your work. Keep it up. Great work!
    training and placement companies in Hyderabad

  16. This comment has been removed by the author.

  17. This comment has been removed by the author.

  18. I am looking for and I love to post a comment that "The content of your post is awesome" Great work! aruba access point

  19. Vert decent tutorial, saved for the future use *

  20. Excellent erudition Providing by your Article, thank you for taking the time to share with us such a nice article. Amazing insight you have on this, it's nice to find a website that details so much information about different artists. Kindly visit the LiveWebTutors website we providing the best online assignment help services in Australia.

    For More Info: Economics Assignment Help

  21. Furthermore, you do not have to pay for extra since you are not using your landline. This is the advantage of 3G Wireless internet. Connections remain consistently the same wherever you go. You don't have to pay extra for connection fees. Unlimited wireless internet


  22. Really appreciate this wonderful post that you have provided for us.Great site and a great topic as well I really get amazed to read this. It's really good.
    I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you!.
    mobile phone repair in Fredericksburg
    iphone repair in Fredericksburg
    cell phone repair in Fredericksburg
    phone repair in Fredericksburg
    tablet repair in Fredericksburg
    mobile phone repair in Fredericksburg
    mobile phone repair Fredericksburg
    iphone repair Fredericksburg
    cell phone repair Fredericksburg
    phone repair Fredericksburg

  23. Worked as a Senior SEO & Digital & Social Media & Graphics Design & cpa & Drop shipping & Video Editing And Youtube & Web Design And Development & Affiliate Marketing trainer at BITM (BASIS Institute of Technology & Management) since 2014-2018. Successfully completed 50+ SEO batches, 20+
    Affiliate Marketing batches and 30+ workshop on Freelancing under SEIP (Skills for Employment Investment Program).

  24. I went over this website and I believe you have a lot of wonderful information, saved to my bookmarks fossil gen 4 smartwatch

  25. I have bookmarked your website because this site contains valuable information in it. I am really happy with articles quality and presentation. Thanks a lot for keeping great stuff. I am very much thankful for this site. sim unlock

  26. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful. best wireless routers

  27. Best 6 Volt Golf Cart Batteries In 2020
    Batteries are what powers the whole circuit process and are absolutely crucial for the machine; therefore you cannot risk getting a battery for your cart that Is undependable and erratic.Your golf cart is very essential because it is a mode of transportation, which is indeed, If not, the most revolutionary invention of mankind, providing all sorts of benefits including its efficiency and how less time consuming it makes our travels or journeys, and It does so with quite the comfort and ease.

  28. Best Spray Tan Solution 2020
    A best spray tan solution is a method of giving you tanned skin for several days, without having to reveal yourself to deadly UV light as you would in a tanning salon or by sunbathing. There are several primary qualities that a tanning solution should have so that you attain natural-looking coverage and a great tanned color that not only shines up your complexion but also persists a pretty long time.Sunless tanners are available in lotion, gel, spray, powder, and mousse. There are also staged tanners for deeper and longer-lasting results.

  29. I read your articles very excellent and the i agree our all points because all is very good information provided this through in the post.

    Ecommerce Website Design

  30. For many people this is important, so check out my profile: best wireless routers

  31. Such a very useful article. Very interesting to read this article. I would like to thank you for the efforts you had made for writing this awesome article.
    Data Science Course in Pune
    Data Science Training in Pune