How to reestablish network interface

General support questions
Post Reply
afalanga
Posts: 96
Joined: 2013/01/31 00:29:05

How to reestablish network interface

Post by afalanga » 2017/11/22 19:31:01

Hi,

On some CentOS 7 systems I'm working with, I have Mellanox ConnectX-4 NICs. We want to use the latest Mellanox drivers rather than what's in the system sources. In order for easier deployment, I've wrapped the tarball that Mellanox distributes into an RPM. I'm flushing out errors in my %post and %preun scriptlets in the RPM.

It seemed good measure to do the following:
  • 1 find interfaces using mlx*
    2 ifconfig <intf> down (for any found)
    3 rmmod all mlx* modules
    4 perform install from Mellanox
    5 modprobe mlx4_en
    6 ifconfig <intf> up
It just so happens that our systems still use the "ethN" moniker for interface aliases. Let's say there's a Mellanox NIC on interface eth2. The trouble I'm having is that when the interface is brought down, and then the modules removed, there's no more hardware device the system can work with. That is, I have /sys/class/net/eth2 after I do ifconfig eth2 down but not after removing the modules.

What's the magic command to get the device back? Or, am I being too pedantic? Is it sufficient in doing an install like this to just unload the modules, do the Mellanox install and then systemctl restart network?

Post Reply