解決安裝Linux之後沒有網卡驅動

 新買的一臺HP臺式機(HP EliteDesk 800 G2 TWR)安裝Linux當做測試環境使用,安裝完成之後發現沒有網卡.

操作系統:Red Hat Enterprise Linux Server release 6.6 (Santiago)

lspci查看有網卡的信息如下所示

[root@saashr-new ~]# lspci | grep 'Ethernet controller'
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM (rev 31)

可以看到是Intel的,於是在官網上查找相關驅動手動安裝  版本I219-LM

https://downloadcenter.intel.com/zh-cn/product/36773/-

此次下載的是最新版本 e1000e-3.3.4.tar.gz

https://downloadcenter.intel.com/zh-cn/downloads/eula/15817/PCI-Intel-Linux-E-?httpDown=https%3A%2F%2Fdownloadmirror.intel.com%2F15817%2Feng%2Fe1000e-3.3.4.tar.gz

主要是安裝,解壓之後查看README裏面有詳細步驟

1. Move the base driver tar file to the directory of your choice. For

   example, use '/home/username/e1000e' or '/usr/local/src/e1000e'.


2. Untar/unzip the archive, where <x.x.x> is the version number for the

   driver tar file:

   tar zxf e1000e-<x.x.x>.tar.gz


3. Change to the driver src directory, where <x.x.x> is the version number

   for the driver tar:

   cd e1000e-<x.x.x>/src/


4. Compile the driver module:

   # make install

   The binary will be installed as:


   /lib/modules/<KERNEL VERSION>/updates/drivers/net/ethernet/intel/e1000e/e1000e.ko


   The install location listed above is the default location. This may differ

   for various Linux distributions.


5. Load the module using the modprobe command:

   modprobe <e1000e> [parameter=port1_value,port2_value]


   Make sure that any older e1000e drivers are removed from the kernel before

   loading the new module:

   rmmod e1000e; modprobe e1000e


6. Assign an IP address to the interface by entering the following,

   where ethX is the interface name that was shown in dmesg after modprobe:

   

   ip address add <IP_address>/<netmask bits> dev ethX


7. Verify that the interface works. Enter the following, where IP_address

   is the IP address for another machine on the same subnet as the interface

   that is being tested:

   ping <IP_address>


NOTE:

   For certain distributions like (but not limited to) RedHat Enterprise

   Linux 7 and Ubuntu, once the driver is installed the initrd/initramfs

   file may need to be updated to prevent the OS loading old versions

   of the e1000e driver. The dracut utility may be used on RedHat

   distributions:

# dracut --force

   For Ubuntu:

# update-initramfs -u


還附帶有命令行的參數解釋


Command Line Parameters

-----------------------

If the driver is built as a module, the following optional parameters are used

by entering them on the command line with the modprobe command using this

syntax:

modprobe e1000e [<option>=<VAL1>,<VAL2>,...]


There needs to be a <VAL#> for each network port in the system supported by

this driver. The values will be applied to each instance, in function order.

For example:

modprobe e1000e InterruptThrottleRate=16000,16000


In this case, there are two network ports supported by e1000e in the system.

The default value for each parameter is generally the recommended setting,

unless otherwise noted.


其實總結下就是

[root@saashr-new ~]# tar -zxvf e1000e-3.3.4.tar.gz
[root@saashr-new ~]# cd e1000e-3.3.4/src
[root@saashr-new ~]# make install
[root@saashr-new ~]# modprobe e1000e
[root@saashr-new ~]# ip address add <IP_address>/<netmask bits> dev eth0
[root@saashr-new ~]# ip -a
[root@saashr-new ~]# dracut --force

[root@saashr-new ~]# cd /etc/sysconfig/network-scripts
[root@saashr-new ~]# more ifcfg-eth0

DEVICE=eth0
ONBOOT=yes
TYPE=Ethernet
HWADDR=dc:4a:3e:67:35:2e
BOOTPROTO=static
IPV6INIT=no
USERCTL=no
IPADDR=xxxx
NETMASK=xxx

[root@saashr-new ~]# service network restart
Shutting down interface eth0:  Device state: 3 (disconnected)
                                                           [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/1
                                                           [  OK  ]

值得注意的是,/etc/udev/rules.d/70-persistent-net.rules也是在安裝的過程中新生成的

以上就是詳細的操作過程


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章