IBM Support

Determining which network interfaces are recognized by the kernel

Question & Answer


Question

How can I determine which network interfaces are recognized by the kernel and their link statuses?

Answer

When troubleshooting networking issues it can be difficult to pin down where the problem is.  A good place to start is to check link connectivity from the network interfaces for the system.   Red Hat linux provides several file systems that give insight into the running kernel.

The /sys file system can be used to determine which network interfaces the kernel can see.  You can combine this knowledge with the standard ethtool output to get a list of the interfaces and their current link status.  As the root user on the host, run the following command string:

cd /sys/class/net; for if in eth*; do ret=$(ethtool $if | grep "Link") && echo -e "$if: $ret"; done

This results in output similar to the following:
[root@nps_server ~]# cd /sys/class/net; for if in eth*; do ret=$(ethtool $if | grep "Link") && echo -e "$if: $ret"; done

eth0:   Link detected: yes
eth1:   Link detected: yes
eth2:   Link detected: yes
eth3:   Link detected:
no
eth4:   Link detected:
no
eth5:   Link detected: yes
eth6:   Link detected: yes
eth7:   Link detected:
no


The output provides a definitive list of the network interfaces that the kernel recognizes and their link statuses. In the example, three interfaces are showing no connectivity.

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ366631

Document Information

More support for:
IBM PureData System

Software version:
1.0.0

Document number:
464639

Modified date:
17 October 2019

UID

swg21572520