Connecting ethernet over usb to ubuntu core

Trying to connect a raspberry pi to an ubuntu core installation using the usb method and having problems. Hopefully someone can help.

I’ve followed the usual config on the pi and it works fine connecting to a windows box. On bootup, the pi gets an IP address for the usb0 adapter.

On ubuntu core though the adapter does show up:

$ ifconfig
usb0 Link encap:Ethernet HWaddr d2:17:1c:87:76:69
inet6 addr: fe80::14ad:f9cf:c131:7669/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:46 errors:0 dropped:0 overruns:0 frame:0
TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5300 (5.3 KB) TX bytes:2319 (2.3 KB)

The adapter doesn’t get an IPv4 address though and I can’t ping the pi’s IP.

The interesting thing is that the device sits at connecting and then disconnects after timing out.

$ nmcli d
DEVICE TYPE STATE CONNECTION
usb0 ethernet connecting (getting IP configuration) Wired connection 3

Any advice would be hugely appreciated.

your description is slightly confusing … so if you use ubuntu core attached to a windows host all is fine and you get an IP for usb0 … if you connect to something else (i.e. an ubuntu desktop) you do not get an IP ?

typically the counterpart (the PC) is responsible for handing out the IP to the usb0 device … on an Ubuntu Desktop you’d go to the network-manager applet, select the usb connection and mark it “shared” in the ipv4 settings (in the pulldown menu) and also tick the checkbox at the bottom of the ipv4 page to tell it that an address is required to establish the connection.

Sorry for any confusion. The use case I need to get working is the pi connected to ubuntu core (not desktop).

So from your description, the ubuntu core box would be handing out the IP address? My issue above is the USB0 adapter doesn’t “connect” on ubuntu, it does however show up with an IP on the pi

if the Pi runs desktop/server and another (ubuntu core) board connects to it, the pi needs to have a dhcp server running to hand out an IP to the usb0 device when the connection comes up …

alternatively you can manually configure fixed IP settings on both sides of the USB cable …

would be happy to go with static ip’s on both sides. Do you know how to set a persistent static ip on usb0 on ubuntu core with snaps?

you can pick a static IP setup during initial configuration in console-conf