Compile and install the NIC Driver in linux (NIC packet loss)
Source: Internet
Author: User
Compile and install the NIC Driver in linux (NIC packet loss)-Linux Enterprise Application-Linux server application information. The following is a detailed description. Install and compile the NIC Driver
In the past two days, I found that the packet loss of a server is very serious. The snmp package can be obtained when the cacti monitoring tool is used, which is often unavailable. The packet loss is serious, leading to slow connection using the ssh tool and database access timeout, in this case, determine whether the problem is a virus or a network card,
First, check the important directory of the overall server. No abnormal files are found, top view, no abnormal processes are found, and the network card Traffic is analyzed through cacti. The traffic is very small, from this, we can basically determine that it is irrelevant to the virus;
Therefore, you can only upgrade the NIC driver to see if the problem can be solved.
View NIC driver information first
View method:
[Root @ server46 ~] # Dmesg | grep eth0
Eth0: Broadcom NetXtreme II BCM5708 1000Base-T (B2) PCI-X 64-bit 133 MHz found at mem ce000000, IRQ 106, node addr 00: 1a: 64: 66: 98: 98
The red part indicates the NIC on the server, and then download the latest driver from the corresponding official website.
Linux-6.2.23.zip this source package is my new download, unzip
[Root @ server46 mysql] # unzip linux-6.2.23.zip
Enter the Directory:/home/mysql/Server/Linux/Driver. The directory of the package is different. This directory is the directory of my package, which contains
Netxtreme2-6.2.23.tar.gz RELEASE. bnx2i. txt release. bnx2x. TXT
Netxtreme2-6.2.23-1.src.rpm netxtreme2_sup-6.2.23-1.ISO.tar.gz RELEASE. bnx2.TXT
To upgrade the network card driver, you can install the source code package of rpm .tar.gz. You can collect the rpm package installation method. The following describes how to compile and install the package.
Decompress netxtreme2-6.2.23.tar.gz and enter the corresponding directory.
[Root @ server46 Driver] # cd netxtreme2-6.2.23
[Root @ server46 netxtreme2-6.2.23] # ls
Bnx2 bnx2-2.0.23b bnx2i bnx2i-2.6.2.4c bnx2x bnx2x-1.62.15 INSTALL. TXT Makefile
The installation method is prompted in each driver. Check the INSTALL. TXT file in cat.
File prompts
The following are general guidelines for installing the driver.
1. Create a directory and extract the files:
Tar xvzf netxtreme2- .Tar.gz
The following are all prompts:
How to view your own kernel version: [root @ server46 netxtreme2-6.2.23] # uname-r
2.6.18-128. el5,
Make later
[Root @ server46 netxtreme2-6.2.23] # make
Make-C bnx2/src KVER = 2.6.18-128. el5 PREFIX =
Make [1]: Entering directory '/home/mysql/Server/Linux/Driver/netxtreme2-6.2.23/bnx2-2.0.23b/src'
Make-C/lib/modules/2.6.18-128. el5/build SUBDIRS =/home/mysql/Server/Linux/Driver/netxtreme2-6.2.23/bnx2-2.0.23b/src modules
Make [2]: Entering directory '/usr/src/kernels/2.6.18-128. el5-x86_64'
Building modules, stage 2.
Make, check whether an error is prompted, otherwise it will cause a failure. If no failure is prompted, execute make install
Make [2]: Leaving directory '/usr/src/kernels/2.6.18-128. el5-x86_64'
Gzip-c bnx2x. 4> bnx2x.4.gz
Install-m 644 bnx2x.4.gz/usr/share/man/man4
Make [1]: Leaving directory '/home/mysql/Server/Linux/Driver/netxtreme2-6.2.23/bnx2x-1.62.15/src'
[Root @ server46 netxtreme2-6.2.23] # ls
If no error is prompted in the middle, there will be too much content, and there will be no more
At this point, you need to note, because the directory/home/mysql/Server/Linux/Driver/netxtreme2-6.2.23 has multiple bnx2, bnx2i, bnx2x
How to determine the driver file in the directory to be installed? Check the previous INSTALL. TXT file.
-Bnx2 driver for the Broadcom NetXtreme II BCM5706/BCM5708/5709/5716
10/100/1000/2500/10000 Mbps PCIX/PCIE Ethernet Network Controller.
-Bnx2x driver for the Broadcom NetXtremeII BCM57710/BCM57711/BCM57711E
10/100/1000/2500/10000 Mbps PCIE Ethernet Network Controller.
From the NIC model we obtained earlier, eth0: Broadcom NetXtreme II BCM5708 1000Base-T (B2) PCI-X 64-bit 133 MHz found at mem ce000000, IRQ 106, node addr 00: 1a: 64: 66: 98: 98
Therefore, you need to copy the driver file under bnx2.
[Root @ server46 netxtreme2-6.2.23] # cp bnx2/src/bnx2.ko/lib/modules/2.6.18-128. el5/kernel/net/
Path:/lib/modules/2.6.18-128. el5/kernel/net/is your kernel version, which can be viewed by uname-r.
Then attach the permission:
Chmod-R 755 // lib/modules/2.6.18-128. el5/kernel/net/
Grant the executable permission, so that the executable permission will be assigned during restart.
Then run the depmod command to update the modules. dep file.
[Root @ server46 netxtreme2-6.2.23] # vi/etc/modprobe. conf file
Alias eth0 bnx2
Alias eth1 bnx2
Alias scsi_hostadapter aacraid
Alias scsi_hostadapter1 ata_piix
OK. Exit, save,
Reboot system
After logging on to the system, View
[Root @ server46 ~] # Lsmod | grep bnx2
Bnx2 224140 0
[Root @ server46 ~] # Ethtool-I eth1
Driver: bnx2
Version: 2.0.23b
Firmware-version: bc 1.9.6
Bus-info:. 0
If the current version is 2.0.23b, the upgrade is successful !!!!!
Everything works normally when cacti is used for monitoring.
When server packet loss occurs:
Ping the gateway to check whether packet loss occurs.
Ping the gateway to check whether packet loss exists. If packet loss exists, use another server to test whether the ping will cause packet loss. If packet loss exists, consider the network problem. If no packet loss exists, server issues, network cards, and systems are prioritized.
Check whether the system is caused by viruses. check whether there are garbled files and abnormal processes in the system. Use tcpdump to monitor traffic exceptions. If none of the above are found, nic
Consider the NIC. Generally, the server has dual NICs. You can change the NIC first. If packet loss occurs, upgrade the NIC Driver.
This article is recorded at the time of compilation and installation. Some of the records are incorrect. Therefore, it is for your reference only. Other ideas can be added to the QQ group: 140704742.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.