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
@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