netstat -i和netstat -s平时感觉不是经常用到,有点陌生,学习一下。

netstat -i 打印网络接口信息

[root@localhost ~]# netstat -i
Kernel Interface table
Iface      MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
ens33     1500     2114      0      0 0           909      0      0      0 BMRU
lo       65536        0      0      0 0             0      0      0      0 LRU

Iface:网络接口名称

MTU:最大传输单元

RX-OK:接收时,正确的数据包数

RX-ERR:接收时,产生错误的数据包数

RX-DRP:接收时,丢弃的数据包数

RX-OVR:接收时,由于过速而丢失的数据包数

TX-OK:发送时,正确的数据包数

TX-ERR:发送时,产生错误的数据包数

TX-DRP:发送时,丢弃的数据包数

TX-OVR:发送时,由于过速而丢失的数据包数

Flg:标志

         B  已经设置了一个广播地址

         L 该接口是一个回送设备

         M 接收所有的数据包(混乱模式)

         N 避免跟踪

         O 在该接口上,禁用ARP

         P 这是一个点到点连接

         R 接口正在运行

         U 接口处于"活动"状态

netstat -s  按照各个协议分别显示其统计数据

[root@localhost ~]# netstat -s
Ip:
    1943 total packets received
    0 forwarded
    0 incoming packets discarded
    1103 incoming packets delivered
    835 requests sent out
    16 dropped because of missing route
Icmp:
    1 ICMP messages received
    1 input ICMP message failed.
    ICMP input histogram:
        echo requests: 1
    6 ICMP messages sent
    0 ICMP messages failed
    ICMP output histogram:
        destination unreachable: 6
IcmpMsg:
        InType8: 1
        OutType3: 6
Tcp:
    1 active connections openings
    1 passive connection openings
    0 failed connection attempts
    1 connection resets received
    1 connections established
    959 segments received
    673 segments send out
    0 segments retransmited
    0 bad segments received.
    0 resets sent
Udp:
    143 packets received
    0 packets to unknown port received.
    0 packet receive errors
    156 packets sent
    0 receive buffer errors
    0 send buffer errors
UdpLite:
TcpExt:
    5 delayed acks sent
    1 packets directly queued to recvmsg prequeue.
    1 bytes directly received in process context from prequeue
    865 packet headers predicted
    24 acknowledgments not containing data payload received
    41 predicted acknowledgments
    TCPRcvCoalesce: 15
    TCPOrigDataSent: 72
IpExt:
    InNoRoutes: 3
    InMcastPkts: 22
    InBcastPkts: 365
    InOctets: 1157801
    OutOctets: 55171
    InMcastOctets: 704
    InBcastOctets: 51754
    InNoECTPkts: 1943