Matching devices with the corresponding interfaces
![]()
If you define multiple interfaces on a Linux® instance, you must keep track of the interface names assigned to your network devices.
Methods to list network interface names include:
- For all available devices, use the ip link show command.
- For qeth, use the lszdev -i command to obtain a mapping.
- For virtio_net, which handles all network devices on a KVM guest, see Mapping interfaces to CCW devices.
- For PCI-based network devices, use smc_rnics, see smc_rnics - list RoCE Express PCI functions and control their online state.
For all network devices that are online, there is a symbolic link of the form /sys/class/net/<interface>/device where <interface> is the interface name. This link points to a sysfs directory that represents the corresponding network device. You can read this symbolic link with readlink to confirm that an interface name corresponds to a particular network device.