Chinaunix首页 | 论坛 | 博客
  • 博客访问: 729219
  • 博文数量: 245
  • 博客积分: 10037
  • 博客等级: 上将
  • 技术积分: 2512
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-16 17:16
文章分类

全部博文(245)

文章存档

2008年(7)

2007年(238)

我的朋友

分类:

2007-04-13 01:28:22

观察TCP传输协议的联机状况:
$ netstat  -t
Active Internet connections (w/o servers)
Proto Recv-Q        Send-Q    Local Address Foreign Address   State
协议   接收队列中的  输出队列中的  本机域名:端口   远程主机:端口     联机状态
        数据量       数据量
tcp     0            0         xxx:xx        xxxx:1245      SYN_RECV


.查看目前连接中的所有Socket
$netstat -a

.显示网络联机状态, 列出IP而不用域名
$netstat -n

.列出监控中的服务器Socket
$netstat  -l

.观看网卡传送、接收数据包的状态
$ netstat  -i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500  0  14639   0      0      0    5705    119    0     0   BMRU

Iface:  网卡
RX-OK RX-ERR RX-DRP RX-OVR : 网卡正确接收数据包的数量以及发生错误、流失、碰撞的总数
TX-OK TX-ERR TX-DRP TX-OVR : 网卡正确发送数据包的数量以及发生错误、流失、碰撞的总数

.查看Routing Table的状态
# netstat -r
Kernel IP routing table

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
172.16.0.0      *               255.255.254.0   U         0 0          0 eth0
169.254.0.0     *               255.255.0.0     UH        0 0          0 eth0
default         172.16.1.254    0.0.0.0         UG        0 0          0 eth0

U激活状态
U表HOST
G表Gateway
MSS 以Byte为单位,设置数据包经过路由器的大小限制
Window   Window size
irtt     Initial Round Trip Time
Iface    网卡

.显示网络联机状况的统计表
[root@localhost ~]# netstat -s
Ip:
    21203 total packets received 全部收到的数据包数
    7401 with invalid addresses 非法地址数据包数
    0 forwarded 被转送的数据包数
    0 incoming packets discarded 被丢弃的数据包数
    13631 incoming packets delivered 收到后再传送出去的数据包数
    12776 requests sent out 送出request的次数

Icmp:
    0 ICMP messages received
    0 input ICMP message failed.
    ICMP input histogram:
    5 ICMP messages sent
    0 ICMP messages failed
    ICMP output histogram:
        destination unreachable: 5

Tcp:
    572 active connections openings
    21 passive connection openings
    0 failed connection attempts
    34 connection resets received
    2 connections established
    12271 segments received
    12141 segments send out
    13 segments retransmited
    0 bad segments received.
    201 resets sent

Udp:
    1030 packets received
    5 packets to unknown port received.
    0 packet receive errors
    604 packets sent

TcpExt:
    49 TCP sockets finished time wait in fast timer
    584 delayed acks sent
    Quick ack mode was activated 1 times
    4 packets directly queued to recvmsg prequeue.
    4 packets directly received from prequeue
    6937 packets header predicted
    1118 acknowledgments not containing data received
    1757 predicted acknowledgments
    8 congestion windows recovered after partial ack
    0 TCP data loss events
    12 other TCP timeouts
    1 DSACKs sent for old packets
    4 DSACKs received
    28 connections reset due to unexpected data
    21 connections reset due to early user close

.显示UDP传输协议的联机状况
[root@210.51.164.238 ~]$ netstat  -u
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State

阅读(901) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~