Conversation
Edited 12 days ago

How do I show the current Ethernet connection speed and duplexness on Linux? The command ethtool eth0 only shows the supported/advertised/… modes. No, it’s there, I’m just a dumb foxxo that doesn’t notice things.

2
1
0
@diffie for me ethtool does show current connection speed and duplexness (as just "Speed" and "Duplex", which is Unknown if nothing is plugged in)
1
0
0

I’m used to read this from dmesg but there must be a better way IMO. sysfs? Some ethtool option? ifconfig with some opts?

0
0
0
long terminal output
Show content

@noisytoot It shows this for my USB network card:

Settings for enp0s20f0u6u3:
        Supported ports: [ TP    MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 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
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: Symmetric Receive-only
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Auto-negotiation: on
        Port: MII
        PHYAD: 20
        Transceiver: internal
netlink error: Operation not permitted
        Current message level: 0x00007fff (32767)
                               drv probe link timer ifdown ifup rx_err tx_err tx_queued intr tx_done rx_status pktdata hw wol
        Link detected: yes
1
0
0

@noisytoot Oh, I just didn’t notice the line there. neofox_dizzy_blush

1
0
0

@diffie if you don’t want to use ethtool (or just want to get the speed/duplex with no other info) you can also use /sys/class/net/<interface>/speed and /sys/class/net/<interface>/duplex (speed will be -1 and duplex unknown if nothing is plugged in)

0
0
1