{"id":5047,"date":"2025-11-14T23:40:49","date_gmt":"2025-11-15T05:40:49","guid":{"rendered":"https:\/\/icesquare.com\/wordpress\/?p=5047"},"modified":"2025-11-14T23:40:49","modified_gmt":"2025-11-15T05:40:49","slug":"how-to-install-realtek-2-5g-ethernet-driver-r8125-on-rhel7","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/how-to-install-realtek-2-5g-ethernet-driver-r8125-on-rhel7\/","title":{"rendered":"How to Install Realtek 2.5G Ethernet driver r8125 on RHEL7"},"content":{"rendered":"<p>I am going to show you how to install TP-Link 2.5GB PCIe Network Card (TX201) in CentOS 7.<\/p>\n<p>There are few methods. The first method is to compile the driver from the <a href='https:\/\/www.realtek.com\/Download\/List?cate_id=584' target='_blank'>Realtek website<\/a>. If you want to try it, don&#8217;t be fooled by the file name (r8125-9.016.01.tar.tgz). It is in bzip2 format. Also, good luck to compile from the source as it not compilable with the gcc installed in RHEL7.<\/p>\n<p>Here are some errors if you are interested:<\/p>\n<pre>\r\nCC:  cc\r\nCCVERSION:  4.8.5\r\nKERNEL_GCC_VERSION:  4.8.5\r\nKVER:  3.10.0-1160.119.1.el7.x86_64\r\nKMAJ:  3\r\nKMIN:  10\r\nKREV:  0\r\nBASEDIR:  \/lib\/modules\/3.10.0-1160.119.1.el7.x86_64\r\nDRIVERDIR:  \/lib\/modules\/3.10.0-1160.119.1.el7.x86_64\/kernel\/drivers\/net\/ethernet\/realtek\r\nPWD:  \/tmp\/r8125\/r8125-9.016.01\/src\r\nRTKDIR:  kernel\/drivers\/net\/ethernet\/realtek\r\n\r\nmake -C \/lib\/modules\/3.10.0-1160.119.1.el7.x86_64\/build M=\/tmp\/r8125\/r8125-9.016.01\/src clean\r\nmake[1]: Entering directory `\/usr\/src\/kernels\/3.10.0-1160.119.1.el7.x86_64'\r\n  CLEAN   \/tmp\/r8125\/r8125-9.016.01\/src\/.tmp_versions\r\nmake[1]: Leaving directory `\/usr\/src\/kernels\/3.10.0-1160.119.1.el7.x86_64'\r\nmake -C \/lib\/modules\/3.10.0-1160.119.1.el7.x86_64\/build M=\/tmp\/r8125\/r8125-9.016.01\/src modules\r\nmake[1]: Entering directory `\/usr\/src\/kernels\/3.10.0-1160.119.1.el7.x86_64'\r\n  CC [M]  \/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.o\r\nIn file included from \/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:87:0:\r\n\/tmp\/r8125\/r8125-9.016.01\/src\/r8125.h:130:9: error: static declaration of \u2018strscpy\u2019 follows non-static declaration\r\n ssize_t strscpy(char *dest, const char *src, size_t count)\r\n         ^\r\nIn file included from include\/linux\/bitmap.h:8:0,\r\n                 from include\/linux\/cpumask.h:11,\r\n                 from .\/arch\/x86\/include\/asm\/cpumask.h:4,\r\n                 from .\/arch\/x86\/include\/asm\/msr.h:10,\r\n                 from .\/arch\/x86\/include\/asm\/processor.h:20,\r\n                 from .\/arch\/x86\/include\/asm\/cpufeature.h:7,\r\n                 from .\/arch\/x86\/include\/asm\/thread_info.h:22,\r\n                 from include\/linux\/thread_info.h:66,\r\n                 from include\/linux\/preempt.h:9,\r\n                 from include\/linux\/spinlock.h:50,\r\n                 from include\/linux\/seqlock.h:35,\r\n                 from include\/linux\/time.h:5,\r\n                 from include\/linux\/stat.h:18,\r\n                 from include\/linux\/module.h:10,\r\n                 from \/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:39:\r\ninclude\/linux\/string.h:31:9: note: previous declaration of \u2018strscpy\u2019 was here\r\n ssize_t strscpy(char *, const char *, size_t);\r\n         ^\r\nIn file included from \/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:87:0:\r\n\/tmp\/r8125\/r8125-9.016.01\/src\/r8125.h:157:30: error: redefinition of \u2018skb_checksum_start\u2019\r\n static inline unsigned char *skb_checksum_start(const struct sk_buff *skb)\r\n                              ^\r\nIn file included from include\/linux\/if_ether.h:23:0,\r\n                 from include\/uapi\/linux\/ethtool.h:18,\r\n                 from include\/linux\/ethtool.h:17,\r\n                 from include\/linux\/netdevice.h:43,\r\n                 from \/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:42:\r\ninclude\/linux\/skbuff.h:2347:30: note: previous definition of \u2018skb_checksum_start\u2019 was here\r\n static inline unsigned char *skb_checksum_start(const struct sk_buff *skb)\r\n                              ^\r\nIn file included from \/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:87:0:\r\n\/tmp\/r8125\/r8125-9.016.01\/src\/r8125.h:209:20: error: redefinition of \u2018page_is_pfmemalloc\u2019\r\n static inline bool page_is_pfmemalloc(struct page *page)\r\n                    ^\r\nIn file included from .\/arch\/x86\/include\/asm\/pci.h:4:0,\r\n                 from include\/linux\/pci.h:1644,\r\n                 from \/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:41:\r\ninclude\/linux\/mm.h:1161:20: note: previous definition of \u2018page_is_pfmemalloc\u2019 was here\r\n static inline bool page_is_pfmemalloc(struct page *page)\r\n                    ^\r\nIn file included from \/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:87:0:\r\n\/tmp\/r8125\/r8125-9.016.01\/src\/r8125.h:255:20: error: redefinition of \u2018ether_addr_copy\u2019\r\n static inline void ether_addr_copy(u8 *dst, const u8 *src)\r\n                    ^\r\nIn file included from \/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:43:0:\r\ninclude\/linux\/etherdevice.h:246:20: note: previous definition of \u2018ether_addr_copy\u2019 was here\r\n static inline void ether_addr_copy(u8 *dst, const u8 *src)\r\n                    ^\r\n\/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:16851:12: error: static declaration of \u2018pci_enable_msix_range\u2019 follows non-static declaration\r\n static int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,\r\n            ^\r\nIn file included from \/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:41:0:\r\ninclude\/linux\/pci.h:1336:5: note: previous declaration of \u2018pci_enable_msix_range\u2019 was here\r\n int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,\r\n     ^\r\n\/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:17066:9: error: unknown field \u2018ndo_change_mtu\u2019 specified in initializer\r\n         .ndo_change_mtu     = rtl8125_change_mtu,\r\n         ^\r\n\/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:17066:9: warning: missing braces around initializer [-Wmissing-braces]\r\n\/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:17066:9: warning: (near initialization for \u2018rtl8125_netdev_ops.<anonymous>\u2019) [-Wmissing-braces]\r\n\/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:17066:9: warning: initialization from incompatible pointer type [enabled by default]\r\n\/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:17066:9: warning: (near initialization for \u2018rtl8125_netdev_ops.<\/anonymous><anonymous>.ndo_get_stats64\u2019) [enabled by default]\r\n\/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c: In function \u2018rtl8125_rx_interrupt\u2019:\r\n\/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.c:20713:20: error: \u2018struct net_device\u2019 has no member named \u2018last_rx\u2019\r\n                 dev->last_rx = jiffies;\r\n                    ^\r\nmake[2]: *** [\/tmp\/r8125\/r8125-9.016.01\/src\/r8125_n.o] Error 1\r\nmake[1]: *** [_module_\/tmp\/r8125\/r8125-9.016.01\/src] Error 2\r\nmake[1]: Leaving directory `\/usr\/src\/kernels\/3.10.0-1160.119.1.el7.x86_64'\r\nmake: *** [modules] Error 2\r\n<\/anonymous><\/pre>\n<p>The second method is here:<\/p>\n<p>First, download the compiled driver from <a href='https:\/\/rpm.pbone.net\/results_srodzaj_3_dist[]_93_search_kmod-r8125.html' target='_blank'>here<\/a>. There are multiple versions, I suggest to pick the latest version (e.g., \tkmod-r8125-9.013.02-1.el7_9.elrepo.x86_64.rpm)<\/p>\n<pre>\r\n#wget ftp:\/\/ftp.icm.edu.pl\/vol\/rzm5\/linux-elrepo\/archive\/elrepo\/el7\/x86_64\/RPMS\/kmod-r8125-9.013.02-1.el7_9.elrepo.x86_64.rpm\r\n#sudo yum install kmod-r8125-9.013.02-1.el7_9.elrepo.x86_64.rpm\r\n<\/pre>\n<\/p>\n<p>After that, verify the driver has been installed:<\/p>\n<pre>\r\n#kmod list | grep r8125\r\nr8125                 208216  0\r\n<\/pre>\n<p>To load the driver, run the following:<\/p>\n<pre>\r\n#sudo modprobe r8125\r\n<\/pre>\n<p>To verify the driver is loaded:<\/p>\n<pre>\r\n#ifconfig\r\np4p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500\r\n        inet 192.168.1.123  netmask 255.255.255.0  broadcast 192.168.1.255\r\n        inet6 fe80::8e78:31b7:7130:f1e9  prefixlen 64  scopeid 0x20<link \/>\r\n        ether 00:11:22:33:44:55  txqueuelen 1000  (Ethernet)\r\n<\/pre>\n<p>Verify the speed is correct:<\/p>\n<pre>\r\nethtool p4p1 | grep Speed\r\nCannot get wake-on-lan settings: Operation not permitted\r\n        Speed: 2500Mb\/s\r\n<\/pre>\n<p>That&#8217;s it, hope it helps.<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am going to show you how to install TP-Link 2.5GB PCIe Network Card (TX201) in CentOS 7. There are few methods. The first method is to compile the driver <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/how-to-install-realtek-2-5g-ethernet-driver-r8125-on-rhel7\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[6],"tags":[],"class_list":["post-5047","post","type-post","status-publish","format-standard","hentry","category-technology"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-1jp","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":4436,"url":"https:\/\/icesquare.com\/wordpress\/how-to-fix-the-mess-created-by-zfs-on-linux-after-update\/","url_meta":{"origin":5047,"position":0},"title":"&#8220;ZFS on Linux&#8221;: The ZFS modules are not loaded. Try running &#8216;\/sbin\/modprobe zfs&#8217; as root to load them.","author":"Derrick","date":"April 10, 2018","format":false,"excerpt":"Last Updated: Oct 10, 2021 This article is based on my experience with CentOS 7. If you are running other Linux distributions, please adjust the commands and package names accordingly (e.g., yum --> apt-get). As of Oct 3, 2019, I cannot get ZFS on Linux running on CentOS 8. ZFS\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4630,"url":"https:\/\/icesquare.com\/wordpress\/zfs-how-to-update-linux-kernel-without-reboot\/","url_meta":{"origin":5047,"position":1},"title":"[ZFS On Linux]How to Update Linux Kernel without Rebooting the System","author":"Derrick","date":"January 3, 2020","format":false,"excerpt":"As of Jan 2020, I manage 65 Linux + ZFS servers. Normally, I prefer to reboot each server after updating its kernel (according to Ret Hat, most updates are related to security fix). Without ZFS, it is not a big issue because rebooting a basic Linux server takes about 30\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4202,"url":"https:\/\/icesquare.com\/wordpress\/centosrhel-7-no-zfs-after-updating-the-kernel\/","url_meta":{"origin":5047,"position":2},"title":"CentOS\/RHEL 7 &#8211; No ZFS After Updating the Kernel","author":"Derrick","date":"December 12, 2016","format":false,"excerpt":"Let's all agree with this fact: ZFS is foreign to Linux. It is not native. You can't expect that ZFS on Linux will run smoothly as FreeBSD or Solaris. Having using ZFS on Linux since 2013 (and ZFS on FreeBSD since 2009), I've noticed that ZFS does not like Linux\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4691,"url":"https:\/\/icesquare.com\/wordpress\/virtualboxcentos-7-ns_error_failure\/","url_meta":{"origin":5047,"position":3},"title":"[VirtualBox]CentOS 7: NS_ERROR_FAILURE","author":"Derrick","date":"February 28, 2020","format":false,"excerpt":"After I reboot one of my VirtualBox host servers today, I was unable to start the virtual box guests. The error was a popular one: NS_ERROR_FAILURE. The problem was caused by the kernel mismatch problem. All you need is to rebuild the virtual box library to match with your system\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4679,"url":"https:\/\/icesquare.com\/wordpress\/zfs-on-linux-trouble-this-pool-uses-the-following-features-not-supported-by-this-system-all-unsupported-features-are-only-required-for-writing-to-the-pool\/","url_meta":{"origin":5047,"position":4},"title":"[ZFS On Linux Trouble] This pool uses the following feature(s) not supported by this system&#8230;All unsupported features are only required for writing to the pool, zpool create: invalid argument for this pool operation","author":"Derrick","date":"February 11, 2020","format":false,"excerpt":"When I rebooted my computer and loaded my ZFS pool today, I got this error message: #sudo zpool import -a This pool uses the following feature(s) not supported by this system: org.zfsonlinux:project_quota (space\/object accounting based on project ID.) com.delphix:spacemap_v2 (Space maps representing large segments are more efficient.) All unsupported features\u2026","rel":"","context":"In &quot;Technology&quot;","block_context":{"text":"Technology","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4542,"url":"https:\/\/icesquare.com\/wordpress\/centos-7-dracut-initqueue-timeout\/","url_meta":{"origin":5047,"position":5},"title":"CentOS 7 &#8211; dracut-initqueue timeout","author":"Derrick","date":"January 2, 2019","format":false,"excerpt":"I received a Christmas gift from the RHEL 7 \/ CentOS 7 \/ Linux kernel team today. After my system got updated to the new kernel (3.10.0-957.1.3.el7.x86_64), my system gave me few surprises. As a sys-admin, I don't want to see any surprise. What I really want is a working\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/5047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=5047"}],"version-history":[{"count":2,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/5047\/revisions"}],"predecessor-version":[{"id":5049,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/5047\/revisions\/5049"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=5047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=5047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=5047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}