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.

8
  • did you create an interface file for usb interface? that guide creates interface for wired connection - e* and wifi connection - wl* ... but the interface name will be usb0 which doesn't match those - at least, I think that's happening :p Jan 14, 2021 at 23:16
  • Thank you @JaromandaX! I can remember to have set it up once without configuring a usb interface and it still worked for some time. Only now it doesn't anymore. I'm really confused. However, 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.
    – glades
    Jan 15, 2021 at 7:14
  • well, yeah, without avahi-daemon there will be no mDNS Jan 15, 2021 at 8:54
  • What is RNDIS? Usually there is an ethernet cable used for network connections. How do you use an USB-cable for a network connection? What Raspberry Pi version do you use? Do you use USB-gadget mode?
    – Ingo
    Jan 16, 2021 at 14:03
  • @JaromandaX It's not true don't having mDNS without avahi. Have a look at my answer.
    – Ingo
    Jan 16, 2021 at 14:05

2 Answers 2

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.

1
  • Thanks a lot for your elaborate answer and clarification! I found a solution to part of the problem, because I was accidentally missing the quotation marks in wpa_supplicant. Still, the problem with RNDIS persists (See EDIT of original post), but it doesn't seem to be related to systemd.
    – glades
    Jan 17, 2021 at 15:12
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.

2
  • Thanks, I will follow your tutorial as soon as I get to it. What I just noticed is that I removed ahavi daemon which is (afaik) a tool that allows hostname resolution somehow? Could that be a problem?
    – glades
    Jan 15, 2021 at 7:12
  • @glades I can't comment on avahi. I do not specifically use it but dhcpcd also provides Zero-conf and this is provided by other tools e.g. netatalk. I don't understand removing things - if you don't want them, or they cause problems disable them, but unless you are really short of space leave them alone.
    – Milliways
    Jan 15, 2021 at 7:33

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.