My laptop does not have a RJ-45 or Ethernet port, not because it is one of those slim ultrabooks but because it is cheap, very very cheap. So what I do when i need to use lan, I use a USB-Ethernet adapter and recently I bought a new one. TP-Link UE200 a usb 2.0 ethernet adapter with rtl8152b chipset.
It was working fine on windows but on my Kali (kernel: 4.18.0-kali2) it was extremely unreliable, dropped packets and worked rarely that too for short durations. I was really confused as the kernel had r8152 module pre-installed and loaded, modinfo r8152 indicated that it was all fine, all my proxy parameters were right and the static IP setup too was fine. I searched around and didn’t find much.
Just when I was starting to feel too sleepy to continue, I thought of reinstalling the module. This is how I did it.
- Visit realtek’s site (which for no reason defaults to Chinese) and download the required rtl8152b driver source package for Linux.
- Extract the archive contents and in that directory right click and select Open in Terminal.
- In terminal enter make and wait for it to finish successfully. Before doing this make sure you have build-essentials and linux kernel headers installed.
- make will create a file named r8152.ko in that folder.
- Then cp /lib/modules/(kernel being used uname -r)/kernel/drivers/net/usb/r8152.ko /root/r8152.ko.bak this will copy the existing module and save it in your home folder.
- Now cp /root/directory/to_the_newly_compiled_module/r8152.ko /lib/modules/(kernel being used uname -r)/kernel/drivers/net/usb/r8152.ko copies the newly compiled module to kernel/drivers/net/usb/ folder.
- File size difference in those two modules (Version 1.something and 2.something) was almost a megabyte.
- Now modprob r8152 just to make sure the new one is loaded, modinfo r8152Â will show you a newer version, in my case it jumped from 1.something to 2.something.
- Now you’ll have to update-initramfs and it may not be necessary but you should also update-grub.
- After all this go for a reboot to settle things down.
This fixed my problem and now the Ethernet adapter works as it should. I loved troubleshooting it and the final result was even more rewarding, a peak download speed of 12.46MBps.
Content in Bold Italics corresponds to commands, some directly usable others need a little bit tinkering like replacing “(kernel being used uname -r)” with output of uname -r.
I Use Kali Linux and I am guilty of using root account for most of what I do, you may need to use sudo when running some of these commands on a different distribution.
Leave a comment