admin管理员组文章数量:1565292
目录
前言
H3C交换机抓包:
H3C简单FTP上传和下载文件
流镜像配置命令
2.1.1 mirror-to cpu
2.1.2 mirror-to interface
相关命令
更多ACL例子
ACL显示和维护
删除ACL
删除规则
删除classer
清楚统计信息
H3C交换机文档下载地址
前言
术语:
ACL:
访问控制列表(Access Control Lists,ACL)是作用在路由器接口的指令列表,用来告诉路由器哪些数据包可以收、哪些数据包需要拒绝。
至于数据包是被接收还是拒绝,可以由类似于源地址、目的地址、端口号等的特定指示条件来决定。 [2]
(访问控制列表_百度百科)
查看设备版本信息:
# 查看设备的版本信息,准备和设备当前运行的Boot包、System包兼容的Packet Capture特性软件包。
<Device> display version
H3C交换机抓包:
摘自:如何在交换机上抓包 | https://cshihong.github.io/2020/11/20/%E5%A6%82%E4%BD%95%E5%9C%A8%E4%BA%A4%E6%8D%A2%E6%9C%BA%E4%B8%8A%E6%8A%93%E5%8C%85/
在华三交换机上可使用:packet-capture 命令,在用户视图下执行。
H3C官方教程:
18-Packet Capture配置-https://www.h3c/cn/d_202009/1327093_30005_0.htm
18-Packet Capture配置-https://www.h3c/cn/d_202009/1327093_30005_0.htm#_Toc49527163
个人实践:
相关命令:查看端口
display interface
1、先停止抓包:
packet-capture stop
2、进入系统视图:sys
<Device> sys
#做流量匹配抓包:acl H3C高级ACL的应用_http://blog.sina/s/blog_165c04adb0102yens.html
3、创建高级acl (记得先删除之前创建的--方法见文章末尾,或者取别号码,3001等)
acl advanced 3000
description test
#rule 0 permit ip source 192.168.1.1 0 destination 192.168.2.1 0rule 0 deny ip destination 172.16.30.0 0.0.0.255 #禁止访问30段,允许其它
rule 5 permit ip #允许所有IP数据
#rule 10 permit source-mac xxxx-xxxx-xxxx #过滤mac,运行源macxxxx-xxxx-xxxx的数据
4、 定义类classifier1,匹配ACL3000。
traffic classifier class_test operator and
if-match acl 3000
#流量分类器 C2 算子 如果匹配ACL 3002(#traffic classifier c2 operator and if-match acl 3002)
#定义一个类,名为c2;报文只有匹配了访问控制列表acl 3002的规则,设备才认为报文属于这个类5、 定义流的行为behavior_test,做流量统计和配置流量镜向到CPU。
traffic behavior behavior_test
accounting packet # 做流量统计
mirror-to cpu # 镜像到CPU,必须镜像到CPU才能抓包6、定义一个名为policy_test的策略,并在策略policy_test中为类class_test 指定采用流行为behavior_test
qos policy policy_test
classifier class_test behavior behavior_test
7、# 将策略policy_test 应用到接口 HundredGigE1/0/4的入方向上。
interface HundredGigE1/0/4
qos apply policy policy_test inbound
7、检查配置状况:
display qos policy interface
8、退出系统视图Ctrl+Z
9、启动抓包
packet-capture local interface HundredGigE1/0/4 autostop filesize 50000 write flash:/isp1.cap
#packet-capture local interface HundredGigE1/0/4 autostop filesize 50000 write flash:/isp4.cap
packet-capture stop # 及时停止。
远程抓包:packet-capture remote interface HundredGigE1/0/4 port 2014
需要注意的几点:
- 抓包时尽量使用acl匹配精确的流
- 在traffic behavior中,必须配置流量镜向到CPU。mirror-to cpu, 否则不能抓到包。
- 抓包时做好文件大小限制,autostop filesze 50000, 因为交换机的硬盘都很小,防止把交换机硬盘打满。
- 抓包时尽量选择流量低峰期。
- 配置accounting packet 流量统计后,可通过display qos policy interface 查看匹配情况。
packet
版权声明:本文标题:【网络】新华三H3C交换机 抓包|H3C交换机文档 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1725661787a1035416.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论