5

I'm trying to connect to my Raspberry Pi Zero over USB. The steps I followed are:

  1. Added dtoverlay=dwc2 to config.txt at boot partition
  2. Added modules-load=dwc2,g_ether after rootwait to cmdline.txt at boot partition
  3. Connected my rpi to my computer through the micro-usb data port.

This results in network manager from my computer creating a new wired connection, which implies a new network interface with an IPv6 assigned ip.

avahi-daemon is up and running, but something is failing. My wired connection disconnects and reconnects all the time.

avahi-browse returns something like:

+ enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66]               Workstation          local
- enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66]               Workstation          local
+ enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66]               Workstation          local
- enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66]               Workstation          local
+ enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66]               Workstation          local
- enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66]               Workstation          local
+ enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66]               Workstation          local
- enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66]               Workstation          local
+ enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66]               Workstation          local
- enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66]               Workstation          local
+ enp0s26u1u1 IPv6 raspberrypi [12:81:40:9a:91:66]               Workstation          local

A quick fix I found for the disconnections is to go to IPv6 Settings from my wired connection and select Link-Local Only as method. Later, to connect to my pi, I ping the whole network to retrieve its IPv6 address $ ping6 -I enp0s26u1u1 ff02::1. Finally I connect through ssh to the IP I just discovered $ ssh -6 pi@fe80::fa1a:6601:e3a1:4a31%enp0s26u1u1.

Inside the raspberry pi, running $ ip a s shows that the rpi has an IPv4 address! So know that I know the network, I can assign an IPv4 address to my workstation.

The problem is that I have to repeat, all this steps each time I connect/disconnect the USB from the rpi.

I was wondering if someone knows how to avoid repeating all the process, because obviously something is failing.

Thanks!

lpares12
  • 151
  • 2
  • 5

1 Answers1

6

Open the Edit Connections dialog, edit your wired connection x on your Ubuntu machine (16.04LTS here) and in the tab IPv4-settings set Method to Link-Local Only

That will make a reliable connection, and you can ssh afterward

ssh pi@raspberrypi.local

The first time I could easily connect wit ssh, but the pi zero itself had no internet access. I disconnected and connected again and afterwards the pi had internet access so I could apt update the pi, without changing anything.

Janghou
  • 1,446
  • 1
  • 16
  • 20