如何在H3C交換機上抓包?
在華三交換機上可使用:packet-capture 命令,在用戶視圖下執行。
具體操作可查看這:https://www.h3c.com/cn/d_202009/1327093_30005_0.htm
#做流統匹配抓包流量 acl advanced 3000 description test rule 0 permit ip source 192.168.1.1 0 destination 192.168.2.1 0 traffic classifier class_test operator and if-match acl 3000 # traffic behavior behavior_test accounting packet # 做流量統計 mirror-to cpu # 鏡像到CPU,必須鏡像到CPU才能抓包 # qos policy policy_test classifier class_test behavior behavior_test # interface Ten-GigabitEthernet1/3/1 qos apply policy policy_test inbound packet-capture local interface Ten-GigabitEthernet 1/3/1 autostop filesize 50000 write flash:/isp1.cap packet-capture stop # 及時停止。
需要注意的幾點:
抓包時盡量使用acl匹配精確的流在traffic behavior中,必須配置流量鏡向到CPU。mirror-to cpu, 否則不能抓到包。抓包時做好文件大小限制,autostop filesze 50000, 因為交換機的硬盤都很小,防止把交換機硬盤打滿。抓包時盡量選擇流量低峰期。配置accounting packet 流量統計后,可通過display qos policy interface 查看匹配情況。
回答所涉及的環境:聯想天逸510S、Windows 10。
在華三交換機上可使用:packet-capture 命令,在用戶視圖下執行。
具體操作可查看這:https://www.h3c.com/cn/d_202009/1327093_30005_0.htm
需要注意的幾點:
抓包時盡量使用acl匹配精確的流
在traffic behavior中,必須配置流量鏡向到CPU。mirror-to cpu, 否則不能抓到包。
抓包時做好文件大小限制,autostop filesze 50000, 因為交換機的硬盤都很小,防止把交換機硬盤打滿。
抓包時盡量選擇流量低峰期。
配置accounting packet 流量統計后,可通過display qos policy interface 查看匹配情況。
回答所涉及的環境:聯想天逸510S、Windows 10。