linux怎么看网卡日志,查看网卡信息及状态和网卡日志信息

查看网卡信息

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          UPBROADCAST 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    实时查看网卡流量

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值