4

I've apparently "broken" network access to one of my Debian 'bookworm' systems that run on Raspberry Pi hardware. This resulted from my apparent lack of understanding of details wrt how the various "network tools" operate. The broken system is a "headless" unit; I can no longer make an SSH connection to it. It doesn't even respond to a ping.

I'm raising this question here in the faint hope someone can explain if there's a way to regain SSH access without making any changes to the system. My current recourse is to remove the NVME SSD, and mount it on another system to correct the configuration error, or connect a monitor & keyboard, but these are difficult due to lack of hardware/cables, etc.

What I did: Got "fed up" with NM's arcane nmcli interface, and thought, "there's got to be a better way". I read this page on Debian's website; specifically:

NetworkManager will only handle interfaces not declared in /etc/network/interfaces

I interpreted this to mean that if I declared my WiFi interface (wlan0) in /etc/network/interfaces, then NetworkManager would "step away", and systemd would use ifup, ifdown, etc to manage wlan0 IAW the contents I added to /etc/network/interfaces. Here's the contents of the interfaces file I created:

iface wlan0 inet static
    address 192.168.1.222
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 192.168.1.1

After a reboot I found I could no longer access this system via SSH.

I have two questions:

  1. Is there any way to regain SSH access without making changes to the system?
  2. Why did the data I entered in /etc/network/interfaces fail to yield a working wifi connection?
5
  • 3
    This does not help with answering your question, but if you primarily dislike NetworkManager due to dislike of nmcli, you may be interested in learning more about the alternative nmtui command which is briefly referenced on that Debian page (it's my go-to way of using NetworkManager in the absence of a GUI). Commented Feb 25 at 8:31
  • 1
    Is connecting Ethernet a possibility? Commented Feb 25 at 9:43
  • @Zombie_Pigdragon: Yes, I'm aware of it, and have used it. The thing I still don't like is the obtuse, and un-editable file that controls it all - the *.nmconnection (viewable via nmcli con show xxx). Personally, I simply do not need all of that arcane obfuscation in a "network manager" :) What could be simpler than a dhcpcd.conf or an interfaces file? 6 or 8 easily comprehensible lines is quite enough for me. Commented Feb 25 at 16:43
  • @jcaron: Typically, no. In my case these are mostly small "embedded" systems scattered about the property. Some do not even include an Ethernet jack :) Commented Feb 25 at 16:45
  • @Seamus Most RPIs have Ethernet and those that don't have USB, so an USB-to-Ethernet adapter would do and would probably avoid the need for a monitor or keyboard. Commented Feb 25 at 17:10

1 Answer 1

19
  1. No (see below).

  2. You didn’t specify which wireless network to connect to. See the Debian wiki for details; essentially, you need to install the appropriate packages (wpasupplicant etc.) and add wpa-ssid and wpa-psk entries to your interface definition.

Additionally, your stanza only defines the interface but doesn‘t say when to activate it. You’ll want to add auto wlan0 above the interface declaration in order to tell the networking subsystem to bring it online at boot time, or allow-hotplug wlan0 to bring it up when the device is detected.

7
  • 1
    Thanks for another great answer :) - and for the clarification re auto vs. allow-hotplug. Debian has a lot of very good documentation, but it's tough to actually find it at times. For example, I would have thought that a very good place to add the information that you cited would have been on the "Network Configuration wiki" page... IMHO, the #2 paragraph should be titled "Setting up the network interface", and should have included the applicable section you cited in your answer. Oh well... Commented Feb 25 at 16:56
  • 2
    @Seamus the wiki isn’t great, indeed; it’s a wiki though so anyone can pitch in to improve it ;-). The auto v. allow-hotplug stuff is documented in man 5 interfaces but I know that’s not particularly discoverable either. Commented Feb 25 at 16:59
  • Additionally, if OP had done this to a wired interface, it has much greater chance to work. It would be worth OP leaving eth0 configured with DHCP even if not cabled up. Commented Feb 26 at 1:12
  • "anyone can pitch in to improve it" Uh, no... you've apparently not tried that lately :) Commented Feb 26 at 3:20
  • @Seamus thanks for trying! Are you unable to create an account? Commented Feb 26 at 8:02

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.