ethtool with virtual NIC shows nothing - print the current settings of the NIC in OpenStack VM

5,031

Solution 1

If you are looking to change tso, gso, sg, gro, etc, you should be able get output from 'ethtool -k'. You may also benefit from looking into 'ip link'.

Solution 2

The information provided by ethtool is accurate as it is reporting on a VM's virtual NIC. You might get more information if you were mapping a virtual function from a NIC with SR-IOV support.

Remember that the physical NICs are not directly connected to the VM, but are providing an uplink to the virtual switch running on the hypervisor host. Outgoing frames destined for another VM on the same network, running on the same host will not use the physical NIC. This type of traffic can, and frequently does, exceed the speed of the physical NIC. Therefore reporting the speed of the physical NIC would be inaccurate.

You will need to query this information on the hypervisor host itself.

Also in a service provider context providing information about the physical infrastructure can be seen as a security risk.

Solution 3

The easiest method I've found is to query the interface device details directly via /sys.

For e.g., I have the interface enp98s0:

$ cat /sys/class/net/enp98s0/speed
10000

Where the general form would be /sys/class/net/<interface>/speed.

Share:
5,031

Related videos on Youtube

Sybil
Author by

Sybil

Updated on September 18, 2022

Comments

  • Sybil
    Sybil over 1 year

    On a OpenStack VM I see only

    # ethtool eth0
    Settings for eth0:
            Link detected: yes
    

    On RHEV VM the same small output. Tried it on Ubuntu and RHEL7 VM.

    I wish to see something like (the speed of NIC)

    Supported link modes:   10baseT/Half 10baseT/Full
                               100baseT/Half 100baseT/Full
       Supports auto-negotiation: Yes
       Advertised link modes:  10baseT/Half 10baseT/Full
                               100baseT/Half 100baseT/Full
    

    Howto see that on OpenStack VM (RHOS OpenStack Juno)? We use Software defined Networking (Plumgrid).

    • Rui F Ribeiro
      Rui F Ribeiro over 7 years
      I would not stress too much of ethtool not giving reliable data in a (para)virtualised environment. Full emulations of the NIC comes with a cost.