No wired ethernet connection detected on Ubuntu 20.04 server
I have an ubuntu 20.04 server. When installing I connected an ethernet cable to the motherboard ethernet port. I know for a fact that the internet cable is OK, as I have a different server, which connects like it should
Relevant information
$ lspci | grep -i eth
yields:
02:00.0 Ethernet controller: Realtek Semiconductor Co., RTL8125 2.5GbE Controller (rev 04)
$ sudo lshw -c network
yields:
*-network UNCLAIMED
description: Ethernet controller
product: RTL8125 2.5GbE Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
version: 04
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd cap_list
configuration: latency=0
resources: ioport:3000(size=256) memory:a1100000-a110ffff memory:a1110000-a1113fff
$ ip addr
:
1L lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
My /etc/network/interfaces
:
# The loopback network interface
auto lo
iface eth0 lo inet loopback
# The primary network interface
iface eth0 inet dhcp
/etc/netplan/01-netcfg.yaml
:
# This is the network config written by 'subiquity'
network:
version: 2
renderer: networkd
ethernets:
ens33:
dhcp4: true
I have tried several options (this, that, that and that) but none are working for me. Am I missing something?
The kernel did not support my ethernet adapter by default. Downloading the drivers from here (the 2.5G linux driver) and trying to install that resulted in multiple errors about missing packages. These could not be easily installed (I wasn't able to at least). So I figured I should write a step by step guide for others experiencing the same problems as I did.
Step 1: (Download kernel files)
I downloaded the following files in order to upgrade the kernel:
https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.9/amd64/linux-headers-5.9.0-050900_5.9.0-050900.202010112230_all.deb
https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.9/amd64/linux-headers-5.9.0-050900-generic_5.9.0-050900.202010112230_amd64.deb
https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.9/amd64/linux-image-unsigned-5.9.0-050900-generic_5.9.0-050900.202010112230_amd64.deb
https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.9/amd64/linux-modules-5.9.0-050900-generic_5.9.0-050900.202010112230_amd64.deb
Then move to a USB drive (remember, we don't have the convenience of internet to do everything for us...)
example folder structure: D:/kernel/
You should have 4 files in the kernel folder on your usb drive.
Step 2: (Mount USB)
- Create a folder for mounting your USB:
$ mkdir /media/usb
- Find USB drive address:
$ lsblk
- Mount USB drive in folder:
sudo mount /dev/sdb1 /media/usb
(my USB drive's address wassdb1
)
Step 3: (Install new kernel)
To install:
Move to the kernel folder
$ cd /media/usb/kernel
And install the new kernel:
$ sudo dpkg -i *.deb
Step 4: (find ethernet interface)
If all has gone well as it did for me you should find a new interface when running the following command: $ ip a
For a more detailed guide on this, please refer to this answer
Hope it helped!
Mind you, switching to the HWE stack kernel will severely limit LTE support, as they only come with 6 months worth of security updates.
If ^ this is a problem for you, you could download the missing packages for installing the required driver from realtek, then downgrade the kernel to the standard version and subsequently install the driver from a usb stick now that you have the required packages.