Linux系统小工具使用大用途---1

现在Linux平台下各种管理工具非常多,有的功能强大块头也不小,有的功能可以满足一般需求且块头很小,我自己一般比较喜欢后者。在这个系列文章中将给大家介绍一些我知道的Linux中的一些小工具,也欢迎大家来补充。

这篇先介绍几个网络测试的小工具:

一、ethtool:查看网卡工作模式

testsrv:~# ethtool eth0

Settings for eth0:

        Supported ports: [ TP MII ]

#说明eth010baseT100baseT1000baseT 三种选择。

        Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Half 1000baseT/Full

        Supports auto-negotiation: Yes

        Advertised link modes:  10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

                                1000baseT/Half 1000baseT/Full

        Advertised auto-negotiation: Yes

#目前正工作在1000baseT 模式。

        Speed: 1000Mb/s    

#全双功。

        Duplex: Full

        Port: MII

        PHYAD: 0

        Transceiver: internal

        Auto-negotiation: on

        Supports Wake-on: pumbg

        Wake-on: g

        Current message level: 0x00000033 (51)

        Link detected: yes

二、iptraf:查看本机网络吞吐量

testsrv:~# iptraf -d eth0

三、iperf:详细查看本机网络吞吐量。

iperf是一个C/S模式的小工具,也就是说要使用该功能时,必须2台被测试计算机,其中1台运行iperf的服务,在另1台上使用iperf查看网络吞吐量。在选择iperf服务的计算机使用iperf -D -s启动iperf所需服务后,在另1台计算机上使用如下命令即可查看网络吞吐量。

#10秒进行一次测试,共测试60秒时间。

testsrv:~# iperf -c 192.168.1.254 -t 60 -i 10

------------------------------------------------------------

Client connecting to 192.168.1.254, TCP port 5001

TCP window size: 16.0 KByte (default)

------------------------------------------------------------

[  3] local 192.168.1.253 port 41960 connected with 192.168.1.254 port 5001

[ ID] Interval       Transfer     Bandwidth

[  3]  0.0-10.0 sec  1.08 GBytes    926 Mbits/sec

[  3] 10.0-20.0 sec  1.08 GBytes    926 Mbits/sec

[  3]  0.0-28.9 sec  3.11 GBytes    925 Mbits/sec

当然还有tcpdump tcptrace 这样提供更细致的分析方法,一般可以用 tcpdump 按要求捕获数据包并把结果保存到一个文件中,然后使用用tcptrace分析其文件格式。这个工具组合可以提供一些难以用其他工具发现的信息

 

你可能感兴趣的:(linux,iptraf,iperf,netperf,onlyzq)