0

My Raspberry Pi 3B+ is running on Ubuntu Server 18.04. I have it connected to my PC via ethernet dongle in link-local mode.

I tried adding a static IP on the Pi with netplan, but I couldn't connect at all. I'm getting a "no route to host" error.

network:
  version: 2
  renderer: NetworkManager
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
      addresses: [169.254.2.14/24]

I used this same netplan on Ubuntu MATE 18.04 (running on Pi 3) which worked fine.

I can, however, connect through WiFi, but the problem is that my school's WiFi will make it impossible for me to SSH it via wireless.

  • I'm trying to connect the Pi (running on Ubuntu) to my PC (running on Kubuntu) – YamiYukiSenpai Feb 2 at 12:27
  • Are you running an SSH server in at least one of the computers (the PC or the Pi)? You can install openssh-server in the computer you want as server and connect to it from the other one. You should also check that there is a network connection, and that you allow connecting (through the firewall). – sudodus Feb 2 at 12:34
  • 1
    More details about what you've tried would be great. I can see that you're on a 169.254.x.x address - which is typically used only by APIPA on Windows. Have you confirmed that the client you're trying to connect from is on the same subnet? – ddybing Feb 2 at 12:34
  • @user68186 just edited it. I hope that's more detailed. If not, let me know. – YamiYukiSenpai Feb 2 at 21:13
  • @sudodus it has openssh-server – YamiYukiSenpai Feb 2 at 21:13
1

Must've been super groggy, because I didn't realize that the subnet I set for the Pi is 24, not 16.

After changing that and setting the renderer to networkd, it now works.

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
      addresses: [169.254.2.14/16]

Though I set NetworkManager's ethernet.enabled to true, so I thought that should've worked (# snap set network-mananger ethernet.enable=true, which I got from here).

In addition, I had to run # systemctl disable systemd-networkd-wait-online.service & # systemctl mask systemd-networkd-wait-online.service in order for the Pi to boot faster (thanks to this answer). Leaving it enabled made the Pi stuck & waiting for connection (correct me if I'm wrong).

  • Thanks for sharing your solution :-) – sudodus Feb 3 at 8:28
  • systemd-networkd-wait-online.service blocks until you have a default Internet route. According to your configuration above you don't have a default route. So this service will wait and hit a timeout. But what services do you have installed that depend on networkd-wait-online? Services should only declare a dependency on this if they really care about getting out to the Internet; if you have such services installed, masking networkd-wait-online would not make your system more reliable. – slangasek Feb 5 at 0:14

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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