Enable WiFi on Centos

Here is what I did to activate Wi-Fi on Centos in an old laptop where I removed Windows and installed Centos.

How to enable wifi on Centos

First step is to Install the following packets

yum install dbus
yum install wpa_supplicant
yum install wireless-tools

we need to get WiFi card info io order to install firmware for centos

lspci | grep -i net
02:00.0 Network controller: Intel Corporation PRO/Wireless 5100 AGN [Shiloh] Network Connection
85:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8042 PCI-E Fast Ethernet Controller

The wireless Card is a Wireless 5100 AGN, here is the procedure to install firmware from Centos web site

In my situation I have to install iwl5000-firmware

yum install iwl5000-firmware
modprobe -r iwlwifi; modprobe iwlwifi

Now Configure wpa_supplicant services. Wpa_supplicant is the services used for wifi connection, so it is necessary to configure it with WiFi SSID, Password and interface

vim /etc/sysconfig/wpa_supplicant
INTERFACES="-i wlan0"


vim /etc/wpa_supplicant/wpa_supplicant.conf


I know it is not a good think to have clear password written in config file, but that’s what i did.

Configure wlan0 (ip address, gateway, bootproto ecc ecc… it dipends by your needs)

vim /etc/sysconfig/network-scripts/ifcfg-wlan0

Start the services

service messagebus start
service wpa_supplicant start
service network start

If you want WiFi starts on boot

chkconfig messagebus on
chkconfig wpa_supplicant on
chkconfig network on

Check boot order to be sure that on boot server will start services in the above order,
i did it renaming file in /etc/rcX.d/ directory (X is the runlevel)

mv old_name new_name

In case wifi doesn’t start on boot just try to start services by command line in the right order i wrote above. It should work, in any case could be useful to follow server boot to see which services fail to start and than start troubleshooting.

It is not so easy but in the end i was able to enable wifi on Centos

One Comment

  1. there is an error
    [root@Nikz linux]# service network start
    Starting network (via systemctl): Job for network.service failed because the control process exited with error code. See “systemctl status network.service” and “journalctl -xe” for details.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.