I was playing with psutil.net_if_addrs() to list all the NICS on a server, but noticed that two NICS were missing.
Upon investigation, it seems that when the NIC interface doesn't have IPv4 and IPv6 protocol enabled, psutil won't add them to the list of NICS.
While this could look like a normal bahavior, it limits the ability of psutil to see bridged / virtual switch connected NICs that will have IP protocol disabled because of the bridging.
All kind of hypervisor systems (VirtualBox, VMWare workstation, Hyper-V) and other bridged NICS will be impacted by this.
Summary
Description
I was playing with
psutil.net_if_addrs()
to list all the NICS on a server, but noticed that two NICS were missing. Upon investigation, it seems that when the NIC interface doesn't have IPv4 and IPv6 protocol enabled, psutil won't add them to the list of NICS. While this could look like a normal bahavior, it limits the ability of psutil to see bridged / virtual switch connected NICs that will have IP protocol disabled because of the bridging. All kind of hypervisor systems (VirtualBox, VMWare workstation, Hyper-V) and other bridged NICS will be impacted by this.Best regards.