Open liske opened 4 years ago
I wonder if it is already possible to get the same details for a device like calling the ethtool command:
ethtool
# 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:
Ethtool.get_link_mode()
EthtoolLinkMode( speed=1000, duplex='Full', autoneg=True, supported_ports=['TP'], supported_modes=['10baseT/Half', '10baseT/Full', '100baseT/Half', '100baseT/Full', '1000baseT/Full'])
Ethtool.get_link_info()
EthtoolLinkInfo( port='Twisted Pair', phyaddr=1, tp_mdix='on', tp_mdix_ctrl='auto', transceiver='Internal')
It would be nice to be able to set ethtool settings with pyroute2 to configure link speeds and autoneg advertise settings.
Is there any way to set network connection properties like duplex and speed with pyroute2? I'm searching.
I wonder if it is already possible to get the same details for a device like calling the
ethtool
command:I was able to get some of the settings using the two pyroute2 functions:
Ethtool.get_link_mode()
Ethtool.get_link_info()
It would be nice to be able to set
ethtool
settings with pyroute2 to configure link speeds and autoneg advertise settings.