esxi上抓虚拟机的网络数据包

#查看虚拟机虚拟机 world id
esxcli network vm list

image-20250108152833110

#查看虚拟机网卡信息port id
esxcli network vm port list -w 2266295

image-20250108152900085

#开始抓包网卡所有流量
pktcap-uw --switchport <port ID> --outfile /vmfs/volumes/datastore1/capture.pcap

#开始抓包网卡单项流量  --dir 1  为出站   --dir 0 为入站  --dir 2 为双向
pktcap-uw --switchport <port ID> --dir 1 --outfile /vmfs/volumes/datastore1/capture_out.pcap


#其他抓包方式

pktcap-uw --switchport <port ID> --ip 192.168.1.100 --outfile /vmfs/volumes/datastore1/ip_filter.pcap

pktcap-uw --switchport <port ID> --tcpport 80 --outfile /vmfs/volumes/datastore1/port80.pcap


pktcap-uw --switchport <port ID> --vlan 10 --outfile /vmfs/volumes/datastore1/vlan10.pcap

pktcap-uw --switchport <port ID> --ip 192.168.1.100 --tcpport 443 --outfile /vmfs/volumes/datastore1/filtered.pcap


pktcap-uw --switchport <port ID> --rcf "tcp[13] & 7 != 0" --outfile /vmfs/volumes/datastore1/tcpflags.pcap

文章作者: Stars
版权声明: 本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Stars
默认分类 network
喜欢就支持一下吧