标签归档:网卡

redhat5、redhat6安装HP DL380 DL580 G5 G6服务器网卡驱动步骤

Installing the RPM Package

  1. This package requires a build environment. Please refer to the
    “Build Environment Setup” Section before proceding to the next step.
  2. Install the source RPM package. rpm -ivh hp-e1000e-.src.rpm
  3. Build the binary RPM for the e1000e driver. RHEL 5: rpmbuild -bb /usr/src/redhat/SPECS/hp-e1000e.spec RHEL 6: rpmbuild -bb ~/rpmbuild/SPECS/hp-e1000e.spec SLES: rpmbuild -bb /usr/src/packages/SPECS/hp-e1000e.spec If you get an error during the build process, refer to the
    “Build Environment Setup” section. NOTE: One can build binary RPM for a specfic kernel flavor as follows: rpmbuild -bb SPECS/hp-e1000e.spec –define “KVER ” NOTE: RHEL 5 x86 installations require the “–target” switch when
    building on Intel compatible machines. Please see the “Caveats”
    section below for more details. rpmbuild –target=i686 -bb /usr/src/redhat/SPECS/hp-e1000e.spec
  4. Check for the existence of a current version of the e1000e package as follows: RHEL rpm -q kmod-hp-e1000e- SLES rpm -q hp-e1000e-kmp- If an old version of the package exists, the RPM package should be
    removed. Remove the corresponding tools package before removing
    driver package. RHEL rpm -e kmod-hp-e1000e- SLES rpm -e hp-e1000e-kmp- Verify if the old hp-e1000e package has been removed as follows: RHEL rpm -q kmod-hp-e1000e- SLES rpm -q hp-e1000e-kmp-
  5. Install the new binary RPM package. RHEL 5 rpm -ivh \ /usr/src/redhat/RPMS//kmod-hp-e1000e–..rpm RHEL 6 rpm -ivh \ ~/rpmbuild/RPMS//kmod-hp-e1000e–..rpm The modules are installed in the following directory:
    /lib/modules//extra/hp-e1000e Note: The “–nodeps” switch is required when installing on RHEL 5.5. See
    “Caveats” section below for more details. rpm -ivh \ /usr/src/redhat/RPMS//kmod-hp-e1000e–..rpm –nodeps SLES rpm -ivh RPMS//hp-e1000e-kmp–..rpm The modules are installed in the following directory:
    /lib/modules//updates/hp-e1000e
  6. Configure your network setting and address. You may need to refer to your
    Linux vendor documentation. Helpful network configuration tools such as
    “yast2” in SLES or linuxconf/redhat-config-network/netconfig in Red Hat
    exist for easy configuration.

For SLES, user may have to specify the module as e1000e while configuring
the network. The module can be specified in Hardware Details of Advanced
configuration

  1. Ensure that the /etc/modules.conf file is configured similar to the example
    listed below. The example below is presented as if more than one adapter is
    present. If so, one eth# instance should exist for each ethernet port. Refer to
    the modules.conf man page for more information. alias eth0 e1000e
    alias eth1 e1000e

For SLES, the configuration file is /etc/modprobe.conf or /etc/modprobe.conf.local

  1. You can now reboot your server or restart the network services. Upon reboot
    the network should start with the e1000e driver loaded

To verify that the e1000e driver is loaded use the following command.

# lsmod

You should find e1000e listed. You can also verify if the correct e1000e driver is
loaded through any of the following methods. Note that version of the driver loaded
should be same as that of the package version.

A. Look for driver load messages in the system log.

#dmesg | grep Intel

You should see messages of the following type,

Intel(R) PRO/1000 Network Driver - version x.x.x

B. Check the /var/log/messages file for a similar message as indicated in method A.

Note: To load the driver from command line use ‘modprobe’ instead of ‘insmod’.
Refer to the man pages for lsmod, ifconfig, rmmod, insmod, modprobe, modules.conf
and modprobe.conf for more detailed information.

Uninstalling the RPM

The following command will uninstall the RPM.

Red Hat
# rpm -e kmod-hp-e1000e-<kernel flavor>

SLES
# rpm -e hp-e1000e-kmp-<kernel flavor>

Limitations

Some Linux distributions may not add the default route back to a specified network
device when a network stop/start command is used. Use the route command to add the
default router back to the network device.

Some Linux distributions may not add the default assigned IP address back to a
specified network device when using the following:

ifconfig eth(x) down
rmmod <module name>
insmod <module name> <optional parameter changes>
ifconfig eth(x) up

Another step to reassign the IP address back to the device may be required:

ifconfig eth(x) <ip address>

Some Linux distributions may add multiple IP addresses with the same system name in
the /etc/hosts file when configuring multiple network devices.

HP服务器redhat操作系统升级网卡驱动的方法

现有一台HP DL580 G7服务器,redhat linux5.6 64位操作系统,需要升级网卡驱动,步骤如下:

1、安装源RPM包
#rpm -ivh hp-nx_nic-xxx.src.rpm
2、为hp-nx-nic和hp-nx_nic-tools软件包构建二进制RPM
#rpmbuild -bb /usr/src/redhat/SPECS/hp-nx_nic.spec
3、检查是否已存在现有版本的nx_nic软件包
#rpm -q kmod-hp-nx_nic-<flavor>
如果存在旧版本,需要删除
#rpm -e kmod-hp-nx_nic-<flavor>
验证是否已经被删除
#rpm -q kmod-hp-nx_nic-<flavor>
然后删除相应的工具包
#rpm -e hp-nx_nic-tools
4、验证是否有旧版本的nx_nic或者netxen_nic加载到内核中
#lsmod |grep nx_nic
或者
#lsmod |grep netxen_nic
删除驱动前需要将网口down掉
#ifconfig eth<n> down
然后删除驱动
#modprobe -r nx_nic
或者
#modprobe -r netxen_nic
5、安装相关的hp-nx_nic-tools版本,然后再安装驱动程序包
#rpm -ivh /usr/src/redhat/RPMS/<arch>/hp-nx_tools-<version>-<arch>.rpm
6、安装新的二进制驱动程序RPM软件包
#rpm -ivh /usr/src/redhat/RPMS/<arch>/kmod-hp-nx_nic-<flavor>-<version>.<arch>.rpm
7、运行modinfo nx_nic并验证驱动程序版本
#modinfo nx_nic
8、运行modprobe nx_nic以安装新的nx_nic驱动
#modprobe nx_nic
9、完成

升级网卡固件版本,可以参考https://www.eumz.com/2021-01/2120.html

HP服务器升级网卡固件、驱动来解决网卡bug的操作办法

现有一台HP DL580 G7服务器,运行redhat linux5.6 64位操作系统,突然出现宕机现象,重启后查看/var/log/messages,发现有:interface1 kernel:eth0:firmware hang detected相关信息,考虑到HP G7的服务器曾经出现过网卡BUG,再通过ethtool -i eth0查看网卡固件版本,发现是固件版本是4.0.555,需要升级固件。

HP DL580 G7服务器的网卡由QLogic代工,这个网卡的固件存在缺陷,在流量过载或正常情况下也会出现网卡驱动崩溃的情况,会导致服务器宕机,需要更新固件。并且使用该型号NC375i的服务器都会受影响,比如HP DL370 G6、HP DL585 G7、HP DL980 G7等型号。

本次升级固件、驱动需要使用引导盘smartstart8.7、网卡固件文件CP016410.scexe、网卡驱动文件hp-nx_nic-4.0.590-2.src.rpm。

引导盘smartstart8.7下载链接:https://downloads.hpe.com/pub/softlib2/software1/cd/p1760479716/v71252/smartstart-8.70B-0-x64.zip
网卡固件文件CP016410.scexe,可下载Smart Update Firmware DVD10.10,可参考链接:
https://support.hpe.com/hpsc/swd/public/detail?swItemId=MTX_4372f442c3424063809e3d9198
网卡驱动文件hp-nx_nic-4.0.590-2.src.rpm下载链接:
https://downloads.hpe.com/pub/softlib2/software1/pubsw-linux/p280489831/v80579/hp-nx_nic-4.0.590-2.src.rpm

升级固件的步骤如下:
1、使用引导盘smartstart8.7引导,进入下图界面时,按Ctrl+Alt+F1,进入再按回车,进入命令行界面。

2、将带有固件文件的U盘插入,在命令行下使用fdisk -l命令查看U盘路径,下图中U盘在/dev/sda1。

3、通过mount /dev/sda1 /mnt挂载U盘,进入/mnt目录,执行命令 ./CP016410.scexe升级固件,按y进行升级,升级完成后执行命令reboot重启服务器,进入操作系统。

4、进入操作系统,使用命令ethtool -i eth0查看固件版本,发现固件版本已由4.0.555升级到4.0.585,此时可以正常ping通网关,网络正常。
5、再升级网卡驱动,升级网卡驱动详见:https://www.eumz.com/2021-01/2127.html

rp_filter及Linux下多网卡接收多播的问题

有一台双网卡的机器,上面装有Fedora8,运行一个程序。该程序分别在两个网口上都接收多播数据,程序运行是正常的。但是,后来升级系统到Fedora13,发现就出问题了:在运行几秒钟后,第2个网口上就接收不到多播数据了。

能不能收到多播,取决于交换机是不是往这个网口上转发多播数据。程序在起动的时候,会发一个IGMP的AddMembership的消息,交换机将把这个网口加入多播组。当在其他网口上收到该地址的多播包后,会转至这个网口。其后,为了确认该接收者一直在线,交换机会发送一个IGMPQuery消息,接收者反馈一个IGMP Report消息,以确认自己的存在。如果交换机没有收到IGMPReport,则认为该接收者已经断线,就不再往该网口上转发多播包了。

用抓包工具定位了一下,发现程序在启动时确实发了AddMembership消息,这是正常的。在接收下来的5秒时间内,程序能够收到多播数据。接着,交换机发来了一条IGMPQuery,问题来了,这个Fedora13系统却没有反馈Report。这是很奇怪的。按理说,IGMP属于系统自动完成的协议,无需用户干预;那么按照预期,Linux会自动反馈IGMPReport的。事实上,Feodra8和WinXP系统就是这么做的,都很正常。为什么到了Fedora13反而不正常了呢?

在调查“为什么不反馈IGMPReport”的事情上,花了一周时间都没有进展,后来发现其实不至Fedora13,其他的主流linux如Ubuntu10,SUSE14也存在同样的问题。

查了众多论坛都没有一点提示信息。后来,终于在一个英文网站上扫到了一个信息:rp_filter。后来证明,这个关键词是解决问题的关键。reverse-pathfiltering,反向过滤技术,系统在接收到一个IP包后,检查该IP是不是合乎要求,不合要求的IP包会被系统丢弃。该技术就称为rpfilter。怎么样的包才算不合要求呢?例如,用户在A网口上收到一个IP包,检查其IP为B。然后考查:对于B这个IP,在发送时应该用哪个网口,“如果在不应该接收到该包的网口上接收到该IP包,则认为该IP包是hacker行为”。

例如:

A: 192.168.8.100

B: (IGMP Query) 10.0.0.1 来自路由器

查找路由表

网卡1为默认路由: 172.17.5.100  172.17.5.1

网卡2          192.168.8.100  192.168.8.1

系统根据路由表,认为10.0.0.1这个IP应该在第一个网卡172.17.5.100上收到,现实的情况是在第二张网卡192.168.8.100上收到了。认为这是不合理的,丢弃该包。致命的问题的,该包是来自路由器的IGMPQuery包。

The rp_filter can reject incoming packets if their sourceaddress doesn’t match the network interface that they’re arrivingon, which helps to prevent IP spoofing. Turning this on, however,has its consequences: If your host has several IP addresses ondifferent interfaces, or if your single interface has multiple IPaddresses on it, you’ll find that your kernel may end up rejectingvalid traffic. It’s also important to note that even if you do notenable the rp_filter, protection against broadcast spoofing isalways on. Also, the protection it provides is only against spoofedinternal addresses; external addresses can still be spoofed.. Bydefault, it is disabled.

解决方法:

系统配置文件
1. /etc/sysctl.conf
把 net.ipv4.conf.all.rp_filter和net.ipv4.conf.default.rp_filter设为0即可
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
系统启动后,会自动加载这个配置文件,内核会使用这个变量

2. 命令行
显示一个内核变量 sysctl net.ipv4.conf.all.rp_filter
设置一个内核变量 sysctl -w net.ipv4.conf.all.rp_filter=0
设置完后,会更新内核(实时的内存)中的变量的值,但不会修改sysctl.conf的值

3. 使用/proc文件系统
查看 cat /proc/sys/net/ipv4/conf/all/rp_filter
设置 echo “0”>/proc/sys/net/ipv4/conf/all/rp_filter