How to display network interface stats on Linux?

345070 pts.
Tags:
Linux
Network interface
Throughput
Is there an easy way to capture and display network interface throughput stats via Linux?  I also need to have that information returned on the command line.  Is there a native property I can use or will I have to install a plugin?

Answer Wiki

Thanks. We'll let you know when a new response is added.

To check Interface Status  ethtool  command  is there , to check its status .
Example : #ethtool eth0

Output would be like:

Settings for eth0:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: FIBRE
        PHYAD: 2
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Link detected: yes

Other Option would be:

1. ifconfig eth0

Output Wolud be Like  :

eth0      Link encap:Ethernet  HWaddr ***********
          inet addr:10.0.100.10  Bcast:10.0.100.255  Mask:255.255.255.0
          inet6 addr: ********** Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:26014101 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22890522 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3702954767 (3.4 GiB)  TX bytes:8528203042 (7.9 GiB)
          Interrupt:25 Memory:98000000-98012800

2.  ip -s link

Output Wolud be Like  :
 eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether ************** brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    2678182283 128577828 0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    2975718768 1018068068 0       0       0       0

3. sar -n DEV 1 1

Output Wolud be Like  :

Linux 2.6.32-220.17.1.el6.x86_64 (Hostname )       04/21/2014      _x86_64_        (8 CPU)

04:07:39 PM     IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
04:07:40 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
04:07:40 PM      usb0      0.00      0.00      0.00      0.00      0.00      0.00      0.00
04:07:40 PM      eth1      1.03      0.00      0.07      0.00      0.00      0.00      0.00
04:07:40 PM      eth0      6.19      3.09      0.51      0.44      0.00      0.00      0.00
04:07:40 PM      eth2      3.09      1.03      0.24      0.11      0.00      0.00      0.00
04:07:40 PM      eth3    642.27    821.65    187.95    505.15      0.00      0.00      0.00
04:07:40 PM     bond0    645.36    822.68    188.19    505.25      0.00      0.00      0.00

Average:        IFACE   rxpck/s   txpck/s    rxkB/s    txkB/s   rxcmp/s   txcmp/s  rxmcst/s
Average:           lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:         usb0      0.00      0.00      0.00      0.00      0.00      0.00      0.00
Average:         eth1      1.03      0.00      0.07      0.00      0.00      0.00      0.00
Average:         eth0      6.19      3.09      0.51      0.44      0.00      0.00      0.00
Average:         eth2      3.09      1.03      0.24      0.11      0.00      0.00      0.00
Average:         eth3    642.27    821.65    187.95    505.15      0.00      0.00      0.00
Average:        bond0    645.36    822.68    188.19    505.25      0.00      0.00      0.00

Hope  this command will help .U can also used nmon  analyzer  for Graphical view .

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Meredith Courtemanche
    You can also check out some basics on Linux layer 2 network performance tuning in this article by Tony Mancill: http://searchenterpriselinux.techtarget.com/tip/Remedial-network-performance-tuning-101. Slow response times can come from problems with auto-negotiation, not the application or the hardware itself.
    1,030 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following