Package: ethtool
Python ethtool modulePython bindings for the ethtool kernel interfaceThe Pythonethtoolmodule allows querying and partially controlling network
interfaces, driver, and hardware settings.WarningThis is the new upstream for python-ethtool maintained by Fedora’s
Python SIG. We ported it to Python 3 and only maintain it for the current
tools to keep working.No new development is happening. This is a
deprecated package.If you are considering to start using this, please
don’t. We recommendnetifacesinstead.InstallationThe easiest way to installethtoolis to use your distribution packages
repositories. For example:Fedora:sudo dnf installpython3-ethtoolorsudo dnf installpython2-ethtoolUbuntu:sudo apt installpython-ethtoolIn order to installethtoolfrom source or PyPI install its dependencies first:Fedora:sudo dnf installlibnl3-develgccredhat-rpm-configpython3-develUbuntu:sudo apt install python3python3-setuptoolslibpython3.6-devlibnl-route-3-devAnd then installethtool:from PyPI:pip3 install ethtoolfrom source:python3 setup.py installUsageethtoolmay be used as a Python library:>>> import ethtool
>>> ethtool.get_active_devices()
['lo', 'enp0s31f6', 'wlp4s0', 'virbr0', 'docker0', 'virbr1', 'eth0', 'tun0']
>>> ethtool.get_ipaddr('lo')
'127.0.0.1'Theethtoolpackage also provides thepethtoolandpifconfigutilities.  More example usage may be gathered from their sources,pethtool.pyandpifconfig.py.pethtoolmimics behavior of theethtoolutility, but does not
support all options.e.g., to get driver information on theeth0interface:$ pethtool -i eth0
driver: cdc_ether
bus-info: usb-0000:00:14.0-4.1.3Analogically,pifconfigmimicsifconfigin usage.  It may be
used to view information on an interface:$ pifconfig lo
lo
      inet addr:127.0.0.1   Mask:255.0.0.0
          inet6 addr: ::1/128 Scope: host
          UP LOOPBACK RUNNINGFurther usage information may be found in the respective manpages forpethtoolandpifconfig.TestsTests may be run bytox.AuthorsAndy GroverAntoni S. PuimedonArnaldo Carvalho de MeloBohuslav KabrdaBraňo NáterDave MalcolmDavid S. MillerDavid SommersethHarald HoyerCharalampos StratakisJeff GarzikLumir BalharMiro HrončokMiroslav SuchýRuben KerkhofSanquiYaakov SelkowitzCurrent maintainersLumír Balhar <lbalhar@redhat.com>Miro Hrončok <mhroncok@redhat.com>Charalampos Stratakis <cstratak@redhat.com>ContributingFeel free to help us with improving test coverage, porting to Python 3
or anything else.
Issues and PRson GitHubare welcome.LicenseThe Pythonethtoolproject is free software distributed under the terms of
the GNU General Public License v2.0, seeCOPYING.Changelog0.15Thu Jul 29 2021 Lumír Balhar <lbalhar@redhat.com>Tests are now skipped for wireguard devicespifconfig is now able to show more than one IPv4 address per interfacepifconfig supports interfaces with no IPv4 address0.14Wed Sep 12 2018 Miro Hrončok <mhroncok@redhat.com>Declared project as bugfix only from now onSupport Python 3.7Fix important issues reported by static analysisFix installation on non-UTF-8 locales on Python 3.5 and 3.6Added set_gso(), get_gro() and set_gro() functionsAdded installation instructions0.13Tue Jun 13 2017 Miro Hrončok <mhroncok@redhat.com>First release on PyPISupports both Python 2.7 and 3.5+Dropped support for Python 2.6Upstream URL changed tohttps://github.com/fedora-python/python-ethtoolIntroduced a basic README filePEP7 and PEP8 (code style) improvementsFix compilation errors on modern Fedoras0.12Tue Mar 21 2017 Charalampos Stratakis <cstratak@redhat.com>First attempt at python3 support0.11Thu May 8 2014 David Sommerseth <davids@redhat.com>Improved error handling several placesEnsure that we get a valid libnl NETLINK connection when connectingURL updates to SPEC file0.10Fri Jan 10 2014 David Sommerseth <davids@redhat.com>Not really a full release, but a preliminary release to get more wide testingFSF Copyright updatesBuild fixesMostly code cleanup0.9Wed Dec 11 2013 David Sommerseth <davids@redhat.com>Fixed get_active_devices() for IPv6 only interfacesMoved from libnl1 to libnl3Refactor PyNetlink*Address implementation0.8Tue Feb 19 2013 David Malcolm <dmalcolm@redhat.com>Enable IPv6 in pifethtool exampleCode cleanup, fixing buffer overflows, memory leaks, etc0.7Mon Apr 11 2011 David Sommerseth <davids@redhat.com>Fixed several memory leaks (commit aa2c20e697af, abc7f912f66d)Improved error checking towards NULL values(commit 4e928d62a8e3)Fixed typo in pethtool –help (commit 710766dc722)Only open a NETLINK connection when needed (commit 508ffffbb3c)Added man page for pifconfig and pethtool (commit 9f0d17aa532, rhbz#638475)Force NETLINK socket to close on fork() using FD_CLOEXEC (commit 1680cbeb40e)0.6Wed Jan 19 2011 David Sommerseth <davids@redhat.com>Don’t segfault if we don’t receive any address from rtnl_link_get_addr()Remove errornous file from MANIFESTAdded ethtool.version string constantAvoid duplicating IPv6 address informationimport sys module in setup.py (Miroslav Suchy)0.5Mon Aug  9 2010 David Sommerseth <davids@redhat.com>Fixed double free issue (commit c52ed2cbdc5b851ebc7b)0.4Wed Apr 28 2010 David Sommerseth <davids@redhat.com>David Sommerseth is now taking over the maintenance of python-ethtoolNew URLs for upstream source codeAdded new API: ethtool.get_interfaces_info() - returns list of etherinfo objectsAdded support retrieving for IPv6 address, using etherinfo::get_ipv6_addresses()0.3Tue Aug 26 2008 Arnaldo Carvalho de Melo <acme@redhat.com>Add get_flags method from the first python-ethtool contributor, yayAdd pifconfig command, that mimics the ifconfig tool using the
bindings available0.2Wed Aug 20 2008 Arnaldo Carvalho de Melo <acme@redhat.com>Expand description and summary fields, as part of the fedora
review process.0.1Tue Dec 18 2007 Arnaldo Carvalho de Melo <acme@redhat.com>Get ethtool code from rhpl 0.212