1、用什么软件抓包
2、远程抓包怎配置,直接在交换机上抓包怎么配置。
(0)
最佳答案
可以在端口配置端口镜像并抓包,以下是本地端口镜像的配置命令:
[H3C]sysname SW1
[SW1]mirroring-group 1 local //创建本地镜像组、组号为1
[SW1]mirroring-group 1 mirroring-port GigabitEthernet 1/0/2 both //指定镜像口,监控进出流量
[SW1]mirroring-group 1 monitor-port GigabitEthernet 1/0/1 //指定监控口
[SW1]dis mirroring-group all //查看镜像组信息
Mirroring group 1:
Type: Local //本地镜像
Status: Active //镜像状态为激活
Mirroring port:
GigabitEthernet1/0/2 Both
Monitor port: GigabitEthernet1/0/1
或者使用交换机的报文捕获功能,以下是配置举例:
在Switch A的Ten-GigabitEthernet1/0/1接口上开启报文捕获功能。配置捕获接口Ten-GigabitEthernet1/0/1入方向上的硬件转发与软件转发报文。
# 创建IPv4高级ACL 3000,并定制如下规则:只捕获源IP为192.168.56.1的报文。
<SwitchA> system-view
[SwitchA] acl number 3000
[SwitchA-acl-adv-3000] rule permit ip source 192.168.56.1 0
[SwitchA-acl-adv-3000] quit
# 定义流行为behavior1,配置流量镜向到CPU。
[SwitchA] traffic behavior behavior1
[SwitchA-behavior-behavior1] mirror-to cpu
[SwitchA-behavior-behavior1] quit
# 定义类classifier1,匹配ACL3000。
[SwitchA] traffic classifier classifier1
[SwitchA-classifier-class1] if-match acl 3000
[SwitchA-classifier-class1] quit
# 定义一个名为user1的策略,并在策略user1中为类classifier1指定采用流行为behavior1。
[SwitchA] qos policy user1
[SwitchA-qospolicy-user1] classifier classifier1 behavior behavior1
[SwitchA-qospolicy-user1] quit
#将策略user1应用到接口Ten-GigabitEthernet1/0/1的入方向上。
[SwitchA] interface ten-gigabitethernet 1/0/1
[SwitchA-Ten-GigabitEthernet1/0/1] qos apply policy user1 inbound
[SwitchA-Ten-GigabitEthernet1/0/1] quit
# 开启Ten-GigabitEthernet1/0/1接口上的报文捕获功能,捕获软硬件转发报文。
[SwitchA] packet-capture interface ten-gigabitethernet 1/0/1
Capturing on 'Ten-GigabitEthernet1/0/1'
1 0.000000 192.168.56.1 -> 192.168.56.2 TCP 62 6325 > telnet [SYN] Seq=0 Win
=65535 Len=0 MSS=1460 SACK_PERM=1
2 0.000061 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=1 Ack
=1 Win=65535 Len=0
3 0.024370 192.168.56.1 -> 192.168.56.2 TELNET 60 Telnet Data ...
4 0.024449 192.168.56.1 -> 192.168.56.2 TELNET 78 Telnet Data ...
5 0.025766 192.168.56.1 -> 192.168.56.2 TELNET 65 Telnet Data ...
6 0.035096 192.168.56.1 -> 192.168.56.2 TELNET 60 Telnet Data ...
7 0.047317 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=42 Ac
k=434 Win=65102 Len=0
8 0.050994 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=42 Ac
k=436 Win=65100 Len=0
9 0.052401 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=42 Ac
k=438 Win=65098 Len=0
10 0.057736 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=42 Ac
k=440 Win=65096 Len=0
10 packets captured
在DeviceA的Ten-GigabitEthernet1/0/1接口上开启报文捕获功能,配置捕获报文的个数为10个,配置将捕获的报文存入文件a.pcap。
配置捕获报文完成后,开启解析a.pcap报文文件。
# 开启Ten-GigabitEthernet1/0/1接口上的报文捕获功能,指定捕获报文个数上限为10,指定捕获的报文存入文件a.pcap。
<DeviceA> packet-capture interface ten-gigabitethernet 1/0/1 limit-captured-frames 10 write flash:/a.pcap
Capturing on 'Ten-GigabitEthernet1/0/1'
10
# 开启报文解析功能,指定解析的完整文件名为flash:/a.pcap。
<DeviceA> packet-capture read flash:/a.pcap
1 0.000000 192.168.56.1 -> 192.168.56.2 TCP 62 6325 > telnet [SYN] Seq=0 Win
=65535 Len=0 MSS=1460 SACK_PERM=1
2 0.000061 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=1 Ack
=1 Win=65535 Len=0
3 0.024370 192.168.56.1 -> 192.168.56.2 TELNET 60 Telnet Data ...
4 0.024449 192.168.56.1 -> 192.168.56.2 TELNET 78 Telnet Data ...
5 0.025766 192.168.56.1 -> 192.168.56.2 TELNET 65 Telnet Data ...
6 0.035096 192.168.56.1 -> 192.168.56.2 TELNET 60 Telnet Data ...
7 0.047317 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=42 Ac
k=434 Win=65102 Len=0
8 0.050994 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=42 Ac
k=436 Win=65100 Len=0
9 0.052401 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=42 Ac
k=438 Win=65098 Len=0
10 0.057736 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=42 Ac
k=440 Win=65096 Len=0
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论