skillfed

netifaces

Portable network interface information.

netifaces v0.11.0 2.7M downloads/30d#2,951 on PyPI338
Permissive license MIT License Abandoned released

What it is and what it does

netifaces is a Python library that abstracts away the platform-specific complexity of querying network interface information. Instead of writing different code for Linux, macOS, Windows, and other systems, you import netifaces and call simple functions to enumerate interfaces, retrieve their addresses (IPv4, IPv6, MAC), and discover gateway configuration. It returns results as dictionaries keyed by address family, allowing you to handle multiple addresses per interface and different address types uniformly.

The package solves the portability problem by wrapping low-level system APIs into a single consistent interface. You can list all interfaces, query addresses for a specific interface by family, retrieve hardware addresses, and access default or non-default gateways—all without worrying about whether you're running on POSIX or Windows.

Use it for:

  • Enumerate all network interfaces and their IP addresses to discover local network configuration in a cross-platform tool.
  • Retrieve MAC addresses for network interfaces to identify hardware or implement network-based licensing.
  • Query default gateway information to route traffic or configure network policies programmatically.
  • Build network monitoring or diagnostics utilities that need to work on Linux, macOS, and Windows without platform-specific code.
  • Detect IPv6 addresses alongside IPv4 to support dual-stack network applications.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides portable access to network interface information (addresses, gateways, hardware details) across Linux, macOS, Windows, and other Unix-like systems from Python.

No—not recommended for new projects. The package is abandoned (last release 2021-05-31, repository archived, maintainer explicitly unable to continue). While it works and has no known vulnerabilities, there is no active maintenance, no response to issues or pull requests, and no guarantee of compatibility with future Python or OS versions.

Install

netifaces on PyPI

pip

pip install netifaces

uv

uv add netifaces

poetry

poetry add netifaces

Installing netifaces

Before you install

Medium install friction due to C extension compilation required on installation. Package is abandoned as of 2021-05-31 with no active maintenance; the original maintainer explicitly stated they can no longer maintain it. Repository is archived.

License in practice

MIT License (permissive) allows commercial and private use with minimal restrictions, requiring only license and copyright notice retention.

Quickstart

import netifaces

# List all network interfaces
interfaces = netifaces.interfaces()

# Get addresses for a specific interface
addrs = netifaces.ifaddresses('lo0')
ipv4_addrs = addrs[netifaces.AF_INET]

# Get gateway information
gateways = netifaces.gateways()
default_gw = gateways['default'][netifaces.AF_INET]

Requires C compiler and platform development tools to build the extension during installation (tar/setup.py or pip will compile from source on most systems).

Verify before relying

  • Whether the package works reliably on modern Python versions despite being abandoned since 2021
  • Whether pre-built wheels for recent Python versions are available or if compilation is always required
  • Known compatibility issues or regressions on current operating systems

Package facts

License MIT License (permissive)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance abandoned — 1,901 days since the last release
Last repo commit (repository archived)
First released
Downloads 2,666,675/month — #2,951 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: netifaces-0.11.0-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl; netifaces-0.11.0-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl; netifaces-0.11.0-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl; netifaces-0.11.0-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl; netifaces-0.11.0-cp27-cp27m-win32.whl; netifaces-0.11.0-cp27-cp27m-win_amd64.whl; netifaces-0.11.0-cp34-cp34m-win32.whl; netifaces-0.11.0-cp35-cp35m-manylinux_2_5_i686.manylinux1_i686.whl; netifaces-0.11.0-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl; netifaces-0.11.0-cp35-cp35m-win32.whl; netifaces-0.11.0-cp36-cp36m-macosx_10_15_x86_64.whl; netifaces-0.11.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl; netifaces-0.11.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl; netifaces-0.11.0-cp36-cp36m-win32.whl; netifaces-0.11.0-cp36-cp36m-win_amd64.whl; netifaces-0.11.0-cp37-cp37m-macosx_10_15_x86_64.whl; netifaces-0.11.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl; netifaces-0.11.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl; netifaces-0.11.0-cp37-cp37m-win32.whl; netifaces-0.11.0-cp37-cp37m-win_amd64.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: System :: Networking

Tags

network interface addresses pythonget mac address pythonnetwork gateway informationportable network infointerface enumeration cross-platformnetwork configuration pythonifaddresses ipv4 ipv6
abandonedcross-platformnetwork-info

More Networking packages