H3C S520 V3 端口流量镜像
背景:
最近公司需要采集某工业PLC设备报文,临时查询了一下如何使用H3C交换机配置流量镜像。
PLC地址: 192.168.3.213 MAC: e0:dc:a0:5c:47:2f (可通过ARP -a 查询)
采集端地址: 192.168.3.234(SSH通讯) 192.168.3.235(镜像目标端口)
登录交换机查询PLC对应的端口
通过MAC地址确认
# 切换系统视图
<inori-switch-main>system-view
# 查询所有与mac对应的地址和对应的端口
# PLC对应端口 192.168.3.213:e0dc-a05c-472f, 192.168.3.243:00d8-6197-bf20
# scada:192.168.3.102: 0:15:5d:3:37:20
[inori-switch-main]display mac-address
MAC Address VLAN ID State Port/Nickname Aging
e0dc-a05c-472f 1 Learned GE1/0/9 Y
00d8-6197-bf20 1 Learned GE1/0/9 Y
0015-5d03-3720 1 Learned GE1/0/15 Y
# 采集对应端口192.168.3.235:20:7b:d2:bc:ef:5b
207b-d2bc-ef5b 1 Learned GE1/0/7 Y
开始创建本地镜像口
# 创建镜像口 1
[inori-switch-main]mirroring-group 1 local
# 配置本地镜像组1的源端口为GE1/0/9,目的端口为GE1/0/7
[inori-switch-main]mirroring-group 1 mirroring-port gigabitethernet 1/0/9 gigabitethernet 1/0/15 gigabitethernet 1/0/11 both
[inori-switch-main]mirroring-group 1 monitor-port gigabitethernet 1/0/7
# 在目的端口GigabitEthernet1/0/7上关闭生成树协议
[inori-switch-main]interface GigabitEthernet 1/0/7
[inori-switch-main-GigabitEthernet1/0/7]undo stp enable
[inori-switch-main-GigabitEthernet1/0/7]quit
验证与查看
# 显示所有镜像组的配置信息
[inori-switch-main]display mirroring-group all
Mirroring group 1:
Type: Local
Status: Active
Mirroring port:
GigabitEthernet1/0/9 Both
GigabitEthernet1/0/15 Both
Monitor port: GigabitEthernet1/0/7
# 释义
Mirroring group 1:
Type: Local
说明这是一个本地镜像组,意味着流量的镜像操作是在本地交换机上进行的,而不是在其他交换机或远程设备上进行的。
Status: Active
表示这个镜像组当前处于活动状态,说明它正在正常工作并进行流量镜像。
Mirroring port:
GigabitEthernet1/0/9 Both
表示端口 GigabitEthernet1/0/9 被设置为镜像端口。Both 表示镜像会复制进入和离开该端口的流量。
GigabitEthernet1/0/15 Both
表示端口 GigabitEthernet1/0/15 也被设置为镜像端口,Both 同样表示镜像进入和离开该端口的流量。
Monitor port: GigabitEthernet1/0/7
这是监视端口(即镜像端口)。所有被镜像的流量都会被复制到这个端口,用于进一步的流量分析、监控或故障排查。
本文作者:樵夫-
本文链接:https://www.cnblogs.com/wesleyUP/p/18421970
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步