Skip to main content

Python Netlink library

Project description


Python network configuration library

PyRoute2 uses Netlink protocol to communicate with the Linux kernel
and get all the information about network objects -- interfaces, routes,
addresses, ARP cache entries and so on. Some of network objects can be
also modified.


* VLAN linkinfo data
* bridge info: see `./net/bridge/br_netlink.c:br_fill_ifinfo()`

Example usage

from pyroute2 import iproute
ip = iproute()
# lookup interface by name
dev = ip.link_lookup(ifname='eth0')[0]
# bring it down'set', dev, state='down')
# change interface MAC address and rename it'set', dev, address='00:11:22:33:44:55', ifname='bala')
# add primary IP address
ip.addr('add', dev, address='', mask=24)
# add secondary IP address
ip.addr('add', dev, address='', mask=24)
# bring it up'set', dev, state='up')


make install


Python >= 2.6


* home:
* bugs:

Project details

Release history Release notifications | RSS feed

Download files

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

Files for pyroute2, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size pyroute2-0.1.1.tar.gz (23.9 kB) File type Source Python version None Upload date Hashes View

Supported by

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