服务器linux安装后没有网卡驱动,解决安装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

此次下载的是最新版本 e1000e-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 is the version number for the

driver tar file:

tar zxf e1000e-.tar.gz

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

for the driver tar:

cd e1000e-/src/

4. Compile the driver module:

# make install

The binary will be installed as:

/lib/modules//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 [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 / 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

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 [=,,...]

There needs to be a 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 / 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也是在安装的过程中新生成的

以上就是详细的操作过程

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值