To enable and use ethernet over USB in Linux, we need to enable it first.
First of all we need to know the logical name of the USB device:
lshw -class network
Output might look like this:
*-network:0 DISABLED
description: Ethernet interface
physical id: 1
bus info: usb@2:1
logical name: enx00e04c07002e
serial: 00:e0:4c:07:00:2e
size: 1Gbit/s
capacity: 1Gbit/s
capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.10.11 duplex=full link=no multicast=yes port=MII speed=1Gbit/s
We need to check and look to the correct USB Ethernet interface and write down the logical name, in this case: enx00e04c07002e.
Then we have to generate a netplan:
sudo netplan generate
After that we need to edit the following file (Or similar) to add our USB Ethernet device:
vim /etc/netplan/00-installer-config.yaml
We just need to add our interface (highlighted below):
# This is the network config written by 'subiquity'
network:
ethernets:
enp1s0:
dhcp4: true
enx207bd29c666e:
dhcp4: true
version: 2
Finally, we just need to apply the netplan and reboot the PC
sudo netplan apply && sudo reboot -h now
After reboot, we should see the IP address assigned to our PC via the new USB Ethernet device.
networking – USB Ethernet adapter refusing to work on Ubuntu Server – Ask Ubuntu: Enable USB Ethernet device in Linux