Wireshark 捕获过滤语句
基于IP地址过滤
host 192.168.1.1 过滤IP地址
基于网段地址过滤
net 172.16.0.0/16 过滤网段
dst net 172.16.0.0/16 过滤目的网段
src net 172.16.0.0/16 过滤源网段
not dst net 172.16.0.0/16 过滤除这个网段数据包
基于MAC地址过滤
ether host aa:aa:aa:aa:aa:aa 过滤MAC地址
ether src aa:aa:aa:aa:aa:aa 过滤MAC地址
ether dst aa:aa:aa:aa:aa:aa 过滤MAC地址
not ether host aa:aa:aa:aa:aa:aa 排除指定MAC地址
基于广播和组播过滤
ip broadcast 过滤广播地址
ip multicast 过滤组播流量
基于端口进程过滤
port 53 过滤基于TCP/UDP的端口号53
not port 排除指定的基于TCP/UDP的端口号53
tcp port 80 过滤基于tcp的80端口
udp port 67 过滤基于udp的67端口
portrange 1-80 过滤TCP/UDP的1-80端口号
tcp portrange 1-80 过滤TCP的1-80端口号
基于端口的组合过滤
port 20 or port 21 过滤TPC/UDP的20和21端口
host 192.168.1.1 and port 80 过滤来自主机192.168.1.1的TCP/UDP的80端口
host 192.168.1.1 and not port 80 过滤来自主机192.168.1.1的TCP/UDP的非80端口
udp src port 68 and udp dst port 67 过滤udp源端口68和目的端口67的数据
基于ICMP过滤
icmp 过滤ICMP数据
icmp[0]=8 过滤所有ICMP字段为8的数据包(Echo Request)
icmp[0]=8 or icmp[0]=0 过滤icmp字段为8和0的数据包(Echo Request和Echo Replay)