查看网卡信息

1-mii-tool [-v/w] em1/em2/l0

    em1: negotiated 100baseTx-FD, link ok
  product info: vendor 00:aa:00, model 57 rev 1
  basic mode:   autonegotiation enabled
  basic status: autonegotiation complete, link ok
  capabilities: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
  link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD

    

mii-tool工具一定要指定网卡,不能查全部。


2- ifconfig /ifconfig -a

     eth0  Link encap:Ethernet HWaddr 00:09:6B:09:08:FC 
         inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
         inet6 addr: fe80::209:6bff:fe09:8fc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
         RX packets:106732953 errors:0 dropped:0 overruns:0 frame:0
         TX packets:104379788 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:100 
         RX bytes:2351331877 (2.1 GiB) TX bytes:391707945 (373.5 MiB)
         Base address:0x2500 Memory:fbfe0000-fc000000 
  eth1   Link encap:Ethernet HWaddr 00:09:6B:09:08:FD 
          BROADCAST MULTICAST MTU:1500 Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000 
         RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
         Base address:0x2540 Memory:fbfc0000-fbfe0000


3- ethtool em1/em2/l0 查看指定网卡状态

    \Settings for em1:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
    Supported pause frame use: Symmetric
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes
    Speed: 100Mb/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

4- sar工具,清楚看到网卡带宽是否打满,监控网络流量

    sar -n DEV/EDEV/NFS/NFSD/SOCK/ALL

    sar -n DEV (统计时间) (统计次数) :sar -n DEV 1 4(监控网络流量)

    sar-n显示网络信息,DEV显示网络接口信息,EDEV显示网络错误的统计数据,NFS统计活动的NFS客户端信息,NFSD统计NFS服务器的信息,SOCK显示套接字信息,ALL显示所有5个开关


关注sar命令使用,统计、监控服务器信息


5-查看服务器网卡相关日志

    /var/log/messages里面有没有关于网卡的日志,有没有网卡up/down的记录

    tail -n 100 /var/log/messages |grep (em1/em2/up/down/fail)


6- iptraf

    实时查看网络流量信息文本界面工具,不自带

    centos用yum -y install iptraf安装


7-ifstat

    查看实时网络流量

8- iftop    实时查看网卡流量

    详细描述:自己博客《ifstat和iftop网络流量实时监控》