0

I have a Raspberry Pi on my network, that serves as ssh and vnc server. I can ping it's ip address from any device on network and access it via SSH or VNC without any issues.

Problem appears when pi itself tries to connect to anything. It cannot ping any device on network, including router, or access the internet at all. No other device on network has this problem.

Issue appeared when i rebooted pi, after few days of working. I think potential cause might be upgrade i did on the same day, when this problem started. (via apt upgrade)

Surprisingly, it can access router's web page (via browser) without any problems.

I disabled the firewall and rebooted both pi and router, restarted networking, network-manager, wpa_supplicant and dhcpcd services, but with no results.

Plugging raspberry to router with ethernet cable does not help. I plugged it to different router and internet connection started working again

Problem appeared again when i plugged it back to previous router

Address of router: 192.168.1.1
Address of pi: 192.168.1.110 - This address is set to static on both routers i tried

When i try to ping anything i get no output at all. It just hangs and print statistics when i kill the process.

pi@skoda:~ $ ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.

^C
--- 1.1.1.1 ping statistics ---
17 packets transmitted, 0 received, 100% packet loss, time 669ms
pi@skoda:~ $ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.


^C
--- 8.8.8.8 ping statistics ---
8 packets transmitted, 0 received, 100% packet loss, time 274ms

I checked statuses of networking, network-manager, wpa_supplicant and dhcpcd and noticed following problems:

network-manager:

pi@skoda:~ $ systemctl status network-manager
● NetworkManager.service - Network Manager
   Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2021-10-10 22:44:21 BST; 5min ago
     Docs: man:NetworkManager(8)
 Main PID: 3486 (NetworkManager)
    Tasks: 3 (limit: 2059)
   CGroup: /system.slice/NetworkManager.service
           └─3486 /usr/sbin/NetworkManager --no-daemon

Oct 10 22:44:55 skoda NetworkManager[3486]: <warn>  [1633902295.4101] device (wlan0): re-acquiring supplicant interface (#3).
Oct 10 22:44:55 skoda NetworkManager[3486]: <error> [1633902295.6992] sup-iface[0x1ff4320,wlan0]: error adding interface: wpa_supplicant couldn't grab this interface.
Oct 10 22:44:55 skoda NetworkManager[3486]: <info>  [1633902295.6994] device (wlan0): supplicant interface state: starting -> down
Oct 10 22:45:06 skoda NetworkManager[3486]: <warn>  [1633902306.4115] device (wlan0): re-acquiring supplicant interface (#4).
Oct 10 22:45:06 skoda NetworkManager[3486]: <error> [1633902306.7098] sup-iface[0x1ff4080,wlan0]: error adding interface: wpa_supplicant couldn't grab this interface.
Oct 10 22:45:06 skoda NetworkManager[3486]: <info>  [1633902306.7100] device (wlan0): supplicant interface state: starting -> down
Oct 10 22:45:17 skoda NetworkManager[3486]: <warn>  [1633902317.4117] device (wlan0): re-acquiring supplicant interface (#5).
Oct 10 22:45:17 skoda NetworkManager[3486]: <error> [1633902317.7510] sup-iface[0x1ff40f0,wlan0]: error adding interface: wpa_supplicant couldn't grab this interface.
Oct 10 22:45:17 skoda NetworkManager[3486]: <info>  [1633902317.7513] device (wlan0): supplicant interface state: starting -> down
Oct 10 22:45:17 skoda NetworkManager[3486]: <info>  [1633902317.7515] device (wlan0): supplicant interface keeps failing, giving up

wpa_supplicant:

systemctl status wpa_supplicant
● wpa_supplicant.service - WPA supplicant
   Loaded: loaded (/lib/systemd/system/wpa_supplicant.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2021-10-10 22:52:21 BST; 2min 49s ago
 Main PID: 4532 (wpa_supplicant)
    Tasks: 1 (limit: 2059)
   CGroup: /system.slice/wpa_supplicant.service
           └─4532 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant

Oct 10 22:54:39 skoda wpa_supplicant[4532]: nl80211: kernel reports: Match already configured
Oct 10 22:54:39 skoda wpa_supplicant[4532]: nl80211: kernel reports: Match already configured
Oct 10 22:54:39 skoda wpa_supplicant[4532]: nl80211: kernel reports: Match already configured
Oct 10 22:54:39 skoda wpa_supplicant[4532]: nl80211: kernel reports: Match already configured
Oct 10 22:54:39 skoda wpa_supplicant[4532]: nl80211: kernel reports: Match already configured
Oct 10 22:54:39 skoda wpa_supplicant[4532]: nl80211: kernel reports: Match already configured
Oct 10 22:54:39 skoda wpa_supplicant[4532]: ctrl_iface exists and seems to be in use - cannot override it
Oct 10 22:54:39 skoda wpa_supplicant[4532]: Delete '/run/wpa_supplicant/wlan0' manually if it is not used anymore
Oct 10 22:54:39 skoda wpa_supplicant[4532]: Failed to initialize control interface '/run/wpa_supplicant'.
                                            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.
Oct 10 22:54:39 skoda wpa_supplicant[4532]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0

networking and dhcpcd appear to be working fine.

wpa_supplicant stops displaying errors, when i restart it, but network manager gives the same result

wpa_supplicant error reappears when i restart network-manger service

network-manager still displays same errors after restarting it

When i try to run wpa_supplicant manually, it gives me this output:

pi@skoda:~ $ wpa_supplicant  -Dnl80211 -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Successfully initialized wpa_supplicant
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
wlan0: Failed to initialize driver interface

/etc/wpa_supplicant/wpa_supplicant.conf looks like this:

root@skoda:~# cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=PL

network={
        ssid="{NETWORK SSID}"
        psk="{PASSWORD}"
}

I am not sure what additional information might be helpful, so I'm going to post anything that might be somewhat useful.
Network interface:

pi@skoda:~ $ ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.110  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::b111:de5d:3a83:aa9c  prefixlen 64  scopeid 0x20<link>
        ether 2e:79:8d:d3:c7:6a  txqueuelen 1000  (Ethernet)
        RX packets 217567  bytes 10563703 (10.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 418475  bytes 511460422 (487.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

traceroute:

pi@skoda:~ $ traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
 1  * * *
 2  * * *
 3  * * *
 4  * * *
 (...and so on...)
30  * * *
pi@skoda:~ $

Routing table:

pi@skoda:~ $ sudo route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    302    0        0 wlan0
10.147.19.0     0.0.0.0         255.255.255.0   U     0      0        0 ztuzesjqx2
192.168.1.0     0.0.0.0         255.255.255.0   U     302    0        0 wlan0
pi@skoda:~ $

Router's address is present in ARP cache, adding it again didn't help

pi@skoda:~ $ arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.1.23             ether   00:c0:ca:97:ee:d8   C                     wlan0
192.168.1.1              ether   20:83:f8:12:b7:7d   C                     wlan0
pi@skoda:~ $ arp 192.168.1.1 20:83:f8:12:b7:7d
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.1.1              ether   20:83:f8:12:b7:7d   C                     wlan0

Output of 'find /etc/systemd -type l -exec test -f {} ; -print'

pi@skoda:~ $ find /etc/systemd -type l -exec test -f {} \; -print
/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
/etc/systemd/system/multi-user.target.wants/mariadb.service
/etc/systemd/system/multi-user.target.wants/remote-fs.target
/etc/systemd/system/multi-user.target.wants/hciuart.service
/etc/systemd/system/multi-user.target.wants/ufw.service
/etc/systemd/system/multi-user.target.wants/rsync.service
/etc/systemd/system/multi-user.target.wants/rsyslog.service
/etc/systemd/system/multi-user.target.wants/lighttpd.service
/etc/systemd/system/multi-user.target.wants/raspberrypi-net-mods.service
/etc/systemd/system/multi-user.target.wants/rpi-eeprom-update.service
/etc/systemd/system/multi-user.target.wants/dphys-swapfile.service
/etc/systemd/system/multi-user.target.wants/triggerhappy.service
/etc/systemd/system/multi-user.target.wants/cups.path
/etc/systemd/system/multi-user.target.wants/networking.service
/etc/systemd/system/multi-user.target.wants/nfs-client.target
/etc/systemd/system/multi-user.target.wants/pppd-dns.service
/etc/systemd/system/multi-user.target.wants/cups-browsed.service
/etc/systemd/system/multi-user.target.wants/NetworkManager.service
/etc/systemd/system/multi-user.target.wants/cron.service
/etc/systemd/system/multi-user.target.wants/console-setup.service
/etc/systemd/system/multi-user.target.wants/avahi-daemon.service
/etc/systemd/system/multi-user.target.wants/dhcpcd.service
/etc/systemd/system/multi-user.target.wants/sshswitch.service
/etc/systemd/system/multi-user.target.wants/zerotier-one.service
/etc/systemd/system/multi-user.target.wants/openvpn.service
/etc/systemd/system/multi-user.target.wants/ModemManager.service
/etc/systemd/system/multi-user.target.wants/ssh.service
/etc/systemd/system/multi-user.target.wants/wpa_supplicant.service
/etc/systemd/system/graphical.target.wants/udisks2.service
/etc/systemd/system/display-manager.service
/etc/systemd/system/default.target
/etc/systemd/system/timers.target.wants/phpsessionclean.timer
/etc/systemd/system/timers.target.wants/apt-daily-upgrade.timer
/etc/systemd/system/timers.target.wants/apt-daily.timer
/etc/systemd/system/timers.target.wants/logrotate.timer
/etc/systemd/system/timers.target.wants/man-db.timer
/etc/systemd/system/remote-fs.target.wants/nfs-client.target
/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
/etc/systemd/system/sysinit.target.wants/fake-hwclock.service
/etc/systemd/system/sockets.target.wants/avahi-daemon.socket
/etc/systemd/system/sockets.target.wants/cups.socket
/etc/systemd/system/sockets.target.wants/gpsd.socket
/etc/systemd/system/sockets.target.wants/triggerhappy.socket
/etc/systemd/system/sockets.target.wants/pcscd.socket
/etc/systemd/system/reboot.target.wants/rpi-display-backlight.service
/etc/systemd/system/sshd.service
/etc/systemd/system/network-online.target.wants/networking.service
/etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service
/etc/systemd/system/dbus-fi.w1.wpa_supplicant1.service
/etc/systemd/system/syslog.service
/etc/systemd/system/halt.target.wants/rpi-display-backlight.service
/etc/systemd/system/dbus-org.freedesktop.timesync1.service
/etc/systemd/system/poweroff.target.wants/rpi-display-backlight.service
/etc/systemd/system/mysql.service
/etc/systemd/system/mysqld.service
/etc/systemd/system/dhcpcd5.service
/etc/systemd/system/dbus-org.freedesktop.ModemManager1.service
/etc/systemd/system/printer.target.wants/cups.service
/etc/systemd/system/getty.target.wants/getty@tty1.service
/etc/systemd/system/dbus-org.freedesktop.Avahi.service
2
  • 1
    You claim to have "networking, network-manager and dhcpcd" these are mutually incompatible network managers. network-manager is not used on ANY normal raspberry Pi OS and it does not use wpa_supplicant.
    – Milliways
    Oct 11 '21 at 9:53
  • your question is not about the Raspberry Pi ... it is a Linux question
    – jsotola
    Oct 11 '21 at 15:17
1

It appears you've installed one or more network management packages that you don't need, and that they are now working at cross purposes to each other. The default networking package for Raspberry Pi OS is dhcpcd. AFAIK, network-manager isn't even installed. dhcpcd is the only network management software you need (or want) - at least initially.

Rather than trying to untangle this by editing files, the shortest path to a functional system may be to re-flash your SD card... start over, in other words:

  • Create the (empty) ssh file in /boot partition of your SD card so that you can connect to the RPi.

  • Connect your RPi to the network with an Ethernet cable (or create a minimal wpa_supplicant in /boot if you need WiFi)

  • If your network has a DHCP server available (as it seems to from the output you've provided), your RPi should boot with full networking capability.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.