• 全部
  • 经验案例
  • 典型配置
  • 技术公告
  • FAQ
  • 漏洞说明
  • 全部
  • 全部
  • 大数据引擎
  • 知了引擎
产品线
搜索
取消
案例类型
发布者
是否解决
是否官方
时间
搜索引擎
匹配模式
高级搜索

s5560x-ei

2021-11-19提问
  • 0关注
  • 1收藏,861浏览
粉丝:1人 关注:0人

问题描述:

设备能不能本地抓包,web页面有没有能抓的地方


最佳答案

粉丝:178人 关注:0人

您好,参考

1.9  Packet Capture典型配置举例

1.9.1  报文捕获配置举例

1. 组网需求

在设备的二层接口GigabitEthernet1/0/1上开启报文捕获功能。配置捕获接口GigabitEthernet1/0/1入方向上的硬件转发与软件转发报文。

2. 配置步骤

# 查看设备的版本信息,准备和设备当前运行的Boot包、System包兼容的Packet Capture特性软件包。

<Device> display version

H3C Comware Software, Version 7.1.070, Demo 01

Copyright (c) 2004-2017 New H3C Technologies Co., Ltd. All rights reserved.

H3C Device uptime is 0 weeks, 0 days, 5 hours, 33 minutes

Last reboot reason : Cold reboot

Boot image: flash:/boot-01.bin

Boot image version: 7.1.070, Demo 01

  Compiled Oct 20 2016 16:00:00

System image: flash:/system-01.bin

System image version: 7.1.070, Demo 01

  Compiled Oct 20 2016 16:00:00

其它显示信息略……。

# 从IP地址为192.168.1.26的TFTP服务器上下载Packet Capture特性软件包flash:/packet-capture-01.bin。

<Device> tftp 192.168.1.26 get packet-capture-01.bin

Press CTRL+C to abort.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100 11.3M    0 11.3M    0     0   155k      0 --:--:--  0:01:14 --:--:--  194k

Writing file...Done.

# 给IRF中的所有成员设备(此处以slot 1和slot 2为例)都安装Packet Capture特性软件包,并让该软件包在设备重启后能够继续生效。

<Device> install activate feature flash:/packet-capture-01.bin slot 1

Verifying the file flash:/packet-capture-01.bin on slot 1....Done.            

Identifying the upgrade methods....Done.                                       

Upgrade summary according to following table:                                   

                                                                               

flash:/packet-capture-01.bin                              

  Running Version             New Version                                      

  None                        Demo 01                                  

                                                                               

  Slot                        Upgrade Way                                      

  1                           Service Upgrade                                  

Upgrading software images to compatible versions. Continue? [Y/N]:y            

This operation might take several minutes, please wait....................Done.

<Device> install activate feature flash:/packet-capture-01.bin slot 2

Verifying the file flash:/packet-capture-01.bin on slot 2....Done.            

Identifying the upgrade methods....Done.                                       

Upgrade summary according to following table:                                   

                                                                               

flash:/packet-capture-01.bin                              

  Running Version             New Version                                      

  None                        Demo 01                                  

                                                                               

  Slot                        Upgrade Way                                      

  2                           Service Upgrade                                  

Upgrading software images to compatible versions. Continue? [Y/N]:y            

This operation might take several minutes, please wait....................Done.

<Device> install commit

This operation will take several minutes, please wait.......................Done.

# 创建IPv4高级ACL 3000,并定制如下规则:只捕获源IP为192.168.56.1的报文。

<Device> system-view

[Device] acl advanced 3000

[Device-acl-ipv4-adv-3000] rule permit ip source 192.168.56.1 0

[Device-acl-ipv4-adv-3000] quit

# 定义流行为behavior1,配置流量镜向到CPU。

[Device] traffic behavior behavior1

[Device-behavior-behavior1] mirror-to cpu

[Device-behavior-behavior1] quit

# 定义类classifier1,匹配ACL3000。

[Device] traffic classifier classifier1

[Device-classifier-class1] if-match acl 3000

[Device-classifier-class1] quit

# 定义一个名为user1的策略,并在策略user1中为类classifier1指定采用流行为behavior1。

[Device] qos policy user1

[Device-qospolicy-user1] classifier classifier1 behavior behavior1

[Device-qospolicy-user1] quit

# 将策略user1应用到接口GigabitEthernet1/0/1的入方向上。

[Device] interface gigabitethernet 1/0/1

[Device-GigabitEthernet1/0/1] qos apply policy user1 inbound

[Device-GigabitEthernet1/0/1] quit

[Device] quit

# 重新登录设备,以便能够执行packet-capture命令行。

# 开启GigabitEthernet1/0/1接口上的报文捕获功能,指定捕获报文个数上限为10,指定捕获的报文存入文件a.pcap。

<Device> packet-capture interface gigabitethernet 1/0/1 limit-captured-frames 10 write flash:/a.pcap

Capturing on 'GigabitEthernet1/0/1'

10

3. 验证配置

# 在设备上解析报文文件flash:/a.pcap。

<Device> 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 Ack=434 Win=65102 Len=0

  8   0.050994 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=42 Ack=436 Win=65100 Len=0

  9   0.052401 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=42 Ack=438 Win=65098 Len=0

 10   0.057736 192.168.56.1 -> 192.168.56.2 TCP 60 6325 > telnet [ACK] Seq=42 Ack=440 Win=65096 Len=0

 

暂无评论

1 个回答
粉丝:22人 关注:11人

只有镜像抓包

暂无评论

编辑答案

你正在编辑答案

如果你要对问题或其他回答进行点评或询问,请使用评论功能。

分享扩散:

提出建议

    +

亲~登录后才可以操作哦!

确定

亲~检测到您登陆的账号未在http://hclhub.h3c.com进行注册

注册后可访问此模块

跳转hclhub

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作

举报

×

侵犯我的权益 >
对根叔社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 pub.zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明