Should You Replace Ifconfig with IP Command for Infiniband Networking in Linux?


3 views

When working with Infiniband cards on Linux servers, you might encounter this warning message:

Ifconfig uses the ioctl access method to get the full address 
information, which limits hardware addresses to 8 bytes.
Because Infiniband address has 20 bytes, only the first 8 bytes 
are displayed correctly.
Ifconfig is obsolete! For replacement check ip.

This occurs because the traditional ifconfig command relies on an outdated ioctl() interface that can't properly handle modern network hardware like Infiniband adapters with their 20-byte addresses.

The key technical limitations are:

  • Maximum 8-byte hardware address display (truncates Infiniband's 20-byte addresses)
  • Depends on legacy net-tools package which is no longer actively maintained
  • Lacks support for modern networking features like network namespaces

The ip command from iproute2 package provides full functionality:

# View all network interfaces (including Infiniband)
ip addr show

# Detailed Infiniband interface information
ip link show ib0

# Check Infiniband statistics
ip -s link show ib0
Operation ifconfig ip
Interface status ifconfig ib0 ip link show ib0
Assign IP ifconfig ib0 192.168.1.2 netmask 255.255.255.0 ip addr add 192.168.1.2/24 dev ib0
Bring up ifconfig ib0 up ip link set ib0 up

For comprehensive Infiniband management, consider these specialized tools:

# Show Infiniband device information
ibstat

# Query port counters
ibqueryerrors

# Performance monitoring
perfquery

For systems using Infiniband:

  1. Replace all ifconfig usage with ip commands in scripts
  2. Update monitoring tools to use ip instead of parsing ifconfig output
  3. For legacy compatibility, install both net-tools and iproute2 packages

The net-tools package containing ifconfig has been in maintenance-only mode since 2001. The Linux networking stack has evolved significantly with:

  • Network namespaces
  • Advanced routing policies
  • VRF support
  • Modern interface types like Infiniband

These features are only properly supported by the ip command and related iproute2 utilities.


When working with Infiniband cards on Linux servers, you might encounter this warning:

Ifconfig uses the ioctl access method to get the full address 
information, which limits hardware addresses to 8 bytes.
Because Infiniband address has 20 bytes, only the first 8 bytes 
are displayed correctly.
Ifconfig is obsolete! For replacement check ip.

The ifconfig command comes from the net-tools package, which has been deprecated in favor of ip from iproute2. Here's why:

  • Limited address space (8 bytes vs 20 bytes needed for Infiniband)
  • Lacks support for modern networking features
  • No active development (last update was in 2001)
  • Inconsistent output formatting

The ip command provides complete functionality:

# Show all interfaces
ip addr show

# Show only Infiniband interfaces
ip addr show ib0

# Show link statistics
ip -s link show ib0

# Add an IP address
ip addr add 192.168.1.100/24 dev ib0

Common ifconfig commands and their ip equivalents:

# Old way
ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up

# New way
ip addr add 192.168.1.100/24 dev eth0
ip link set eth0 up

For Infiniband-specific information, use these commands:

# Show Infiniband devices
ibstat

# Show Infiniband links
iblinkinfo

# Show performance counters
perfquery

While deprecated, some legacy scripts might still require ifconfig. In such cases:

# Install net-tools if needed
sudo apt install net-tools  # Debian/Ubuntu
sudo yum install net-tools  # RHEL/CentOS

The iproute2 package is actively maintained and includes:

  • ss (replacement for netstat)
  • tc (traffic control)
  • bridge (bridge management)

For most modern systems, especially those using Infiniband, switching to ip commands is strongly recommended.