svinota / pyroute2

Python Netlink and PF_ROUTE library — network configuration and monitoring
https://pyroute2.org/
Other
958 stars 248 forks source link

[Wishlist] support changing ethtool settings #720

Open liske opened 4 years ago

liske commented 4 years ago

I wonder if it is already possible to get the same details for a device like calling the ethtool command:

# ethtool enp0s31f6
Settings for enp0s31f6:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Speed: 1000Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 1
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: on (auto)
    Supports Wake-on: pumbg
    Wake-on: g
    Current message level: 0x00000007 (7)
                   drv probe link
    Link detected: yes

I was able to get some of the settings using the two pyroute2 functions:

It would be nice to be able to set ethtool settings with pyroute2 to configure link speeds and autoneg advertise settings.

alexandredosim commented 11 months ago

Is there any way to set network connection properties like duplex and speed with pyroute2? I'm searching.