3

My Raspberry Pi 3 running Raspbian 11 has been acting up for several weeks now:

I managed to set up the wireless LAN at boot, but now, whenever I boot it, there's a 90% chance that the desktop top bar won't appear (I believe it's linked to the NetworkManager applet failing to start).

Also, there's NO network whatsover, and ANY command related to network (and many more) just… hangs (yes, even a simple ip addr show or ifconfig). No error message, no nothing. Sometimes I can Ctrl-C back to the interpreter, but most of the time, I cannot even.

Only service NetworkManager status (but not stop nor [re]start) works:

$ service NetworkManager status
● NetworkManager.service - Network Manager
     Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
    Drop-In: /usr/lib/systemd/system/NetworkManager.service.d
             └─10-dhcpcd.conf
     Active: deactivating (stop-sigterm) since Mon 2022-11-21 16:29:34 CET; 18s ago
       Docs: man:NetworkManager(8)
   Main PID: 409 (NetworkManager)
      Tasks: 3 (limit: 1596)
        CPU: 399ms
     CGroup: /system.slice/NetworkManager.service
             └─409 /usr/sbin/NetworkManager --no-daemon

nov. 21 16:17:13 domoticz NetworkManager[409]: <info> [1669043833.6341] ifupdown: interface-parser: parsing file /etc/network/interfaces nov. 21 16:17:13 domoticz NetworkManager[409]: <info> [1669043833.6343] ifupdown: interface-parser: source line includes interfaces file(s) /etc/network/interfaces.d/* nov. 21 16:17:13 domoticz NetworkManager[409]: <warn> [1669043833.6346] ifupdown: interfaces file /etc/network/interfaces.d/* doesn't exist nov. 21 16:17:13 domoticz NetworkManager[409]: <info> [1669043833.6347] ifupdown: interface-parser: finished parsing file /etc/network/interfaces nov. 21 16:17:13 domoticz NetworkManager[409]: <info> [1669043833.6937] device (lo): carrier: link connected nov. 21 16:17:13 domoticz NetworkManager[409]: <info> [1669043833.6956] manager: (lo): new Generic device (/org/freedesktop/NetworkManager/Devices/1) nov. 21 16:17:13 domoticz NetworkManager[409]: <info> [1669043833.7062] device (wlan0): driver supports Access Point (AP) mode nov. 21 16:17:13 domoticz NetworkManager[409]: <info> [1669043833.7143] manager: (wlan0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/2) nov. 21 16:17:13 domoticz NetworkManager[409]: <info> [1669043833.7212] device (wlan0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external') nov. 21 16:29:34 domoticz systemd[1]: Stopping Network Manager...

Indeed, /etc/network/interfaces.d/ is empty. How can I populate it?

I'll keep on rebooting until it somehow manages to put the network up again…

EDIT following comments: I may have indeed tweaked NetworkManager while trying to deactivate the MAC addresse randomization, following https://raspberrypi.stackexchange.com/a/75497/113482 ’s top-voted comment.

EDIT - SOLUTION: As so many commands wouldn't run, I eventually solved my issue by reflashing Raspberry Pi OS.

Seamus
  • 23,558
  • 5
  • 42
  • 83
breversa
  • 151
  • 1
  • 1
  • 8

1 Answers1

3

AFAIK, dhcpcd remains (at least for now) the default network manager for RPi. There was a recent RPi News article explaining the current status of dhcpcd (a.k.a. NetworkConfiguration vs Network Manager.

As a systemd doubter, and after reviewing your output, it's not clear WTHIGO... systemd says NetworkManager, BUT there's this line in your Q: 10-dhcpcd.conf.

We don't know exactly what you started with or what you've done, so a definitive answer seems out of reach in this case. But as a guess, it sounds like you have NetworkManager running, but you have failed to inform your OS that you have chosen NetworkManager over the default dhcpcd!

That would explain the odd reference to dhcpcd.conf in your systemd status output: The OS assumes you're running the default dhcpcd, and in that case /etc/dhcpcd.conf is used as the configuration data to be read by systemd when it starts the "networking service". The RPi News article, under the topic "NetworkManager compatibility" explains that you must declare your choice of Networkanager by running raspi-config.

It seems then, that there are two ways of resolving this. But unless you know exactly what you're doing, I'd encourage you to re-flash your SD card to ensure everything is in its proper place:

  1. If you're comfortable using NetworkManager, use raspi-config to set it as the default, declare the configuration you want in NM's configuration file(s) and reboot.

  2. If you're not particularly keen on NetworkManager, I'd leave the current default dhcpcd in place; the default setup in /etc/dhcpcd.conf works in the vast majority of cases with no changes. If you do want changes, consider postponing them until you've established that you have network connectivity.

Try that. If you still have problems, edit your question with a clear explanation of what's going on & we'll try again.

Seamus
  • 23,558
  • 5
  • 42
  • 83