«

»

Jan 20

Re-setup and configure the broken WiFi network in RHEL/CentOS/Fedora

Recently I installed CentOS on my VAIO laptop and I had to do some further up-gradation of outdated packages, but that shoved me into a real headache. The WiFi network was working good till starting the upgradation procedure, but stopped right after completing the process. I had no idea then about how this was happened. I was getting only the following information from ifconfig


wlan0 Link encap:Ethernet HWaddr A4:17:31:E0:B6:47
inet6 addr: fe80::a617:31ff:fee0:b647/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:95834 errors:0 dropped:0 overruns:0 frame:0
TX packets:73355 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:119240792 (113.7 MiB) TX bytes:9640456 (9.1 MiB)

and from iwconfig

wlan0 IEEE 802.11bgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=16 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off

Sadly no IP Address or anything received from the DSL Modem. I tried to restart network and NetworkManager services and the dhclient as well. But those did not change the situation. I checked /var/log/messages for system messages and dmesg for kernel messages and got the following ones.

———————————————
Jan 20 12:12:29 john NetworkManager[2042]: error requesting auth for org.freedesktop.network-manager-settings.system.wifi.share.open: (35) Remote Exception invoking org.freedesktop.PolicyKit1.Authority.CheckAuthorization() on /org/freedesktop/PolicyKit1/Authority at name org.freedesktop.PolicyKit1: org.freedesktop.DBus.Error.Spawn
———————————————

———————————————
ADDRCONF(NETDEV_UP): wlan0: link is not ready
———————————————

It was fully doubtful for me if the wifi device got undetected or lost its driver module itself in running kernel. But it was indeed a relaxation result from lspci and lsmod since the wifi device was already there in place and the running kernel still has the wifi adapter modules kept with it.

———————————————
<> ~> lspci -v | grep -A 12 Wireless
07:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)
Subsystem: Foxconn International, Inc. Device e044
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at c1200000 (64-bit, non-prefetchable) [size=512K]
Expansion ROM at c1500000 [disabled] [size=64K]
Capabilities: [40] Power Management version 2
Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00
Kernel driver in use: ath9k
Kernel modules: ath9k
———————————————

———————————————
<> ~> lsmod | grep ath9k
ath9k 91969 0
mac80211 552581 1 ath9k
ath9k_common 3193 1 ath9k
ath9k_hw 408176 2 ath9k,ath9k_common
ath 18078 3 ath9k,ath9k_common,ath9k_hw
cfg80211 619515 3 ath9k,mac80211,ath
———————————————

Finally I did use the tool iwlist to reestablish the wifi network manually. For that, first install the tool

——————————————–
<> ~> yum -y install wireless-tools
——————————————–


<> ~> ifconfig wlan0 up


<> ~> iwlist wlan0 scan


<> ~> iwlist wlan0 scan
wlan0 Scan completed :
Cell 01 – Address: 1C:7E:E5:0B:D0:E9
Channel:1
Frequency:2.412 GHz (Channel 1)
Quality=33/70 Signal level=-77 dBm
Encryption key:off
ESSID:”DLink”
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s
Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
Mode:Master
Extra:tsf=000000020524956d
Extra: Last beacon: 92ms ago
IE: Unknown: 0005444C696E6B
IE: Unknown: 010882848B962430486C
IE: Unknown: 030101
IE: Unknown: 2A0100
IE: Unknown: 2F0100
IE: Unknown: 32040C121860
IE: Unknown: 2D1A6C181BFF00000000000000000000000000000000000000000000
IE: Unknown: 3D1601000400000000000000000000000000000000000000
IE: Unknown: DD090010180202F0040000
IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00

Now configure wlan0 with the above information

Issue..

<> ~> iwconfig wlan0 essid DLink key off

(((ESSID:”DLink” and Encryption key:off in the iwlist scan result)))

Then start the dhcpclient for wlan0

<> ~> dhclient wlan0

You are done 🙂

from dmesg

——————————————–
ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
——————————————–


<> ~> ifconfig | grep -A 7 wlan0
wlan0 Link encap:Ethernet HWaddr A4:17:31:E0:B6:47
inet addr:192.168.1.7 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a617:31ff:fee0:b647/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:104499 errors:0 dropped:0 overruns:0 frame:0
TX packets:80783 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:126639447 (120.7 MiB) TX bytes:11239675 (10.7 MiB)

<> ~> iwconfig
wlan0 IEEE 802.11bgn ESSID:”DLink”
Mode:Managed Frequency:2.412 GHz Access Point: 1C:7E:E5:0B:D0:E9
Bit Rate=1 Mb/s Tx-Power=16 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=43/70 Signal level=-67 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:11 Missed beacon:0

If you don’t want to repeat these steps each time when you start the system, then you can set those in a single script file as follows:


<> ~> cat /root/wifi.sh
#!/bin/bash
#This is to bring up wifi at the startup
ifconfig wlan0 up
iwconfig wlan0 essid DLink key off
sleep 5
dhclient wlan0

<> ~> chmod +x /root/wifi.sh

Then set the command sh /root/wifi.sh in file /etc/rc.local or /etc/rc.d/rc.local inorder to establish wifi network along with all the run levels while system booting process.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>