Cannot access the internet although connected to wifi

Kristeen

New Member
Joined
Jun 20, 2024
Messages
27
Reaction score
7
Credits
216
Sorry about all the questions, but everyone's been so helpful here.

I have a raspberry pi 5 that suddenly stopped accessing the internet. (Since it's Linux based, I assume it's ok to post here about raspberry pi's?) I didn't make any changes, I just turned in on and off, and the next time I turned it on it could not access the internet. It's just a simple SSID and password connection. I do nothing fancy. I did try an ethernet cable just in case, but it doesn't work either.

The results from running ip a and ip r look fine. The connection is up.

I cannot ping anything, not even my default gateway. I get no results.

I tried something to see if I could get connected... I temporarily disabled NetworkManager and edited wpa_supplicant.conf to include my country, SSID & password. I then ran a log wpa_supplicant.log which is showing this:
Code:
Succesfully initialized wpa_supplicant
Could not read interface wlan0 flags: No such device
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Could not read interface wlan0 flags: No such device
wlan0: Failed to initialize driver interface
wlan0: CTRL-EVENT-DSCP-POLICY clear_all
Successfully initialized wpa_supplicant
wlan0: Failed to initiate sched scan
I compared the results to another micro sd card with an OS on it that I have that accesses the internet correctly. This is what wpa_supplicant.log shows on that card after I follow the same steps:
Code:
Succesfully initialized wpa_supplicant
nl80211: kernel reports: Match already configured
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant
GROUP=netdev'.
You may have another wpa_supplicant process already running or the file was left by an unclean termination of wpa_supplicant in which case you will need to manually remove this file before starting wpa_supplicant again.

wlan0: CTRL-EVENT-DSCP-POLICY clear_all
wlan0: CTRL-EVENT-DSCP-POLICY clear_all
nl80211: deinit ifname=wlan0 disabled_11b_rates=0

On the card that is not accessing the internet, I don't understand what any of this means, Could not read interface wlan0 flags: No such device, Could not read interface wlan0 flags: No such device, nl80211: deinit ifname=wlan0 disabled_11b_rates=0 or anything else it says.

Any help figuring out what the problem is, I would greatly appreciate. Thank you so much.
 
Last edited:


I know very little re networks etc......but have you tried rebooting?...turning off any modem etc that is present (leave off for 30 seconds or so)......try both these.
 
Yeah, I've tried all the basic stuff. I've rebooted and factory reset the router. But my other computers connect fine. Something changed in the OS on the computer that won't access the internet.
 
I don't know which Linux, or which kernel you're running.
But most newer distro's want NetworkManager to be enabled.
Sometimes manually editing the wpa_supplicant breaks things, you shoudn't normally have to mess with this.

What is the output of...

ip add

nmcli dev wifi list

nmcli con show


you'll need NetworkManager for the last two.
 
What is the output of...

ip add

nmcli dev wifi list

nmcli con show
ip add looks fine AFAIK
Code:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback xx:xx:xx:xx:xx:xx brd xx:xx:xx:xx:xx:xx
    inet 127.0.0.1/8 scope host lo
        valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
        valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER, BROADCAST, MULTICAST, UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd xx:xx:xx:xx:xx:xx
3: wlan0: <BROADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd xx:xx:xx:xx:xx:xx
    inet 10.0.0.221/24 brd 10.0.0.255 scope global dynamic noprefixroute wlan0
        valid_lft 163768sec preferred_lft 163768sec
    inet6 2601:xxx:xxxx:xxxx::xxxx/128 scope global dynamic noprefixroute
        valid_lft 289409sec preferred_lft 289409sec
    inet6 fe80::xxxx:xxxx:xxxx:xxxx/64 scope link noprefixroute
        valid_lft forever preferred_lft forever
nmcli dev wifi list is showing my SSID and everyone else's around me
nmcli con show is showing my SSID and everything that is connected to it in my house

So it's obviously connected to my router, but if I try to ping my default gateway, there's no results
 
Last edited:
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
I had this issue many years ago and this solved the problem for me.

Simply disconnect from WI-FI, and delete the file as sudo, then reconnect again.

Bash:
sudo rm /var/run/wpa_supplicant/wlan0

If deleting doesn't solve the problem then there is misconfiguration in your config and that needs to be resolved to write valid file to /var/run/wpa_supplicant/
 
nmcli dev wifi list is showing my SSID and everyone else's around me
nmcli con show is showing my SSID and everything that is connected to it in my house

I was wanting the signal strength from the dev wifi list. It shows little bars and tells you the signal strength.

I was wanting the name of the wifi connection from con show, so that we could look at the settings in that connection.

If you're worried about security, and don't want to show it, that's fine.

The next step would be..

nmcli con show ( wifi connection name ) | grep dns

nmcli con show ( wifi connection name ) | grep gateway

nmcli con show ( wifi connection name ) | grep autoconnect

nmcli con show ( wifi connection name ) | grep method


obviously the dns show be populated with an IP address, or two addresses is better.
obviously the gateway should be the IP address of your router.

ip route and netstat -nr will also show your gateway IP.

autoconnect should be set to yes

method should be set to auto ( dhcp ).
if any of these are different or missing, then we have a problem.

Just to make sure everything is running.

systemctl status -l wpa_supplicat

systemctl status -l NetworkManager


both should return "running/active".

Can you ping your router?

ping 10.10.10.1

Your router might have a different IP address.

A lot of distro's these days use resolvectl

if you run resolvectl

Does your wifi interface have a DNS server listed?
 
Last edited:
I was wanting the signal strength from the dev wifi list. It shows little bars and tells you the signal strength.

I was wanting the name of the wifi connection from con show, so that we could look at the settings in that connection.

If you're worried about security, and don't want to show it, that's fine.

The next step would be..

nmcli con show ( wifi connection name ) | grep dns

nmcli con show ( wifi connection name ) | grep gateway

nmcli con show ( wifi connection name ) | grep autoconnect

nmcli con show ( wifi connection name ) | grep method


obviously the dns show be populated with an IP address, or two addresses is better.
obviously the gateway should be the IP address of your router.

ip route and netstat -nr will also show your gateway IP.

autoconnect should be set to yes

method should be set to auto ( dhcp ).
if any of these are different or missing, then we have a problem.

Just to make sure everything is running.

systemctl status -l wpa_supplicat

systemctl status -l NetworkManager


both should return "running/active".

Can you ping your router?

ping 10.10.10.1

Your router might have a different IP address.

A lot of distro's these days use resolvectl

if you run resolvectl

Does your wifi interface have a DNS server listed?

nmcli dev wifi list (My SSID shows up twice in the list, the 2nd time with a *)
Code:
IN-USE   BSSID              SSID    MODE   CHAN  RATE        SIGNAL  SECURITY
         xx:xx:xx:xx:xx:xx  MySSID  Infra  1     540 Mbit/s  94      WPA2 WPA3
*        xx:xx:xx:xx:xx:xx  MySSID  Infra  44    540 Mbit/s  75      WPA2 WPA3
nmcli con show (I have no idea what the lo connection is)
Code:
NAME                    UUID                                  TYPE       DEVICE
preconfigured           xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  wifi       wlan0
lo                      xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  loopback   lo
MySSID                  xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  wifi       --
MyPhone                 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  wifi       --
wired connection 1      xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  ethernet   --

nmcli con show ( wifi connection name ) | grep dns (not showing IP address)
Code:
connection.mdns:          -1 (default)
connection.dns-over-tls:  -1 (default)
ipv4.dns:                 --
ipv4.dns-search:          --
ipv4.dns-options:         --
ipv4.dns-priority:        0
ipv4.ignore-auto-dns:     no
ipv6.dns:                 --
ipv6.dns-search:          --
ipv6.dns-options:         --
ipv6.dns-priority:        0
ipv6.ignore-auto-dns:     no

nmcli con show ( wifi connection name ) | grep gateway (not showing IP address of my router)
Code:
connection.gateway-ping-timeout:    0
ipv4.gateway:                       --
ipv6.gateway:                       --

nmcli con show ( wifi connection name ) | grep autoconnect (set to yes)
Code:
connection.autoconnect:            yes
connection.autoconnect-priority:   0
connection.autoconnect-retries:    -1 (default)
connection.autoconnect-slaves:     -1 (default)

nmcli con show ( wifi connection name ) | grep method (set to auto)
Code:
802-11-wireless-security.wps-method:  0x0 (default)
ipv4.method:                          auto
ipv6.method:                          auto
proxy.method:                         none

dns show is not showing any IP addresses and gateway is not showing the IP address of my router

But ip route shows
Code:
default via 10.0.0.1 dev wlan0 proto dhcp src 10.0.0.221 metric 600
10.0.0.0/24 dev wlan0 proto kernel scope link src 10.0.0.221 metric 600

systemctl status -l wpa_supplicat shows active (running)

systemctl status -l NetworkManager shows active (running)

Cannot ping router. It just returns PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data. and nothing else

I ran resolvectl, it's saying command not found

Thank you for taking the time to help me
 
Last edited:
I had this issue many years ago and this solved the problem for me.

Simply disconnect from WI-FI, and delete the file as sudo, then reconnect again.
actually, Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore is the output for the card and OS that's correctly accessing the internet. I compared the output for 2 cards with OS's, one that accesses the internet and one that doesn't.
 
So I see your SSID has a strong signal ( 94 ) so that's probably not the problem.

lo. is your loopback interface, also known as localhost. That's how the computer talks to itself.
All computers have a loopback interface.

I do not see a router, and I also do not see any DNS.
Obviously if you can't get to the router, you can't get to the internet.

I see your wlan0 interface method is setup for "auto" ( dhcp ).
and I see autoconnect is set to "yes".

So then the question is, why isn't your router giving you a Gateway IP and a DNS IP address?
Where are you getting the 10.0.0.221 IP address from if you can't connect to your router?

Cannot ping router. It just returns PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data. and nothing else (yes 10.0.0.1 is my default router)

I ran resolvectl, it's saying command not found

We don't need resolvectl, we got the information from the grep dns command above, you don't have any DNS set.
I'm a little confused by the first sentence here.

Do you see this?
Code:
 ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=5.51 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=2.50 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=1.57 ms
64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=2.08 ms

or this?

Code:
 ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
From 10.0.0.66 icmp_seq=1 Destination Host Unreachable
From 10.0.0.66 icmp_seq=2 Destination Host Unreachable
From 10.0.0.66 icmp_seq=3 Destination Host Unreachable
From 10.0.0.66 icmp_seq=4 Destination Host Unreachable
From 10.0.0.66 icmp_seq=5 Destination Host Unreachable
From 10.0.0.66 icmp_seq=6 Destination Host Unreachable
^C
--- 10.0.0.1 ping statistics ---
7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6173ms
pipe 4

If it looks like the first one, then you can connect to your router.

It is really strange that "ip route" shows your router, but "nmcli show con wlan0 | grep gateway" does not.
Something is not right between these two things. Were you able to try netstat -nr ?
 
Also can you check to see if you have this package installed?

dhcp-client

I think maybe some distro's name this

dhclient
 
I'm a little confused by the first sentence here.

It is really strange that "ip route" shows your router, but "nmcli show con wlan0 | grep gateway" does not.
Something is not right between these two things. Were you able to try netstat -nr ?

I see only this
Code:
ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
Nothing else shows up after that. The curser seems to be stuck at this point, and I have to close the command window and reopen another one to run any more commands. It doesn't return with the expected myusername@raspberrypi:~ $ ready for another command.

netstat -nr
Code:
kernal IP routing table
Destination    Gateway        Genmask        Flags
  MSS Window  irtt Iface
0.0.0.0        10.0.0.1       0.0.0.0        UG
    0 0         0 wlan0
10.0.0.0       0.0.0.0        255.255.255.0  U
    0 0         0 wlan0

Looks like dhcp-client installed.

Also, I when I run systemctl status -l wpa_supplicat, it is showing this
Code:
Active: active (running) since Wed 2024-06-19 16:51:50 CDT; 24min ago
06-19-2024 (6 days ago) is the day when I turned on the pi and it had stopped accessing the internet. But I think maybe it's showing that because it can't access the internet and update the time?
 
Last edited:
I have another micro sd card with an OS on it that is accessing the internet correctly, and I ran

nmcli con show ( wifi connection name ) | grep dns
and
nmcli con show ( wifi connection name ) | grep gateway


These outputs are identical to the ones on the card that is not accessing the internet. So actually, the problem is not there.
 
Sorry about all the questions, but everyone's been so helpful here.

I have a raspberry pi 5 that suddenly stopped accessing the internet. (Since it's Linux based, I assume it's ok to post here about raspberry pi's?) I didn't make any changes, I just turned in on and off, and the next time I turned it on it could not access the internet. It's just a simple SSID and password connection. I do nothing fancy. I did try an ethernet cable just in case, but it doesn't work either.

The results from running ip a and ip r look fine. The connection is up.

I cannot ping anything, not even my default gateway. I get no results.

I tried something to see if I could get connected... I temporarily disabled NetworkManager and edited wpa_supplicant.conf to include my country, SSID & password. I then ran a log wpa_supplicant.log which is showing this:
Code:
Succesfully initialized wpa_supplicant
Could not read interface wlan0 flags: No such device
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Could not read interface wlan0 flags: No such device
wlan0: Failed to initialize driver interface
wlan0: CTRL-EVENT-DSCP-POLICY clear_all
Successfully initialized wpa_supplicant
wlan0: Failed to initiate sched scan
I compared the results to another micro sd card with an OS on it that I have that accesses the internet correctly. This is what wpa_supplicant.log shows on that card after I follow the same steps:
Code:
Succesfully initialized wpa_supplicant
nl80211: kernel reports: Match already configured
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant
GROUP=netdev'.
You may have another wpa_supplicant process already running or the file was left by an unclean termination of wpa_supplicant in which case you will need to manually remove this file before starting wpa_supplicant again.

wlan0: CTRL-EVENT-DSCP-POLICY clear_all
wlan0: CTRL-EVENT-DSCP-POLICY clear_all
nl80211: deinit ifname=wlan0 disabled_11b_rates=0

On the card that is not accessing the internet, I don't understand what any of this means, Could not read interface wlan0 flags: No such device, Could not read interface wlan0 flags: No such device, nl80211: deinit ifname=wlan0 disabled_11b_rates=0 or anything else it says.

Any help figuring out what the problem is, I would greatly appreciate. Thank you so much.
I have had such a problem. I was using a BrosTrend wifi dongle that looks like a flash drive. It appears something went wrong with the hardware itself. I switched to the other wifi dongle with the stick antennas and was back up and running. I still use the smaller one for wifi scanning, but I get a host of warning messages in the system journal when I do. It is possible that some of your network hardware in your Pi may have been damaged somehow. Use /usr/bin/ps axjf | less to find out what's running on your Pi and look for NetworkManager and wpa_supplicant. I was using the smaller wifi dongle for quite a while, but then one day it just decided it didn't want to work anymore. I can scan wifi APs, but can't use managed mode or master mode. I can use monitor mode though, but scanning doesn't work in monitor mode.

Signed,

Matthew Campbell
 

Members online


Latest posts

Top