Skip to content

Instantly share code, notes, and snippets.

@GlitchWitch
Last active November 14, 2025 02:23
Show Gist options
  • Select an option

  • Save GlitchWitch/de26aa942a6eb877a3693ff3619054af to your computer and use it in GitHub Desktop.

Select an option

Save GlitchWitch/de26aa942a6eb877a3693ff3619054af to your computer and use it in GitHub Desktop.
Setup the RTL8156 USB2.5G Ethernet Adapter on Ubuntu 20.04

RTL8156 USB2.5G Ethernet Adapter on Ubuntu 20.04

Download: https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software

Extract the downloaded drivers

sudo tar -xvjf r8152.53.56-2.15.0.tar.bz2 -C /usr/src/

Create a DKMS.conf file

sudo echo -e 'PACKAGE_NAME="r8152"\nPACKAGE_VERSION="2.15.0"\nBUILT_MODULE_NAME[0]="$PACKAGE_NAME"\nDEST_MODULE_LOCATION[0]="/updates/dkms"\nAUTOINSTALL="YES"\nREMAKE_INITRD="YES"' > /usr/src/r8152-2.15.0/dkms.conf

Copy the .rules file to /usr/lib/udev/rules.d

sudo cp /usr/src/r8152-2.15.0/50-usb-realtek-net.rules /usr/lib/udev/rules.d/50-usb-realtek-net.rules

Install and load the driver

sudo dkms add -m r8152 -v 2.15.0
sudo dkms build -m r8152 -v 2.15.0
sudo dkms install -m r8152 -v 2.15.0
sudo depmod -a
sudo modprobe r8152
@GlitchWitch
Copy link
Author

GlitchWitch commented Mar 4, 2024

@jpaodev The out of tree Linux driver for this appears to only be made to support upto Kernel 5.17. Kernel 6+ should have native support and my guide should no longer be followed for distributions with more modern kernels.

I've used the same adaptor across both the latest release of Ubuntu and Proxmox without this.


As a tip, since it appears yours is detected and since you're using Proxmox, you will need to manually adjust your network configuration to use the new network interface before switching that connection. Read more here and here on that topic if you haven't already :]

(tl;dr update /etc/network/interfaces and replace enp0s31f6 with enx00e04c68006e before switching the cable and rebooting the networking stack)

@jpaodev
Copy link

jpaodev commented Mar 4, 2024

Will try that! Many thanks for the fast response and explanation - Have a nice week!:)

@bradleyhodges
Copy link

bradleyhodges commented Nov 14, 2025

For the latest version (2.20.1 at time of writing), download from here: https://www.realtek.com/Download/ToDownload?type=direct&downloadid=3375

RTL8156 USB2.5G Ethernet Adapter on Ubuntu 20.04

1. Extract the downloaded drivers

sudo tar -xvjf r8152-2.20.1.tgz -C /usr/src/

Tip

If you get an error stating tar (child): bzip2: Cannot exec: No such file or directory, you need to install bzip2 with: sudo apt update && sudo apt install bzip2 -y

2. Create a DKMS.conf file

sudo echo -e 'PACKAGE_NAME="r8152"\nPACKAGE_VERSION="2.20.1"\nBUILT_MODULE_NAME[0]="$PACKAGE_NAME"\nDEST_MODULE_LOCATION[0]="/updates/dkms"\nAUTOINSTALL="YES"\nREMAKE_INITRD="YES"' > /usr/src/r8152-2.20.1/dkms.conf

3. Copy the .rules file to /usr/lib/udev/rules.d

sudo cp /usr/src/r8152-2.20.1/50-usb-realtek-net.rules /usr/lib/udev/rules.d/50-usb-realtek-net.rules

4. Install and load the driver

sudo dkms add -m r8152 -v 2.20.1
sudo dkms build -m r8152 -v 2.20.1
sudo dkms install -m r8152 -v 2.20.1
sudo depmod -a
sudo modprobe r8152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment