linux----之tcpdump小用

1、通过抓包大致确定访问量

#time tcpdump -nn -i eth0 'tcp[tcpflags] = tcp-syn' -c 10000 >/dev/null

根据real时间判断访问量,如果这个值很小,说明访问量比较大。

2、通过tcpdump抓包分析Ethernet-ip-tcp-udp

  • TCP包结构 - [ ETHERNET头 [ IP头 [ TCP头 [ DATA ] ] ] ]
  • UDP包结构 - [ ETHERNET头 [ IP头 [ UDP头 [ DATA ] ] ] ]

#tcpdump -i eth0 port 80 -xx

原文地址:https://www.cnblogs.com/cuishuai/p/8026737.html