LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 05-29-2007, 04:35 AM   #1
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,433

Rep: Reputation: 110Reputation: 110
Wifi suddenly refuses to work


Last week my wifi connection died all of a sudden. It just did, mysteriously, and it was something in my desktop machine. My wifi router still had a perfectly good connection, I could check it with my wifi PDA.

My wifi connection is started at boot with the following script:

Code:
rm -f /var/run/wpa_supplicant/wlan0
modprobe ndiswrapper
sleep 6
wpa_supplicant -wB -Dwext -c/etc/wpa_supplicant.conf -iwlan0
sleep 8
ifconfig wlan0 192.168.1.1 netmask 255.255.255.0
route add -net default gw 192.168.1.1 dev wlan0
ifconfig wlan0 192.168.1.2 netmask 255.255.255.0
route add -net default gw 192.168.1.1 dev wlan0
echo 1 >/proc/sys/net/ipv4/ip_forward
If any expert sees anything wrong with it, please bear with me. I wrote it all by myself with the *very little* knowledge I have of networks. But it has worked fine for 5 months, until the problem struck for the first time.

The first problem I find is that I don't know how to kill wpa_supplicant and restart it. Once I kill it, it seems that only rebooting can make it work again. So I rebooted the machine a couple of times. But it didn't help. I booted into Windows and the wifi connection worked fine. The wifi card is OK.

So I booted into Slackware again, but this time I did not let the script run at boot. I typed the commands manually. It didn't work. After a few reboots, I saw that I could get a connection if I started everything manually and with wpa_supplicant in debug mode:

Code:
wpa_supplicant -w -Dwext -c/etc/wpa_supplicant.conf -iwlan0 -d
But after a couple more reboots, I finally made it all work, typing commands manually and running in daemon, no debug mode. I left it aside for a while...

Today, the problem is back. My connection just died all of a sudden while I was running nmapFE. This time, I have rebooted the machine at least 20 times, I have tried running the script and typing commands manually, I have tried running wpa_supplicant in debug mode, and nothing seems to work. Again, I can get a perfectly good connection if I boot into Windows. But nothing seems to make my wifi connection work correctly again on Slackware. Sometimes I can access the router and see or edit all the configurations. But I can't get a ping out to the Internet. I had to pull a cable all the way from the router to the desktop to get here.

I'll really appreciate if anyone can help me make wifi work again and/or improve my script or methods to get wifi network up and running.

Here is a little dmesg, in case it helps:

Code:
[4294710.629000] vmnet1: no IPv6 routers present
[4294710.652000] vmnet8: no IPv6 routers present
[4294750.212000] bridge-eth0: disabling the bridge
[4294750.215000] bridge-eth0: down
[4294920.870000] ndiswrapper version 1.34rc2 loaded (preempt=no,smp=no)
[4294921.011000] usb 1-4: reset high speed USB device using ehci_hcd and address 3
[4294921.153000] ndiswrapper: driver athfmwdl (,12/05/2003,1.00.001) loaded
[4294921.260000] usbcore: registered new driver ndiswrapper
[4294921.746000] usb 1-4: USB disconnect, address 3
[4294921.952000] usb 1-4: new high speed USB device using ehci_hcd and address 5
[4294922.067000] usb 1-4: configuration #1 chosen from 1 choice
[4294922.171000] usb 1-4: reset high speed USB device using ehci_hcd and address 5
[4294922.305000] ndiswrapper: driver net5523 (,10/04/2004,1.0.1.4) loaded
[4294922.971000] wlan0: ethernet device 00:03:2f:31:52:e3 using NDIS driver: net5523, version: 0x10000, NDIS version: 0x501, vendor: '', 0D8E:7801.F.conf
[4294922.971000] wlan0: encryption modes supported: WEP; TKIP with WPA; AES/CCMP with WPA
[4294923.034000] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[4295169.899000] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[4295376.623000] ADDRCONF(NETDEV_UP): wlan0: link is not ready

(comment: here I give up on wifi and hook up an ethernet cable)

[4295494.041000] eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
[4295494.042000] bridge-eth0: enabling the bridge
[4295494.042000] bridge-eth0: up
[4295504.206000] eth0: no IPv6 routers present
[4297100.009000] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[4297226.982000] ndiswrapper (miniport_reset:68): wlan0 is being reset

Last edited by lucmove; 05-29-2007 at 04:45 AM.
 
Old 05-29-2007, 07:18 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
This is from your script:
Quote:
ifconfig wlan0 192.168.1.1 netmask 255.255.255.0
route add -net default gw 192.168.1.1 dev wlan0
ifconfig wlan0 192.168.1.2 netmask 255.255.255.0
route add -net default gw 192.168.1.1 dev wlan0
I'm confused as to why you're setting one IP address and then another, and I'm particularly confused about why you're setting the gateway to the first IP address. It should be pointing to your router.

And no offense intended, but I don't buy that this suddenly started on its own. Something must have changed. Did you update anything? Add anything? Stuff doesn't stop working for no reason, particularly on a distro as conservative as Slackware.
 
Old 05-29-2007, 08:56 AM   #3
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,433

Original Poster
Rep: Reputation: 110Reputation: 110
I don't quite understand those 4 lines either. All I know is that my connection didn't work without them. Yes, I really tried. 192.168.1.1 is my router. 192.168.1.2 is the desktop machine.

And no, I didn't change anything in the system. Like I said, I was running nmapFE scans, one after the other, when the connection suddenly halted. Slackware is very solid indeed, but wifi is not that solid in Linux, especially if managed by me. I am the first one to admit that I don't really know what I am doing when I configure my network.
 
Old 05-29-2007, 10:20 AM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
OK, lets start running a few tests and see where things are going wrong. The first thing to do is to boot the computer and load ndiswrapper. Post any errors that get issued when you load ndiswrapper. Also check the output of lsmod to make sure ndiswrapper is actually loading. Then check iwconfig to make sure that you have a functional wireless device. If you're really feeling ambitious, you could upgrade your version of ndiswrapper. The one you've got is slightly out of date and it is an rc version, which in my experience is worth avoiding with ndsiwrapper.

Once you've done that, start up wpa_supplicant and re-check iwconfig. If wpa_supplicant is working, you should see that your SSID and key are set and that you've associated with the access point.

If things are still looking good, set the IP address and route. However, do NOT set the IP address to 192.168.1.1. Having two devices with the same IP address, even if for a short time, might be screwing things up. I also don't see that you've edited /etc/resolv.conf to include a DNS server. Have you done that?

It also might be useful to know what chipset your wireless card is running.

So basically, take it step-by-step and report back any place where it starts acting oddly or throws errors. The goal is to narrow down what is going wrong, because at the moment, there are lots of things that could be going wrong.

<edit>
One other question, what were you scanning with nmap? It might be a clue to what is happening or it might not.
</edit>

Last edited by Hangdog42; 05-29-2007 at 10:22 AM.
 
Old 05-31-2007, 05:43 AM   #5
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,433

Original Poster
Rep: Reputation: 110Reputation: 110
Hi. Excuse me for being absent this long. I had to take care of more urgent matters. I am back at this problem again.

I don't get any errors when I load ndiswrapper. The output of lsmod shows that ndiswrapper is loaded. Checking iwconfig, I have the wlan0 wireless device, but NO ACCESS POINT ASSOCIATION. There used to be association, before this problem came up, and my connection would work. Another thing I noticed is "ADDRCONF(NETDEV_UP): wlan0: link is not ready" in the output of dmesg. I often can get an access point association if I run wpa-supplicant in debug mode, but not if I run it in daemon and no debug mode. And when I get the association in debug mode, I can access the router and the configuration panel, but cannot reach the Internet.

I don't have time to upgrade my version of ndiswrapper right now. Besides, I remember that I tried the latest versions when I bought the router and they didn't work. They wouldn't load my wifi card's Windows drivers. I had to actually install an older version to make it work.

I can't really say I understand what you said about not setting the IP address to 192.168.1.1. I can assure you that I tweaked that a lot and confirmed that I could not have access to the Internet without those lines in my script.

My /etc/resolv.conf has been configured for years, since I first got ADSL. I haven't touched it in years.

Here is all the info I have on my wireless card:

Encore Electronics ENUWI-SG 802.11g, Wireless LAN USB Adapter
* Chipset: Atheros Communications Inc, AR5523
* usbid: 0d8e:7801
* Driver: Need to get the drivers from window$ instalation (athfmwdl.inf/.sys, net5523.inf,ar5523.bin/.sys)

About nmap, I ran a "SYN Stealth Scan" against my own IP with a program called nmapfe (Nmap Front End 4.11) when my connection died.

Many thanks for your attention.
 
Old 05-31-2007, 07:26 AM   #6
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
Checking iwconfig, I have the wlan0 wireless device, but NO ACCESS POINT ASSOCIATION. There used to be association, before this problem came up, and my connection would work.
You might want to post the iwconfig output, but my main question is the SSID set? You won't get an association without it.
Quote:
Another thing I noticed is "ADDRCONF(NETDEV_UP): wlan0: link is not ready" in the output of dmesg.
Hm. Is ndiswrapper complaining about anything in the logs?

Quote:
I don't have time to upgrade my version of ndiswrapper right now. Besides, I remember that I tried the latest versions when I bought the router and they didn't work. They wouldn't load my wifi card's Windows drivers. I had to actually install an older version to make it work.
Believe it or not, but that is pretty normal for ndiswrapper. There is frequently a hunt for a Windows driver and ndiswrapper version that work together. However, that was much more of a problem in the past. As ndiswrapper has matured, I've seen fewer and fewer cases where this is the answer.

Quote:
I can't really say I understand what you said about not setting the IP address to 192.168.1.1. I can assure you that I tweaked that a lot and confirmed that I could not have access to the Internet without those lines in my script.
I guess what I'm saying is that this could be masking a problem because there is absolutely no way you should have to do this. The ONLY thing this could be doing is confusing the router.

Quote:
My /etc/resolv.conf has been configured for years, since I first got ADSL. I haven't touched it in years
.

You might want to double check it then. ISPs do change the IP addresses of their DNS servers from time to time.

Quote:
About nmap, I ran a "SYN Stealth Scan" against my own IP with a program called nmapfe (Nmap Front End 4.11) when my connection died.
Which IP, your router? If so, you probably need to at least completely power down and re-boot it. It is possible that if your router is acting as a firewall, it decided you were attacking it and banned your IP address.
 
Old 05-31-2007, 07:40 AM   #7
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,433

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by Hangdog42
You might want to post the iwconfig output, but my main question is the SSID set? You won't get an association without it.
Yes, SSID is set. I checked.

Code:
[421]~# iwconfig wlan0
wlan0     IEEE 802.11g  ESSID:off/any  Nickname:"mylan"
          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
          Bit Rate=108 Mb/s
          Encryption key:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Quote:
Hm. Is ndiswrapper complaining about anything in the logs?
No, it isnt.


Quote:
As ndiswrapper has matured, I've seen fewer and fewer cases where this is the answer.
Exactly what I was told at that time...


Quote:
You might want to double check /etc/resolv.conf then. ISPs do change the IP addresses of their DNS servers from time to time.
It is working right now. I am connected to the router with a cable.


Quote:
Which IP did you scan with nmap, your router? If so, you probably need to at least completely power down and re-boot it. It is possible that if your router is acting as a firewall, it decided you were attacking it and banned your IP address.
I scanned my external IP. And of course resetting the router was one of the first things I did... And I can use it with a cable...
 
Old 05-31-2007, 07:58 AM   #8
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
Yes, SSID is set. I checked.
Um, you might want to check again. It isn't set:

Quote:
ESSIDff/any
And also:
Quote:
Encryption keyff
What is clear to me is that wpa_supplicant and ndiswrapper are not communicating. I think at this point we need to distinguish between whether wpa_supplicant is causing the problem because it is borked, or if ndiswrapper is causing the problem because the driver won't communicate with wpa_supplicant. What I would do is to turn off all encryption at the router and see if you can get a wireless connection working. If so, then wpa_supplicant is the problem. If not, it's likely ndiswrapper.
 
Old 05-31-2007, 10:21 AM   #9
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
Have you checked the environment for interference? Other cordless devices that operate on 2.4GHz can interfere, but a bigger problem would be a neighbor with a wireless network using the same channel/frequency, IP range and SSID. I've had that happen before and had to change my setup.
 
  


Reply

Tags
gateway, router, slackware, wifi, wireless



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kubuntu 7.04 refuses to work Fosforo Ubuntu 11 05-24-2007 08:50 AM
Apt-get refuses to work now jon_k Linux - Software 1 03-25-2005 02:55 PM
yum refuses to work arjun_sh Linux - Newbie 4 03-19-2005 06:52 AM
XV refuses to work snooo Linux - Software 14 08-12-2004 06:27 AM
ADSL connection suddenly terminates then refuses to restart beng Linux - Networking 4 06-15-2003 10:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 04:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration