1

I followed this guide to set up networking over systemd:

Use systemd-networkd for general networking

After rebooting I can't connect to my Raspi again using USB cable (with RNDIS). Also, I somehow screwed up my wifi credentials so the raspi doesn't connect to my router again... and to top it of, for some reason it doesn't help when I put a fresh wpa_supplicant.conf into the boot partition of the sd card.

I used Advanced IP scanner to test if the raspi is present within the network, but apparently it isn't. So it is fully secluded. Is there a way to connect to it again without reinstalling the operating system?

EDIT: Turns out I was on the wrong path all along. I put my wpa_supplicant credentials without quotation marks "". This would lead to the Raspi not connecting to the router as it should. For some reason Bonjour decided to resolve raspberry.local to route over the WLAN IP instead of the RNDIS direct connection. So naturally, when that option was not available anymore it just didn't work anymore.

This doesn't solve the issue though. I would still want to be able to connect over RNDIS, even more so because the LAN connection could break anytime. But how can I tell Bonjour then that raspberrypi.local should be looked up over the RNDIS ethernet interface? I would like to skip mDNS and directly assign the IP addresses of each interface (host and device), but I don't know how this is possible.

glades
  • 163
  • 1
  • 9

2 Answers2

2

Not a complete solution because lack of detailed information what you exactly have tried. But here are some clarifications to questions from comments that may help.

As noted in the guide:

But you have to do a complete switch. There is no way to mix up with Debian networking and/or dhcpcd.

In the past I have tried to just disable that services but run into problems with it having side effects with software that silently expected availability of traditional networking. To have clear conditions and clear error messages I decided to remove them completely. If you need them, it's no problem to install them again, having in mind that you know what you are doing.

It is not true that there is no mDNS name resolution when removing the avahi-daemon. This is one of the examples where we have serious conflicts with systemd-resolved that is used instead. Because the guide is about systemd-networkd I of course use the latter and enable it by installing libnss-resolve. To enable mDNS with systemd-resolved just set option MulticastDNS=yes in the /etc/systemd/network/*.network files.

There is only one restriction that systemd-reolved cannot do with mDNS. It is not able to propagate services as for example used by the print service cups. You will not find printers in your network. This is the only situation I know, where you need avahi.

You wrote in a comment:

I suspect the removal of ahavi-daemon could have impaired the ability to find my raspi over RNDIS using just the hostname. I'm using Bonjour on my Windows PC.

Here you are mixing up two things. Using just the hostname isn't supported by mDNS and therefore also not by Bonjour. For this you always have to use domain .local, e.g. ping hostname.local. Only using the hostname is a service supported by Microsoft, called Link-Local Multicast Name Resolution (LLMNR) and has nothing to do with mDNS. Fortunately systemd also supports it. To enable it with systemd-resolved just set option LLMNR=yes in the /etc/systemd/network/*.network files.

To check name resolution use command resolvectl, e.g.:

rpi ~$ resolvectl   # status of interface configuration
rpi ~$ resolvectl query mylaptop.local   # mDNS
rpi ~$ resolvectl query mylaptop         # LLMNR
rpi ~$ resolvectl --help

If you are open to use new technologies let me know about your problem details and I will have a look at it.

Ingo
  • 42,961
  • 20
  • 87
  • 207
0

If you ACTUALLY followed the linked tutorial it should work although I find it rather confusing and it contains some poor advice (removing dhcpcd5 and other networking tools).

I have a simpler tutorial See https://raspberrypi.stackexchange.com/a/117843/8697 but there is no advantage over the default networking method for simple networking and it is more complex to setup.

If you have not deleted networking tools it is simple to revert to default setup. "put(ing) a fresh wpa_supplicant.conf into the boot partition" will DO NOTHING as you have disabled to tools to use it.

Milliways
  • 62,573
  • 32
  • 113
  • 225