Skip to main content

View and control network interfaces. Linux only currently! Join us lets make it available for other OSes

Project description

General information

Pyiface is a package that exposes the network interfaces of the operating system in an easy to use and transparent way. Typical usage looks like this:

#!/usr/bin/env python

import pyiface
from pyiface.ifreqioctls import IFF_UP

# Get all available network interfaces
allIfaces = pyiface.getIfaces()
for iface in allIfaces:

# Get a specific interface by name
eth0 = pyiface.Interface(name='eth0')

# view eth0 info

# bring eth0 up
eth0.flags = eth0.flags | IFF_UP

# set ipv4 address of the interface
eth0.addr = (socket.AF_INET, '')

# set ipv6 address of the interface
eth0.addr = (socket.AF_INET6, '2001:0db8:85a3:0000:0000:8a2e:0370:7334')


To install the package simply call with the install option.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyiface-0.0.11.tar.gz (17.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page