CentOS 在线收听所有内容

Pon*_*oni 2 networking

我知道 linux 上有一个本机命令,它将输出(到标准输出)与某个网络接口(无论是 eth0 等)相关的每个“事件”。
就像有tail -f <file>听文件更改一样......
我就是找不到它。

我想查看所有事件、传入的数据包,甚至是丢弃的数据包。尽可能低。在每个协议(TCP、UDP 等)中。
我认为 WireShark 有点太大了,因为我需要一些非常简单的东西来查看事件,它用于测试。

命令是什么?

cjc*_*cjc 5

正如其他人所提到的,您正在谈论 tcpdump。

还有ngrep

$ yum info ngrep
Loaded plugins: fastestmirror, priorities
Available Packages
Name       : ngrep
Arch       : i386
Version    : 1.45
Release    : 2.el5.rf
Size       : 33 k
Repo       : dag
Summary    : Realtime network grep tool
URL        : http://ngrep.sourceforge.net/
License    : GPL
Description: ngrep is grep command that works on realtime network data.
           : 
           : ngrep strives to provide most of GNU grep's common features, applying
           : them to the network layer. ngrep is a pcap-aware tool that will allow
           : you to specify extended regular or hexadecimal expressions to match
           : against data payloads of packets. It currently recognizes TCP, UDP
           : and ICMP across Ethernet, PPP, SLIP, FDDI, Token Ring and null
           : interfaces, and understands bpf filter logic in the same fashion as
           : more common packet sniffing tools, such as tcpdump and snoop.
Run Code Online (Sandbox Code Playgroud)

这有点像网络流上的 grep。它不是标准包,但可以帮助您找到所需的网络流量。