您的位置:首页 > 运维架构 > Linux

解决安装Linux之后没有网卡驱动

2016-08-05 15:56 429 查看
新买的一台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也是在安装的过程中新生成的
以上就是详细的操作过程
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Linux e 网卡驱动