当前位置:   article > 正文

交换机系列(亲测有效):思科|锐捷|迈普|华为|华三等常见厂商交换机端口镜像配置命令详细说明以及【案例分享】H3C设备配置端口镜像_h3c端口镜像配置命令

h3c端口镜像配置命令




思科|锐捷|迈普|华为|华三等常见厂商交换机端口镜像配置命令详细说明以及【案例分享】H3C设备配置端口镜像

1、H3C交换机网络设备镜像端口配置

命令格式:

mirroring-group 1 local 本地镜像组 1
  • 1
mirroring-group 1 mirroring-port 源端端口 流量方向【入口input、出口ouput、双向both】
  • 1
mirroring-group 1 monitor-port 目的端口
  • 1

示例:

【创建本地镜像组 1】
mirroring-group 1 local 本地镜像组 1
  • 1
【在本地镜像组1将 G1/0/1 设成镜像源端口,both为双向流量】
mirroring-group 1 mirroring-port GigabitEthernet 1/0/1 both
  • 1

取消配置

undo mirroring-group 1 mirroring-port GigabitEthernet 1/0/1 both
  • 1
【在本地镜像组1将 G1/0/2 设成镜像源端口,both为双向流量】
mirroring-group 1 mirroring-port GigabitEthernet 1/0/2 both
  • 1

取消配置

undo mirroring-group 1 mirroring-port GigabitEthernet 1/0/2 both
  • 1
【在本地镜像组1将 G1/0/32 设成镜像目的端口,镜像上面G1/0/1和G1/0/32的流量】
mirroring-group 1 monitor-port GigabitEthernet 1/0/32
  • 1

取消配置

undo mirroring-group 1 monitor-port GigabitEthernet 1/0/32
  • 1
disp cu查看源端口配置信息
源端口G1/0/1
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan all
mirroring-group 1 mirroring-port both
  • 1
  • 2
  • 3
  • 4
  • 5
源端口G1/0/2
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan all
mirroring-group 1 mirroring-port both
  • 1
  • 2
  • 3
  • 4
  • 5
目的端口G1/0/32截图
interface GigabitEthernet1/0/32
port link-mode bridge
mirroring-group 1 monitor-port
  • 1
  • 2
  • 3

2、思科|锐捷|迈普交换机网络设备镜像端口配置

命令格式:

monitor session 1 filter packet-type good rx 创建session1组、并指定端口流量方向
  • 1
monitor session 1 source interface 镜像源端口 流量方向【入口rx、出口tx、双向both】
  • 1
monitor session 1 destination interface  目的端口 流量方向【入口rx、出口tx、双向both】
  • 1

示例:

monitor session 1 source interface g1/0/1 rx
  • 1

(上述命令的意思是将g1/0/1端口作为镜像源端口,后面的rx是入口方向流量,如果需要出口方向流量,将rx改成tx即可,如果业务环境不是特别清楚,写both也行,both代表双向流量;)

monitor session 1 destination interface g1/0/2
  • 1

(上述命令的意思是将g1/0/2端口作为镜像目的端口)

monitor session 1 filter packet-type good rx
  • 1

(上述命令的意思是指定session 1 组的流量方向)

【Tx指上行(传出),Rx指下行(传入),both指双向流量】

show monitor session 1
  • 1

(上述命令的意思是通过show 命令查看session 1的配置)

3、华为交换机网络设备镜像端口配置

【华为的交换机配置镜像端口与之前的可能不太一样,需要进入到接口模式】

【部分华为网络设备也可以使用华三的配置命令、如果不行,请尝试以下配置方法】

命令格式:

int 10ge 端口名称  (进入接口)
  • 1
ort-mirroring observe-port 1 inbound(设置为镜像源端口)
  • 1
observe-port 1 interface 10ge 端口名称(设置为镜像目的端口)
  • 1

示例:

int 10ge1/0/9 (源端口)
  • 1
port-mirroring observe-port 1 inbound
  • 1

(上述命令的意思是将ge1/0/9作为镜像源端口)

observe-port 1 interface 10ge 1/0/2 配置本地观察端口(目的端口)
  • 1
commit
  • 1

(上述命令的意思是将ge1/0/2作为镜像目的端口)

display observe-port
  • 1
display port-mirroring
  • 1

(上述命令的意思是配置完可通disp命令进行查看)

4. 【案例分享】H3C设备配置端口镜像

简介

本案例介绍本地端口镜像的配置方法。

组网需求

某公司内部各部门使用不同网段的IP地址,其中研发部使用10.1.1.0/24网段,市场部使用12.1.1.0/24网段。现要求通过配置本地端口镜像功能,使用数据监测设备对研发部和市场部访问Internet的流量以及两个部门之间互访的流量进行监控。

在这里插入图片描述

图1 本地端口镜像配置组网图

配置注意事项

  • · 本地镜像组需要配置源端口、目的端口才能生效。其中目的端口不能是现有镜像组的成员端口。

  • · 目的端口收到的报文包括复制自源端口的报文和来自其他端口的正常转发报文。为了保证数据监测设备只对源端口的报文进行分析,请将目的端口只用于端口镜像,不作其他用途。

配置步骤

# 配置GigabitEthernet1/0/1接口IP地址为10.1.1.1/24,连接研发部设备。
<DeviceA> system-view
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] port link-mode route
[DeviceA-GigabitEthernet1/0/1] ip address 10.1.1.1 24
[DeviceA-GigabitEthernet1/0/1] quit
# 配置GigabitEthernet1/0/2接口IP地址为12.1.1.1/24,连接市场部设备。
<DeviceA> system-view
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] port link-mode route
[DeviceA-GigabitEthernet1/0/2] ip address 12.1.1.1 24
[DeviceA-GigabitEthernet1/0/2] quit
# 配置GigabitEthernet1/0/4接口IP地址为56.56.56.5/24。
<DeviceA> system-view
[DeviceA] interface gigabitethernet 1/0/4
[DeviceA-GigabitEthernet1/0/4] port link-mode route
[DeviceA-GigabitEthernet1/0/4] ip address 56.56.56.5 24
[DeviceA-GigabitEthernet1/0/4] quit
# 创建本地镜像组。
[DeviceA] mirroring-group 1 local
# 将GigabitEthernet1/0/1和GigabitEthernet1/0/2配置为镜像源端口,对这两个端口接收的报文进行镜像。
[DeviceA] mirroring-group 1 mirroring-port gigabitethernet 1/0/1 gigabitethernet 1/0/2 inbound
# 将GigabitEthernet1/0/3配置为镜像目的端口。
[DeviceA] mirroring-group 1 monitor-port gigabitethernet 1/0/3
# 关闭目的端口GigabitEthernet1/0/3上的生成树协议。
[DeviceA] interface gigabitethernet 1/0/3
[DeviceA-GigabitEthernet1/0/3] undo stp enable
[DeviceA-GigabitEthernet1/0/3] quit
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28

验证配置

# 在完成上述配置后,在Device A上显示镜像组1的配置信息。
[DeviceA] display mirroring-group 1
Mirroring group 1:
Type: Local
Status: Active
Mirroring port:
GigabitEthernet1/0/1  Inbound
GigabitEthernet1/0/2  Inbound
Monitor port: GigabitEthernet1/0/32
# 以研发部某台主机10.1.1.2通过ping方式访问56.56.56.6为例,进行镜像测试,数据监测设备的抓包数据如图2所示。本例以Wireshark网络封包分析软件的显示为例。
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

在这里插入图片描述
以上抓包信息表明,配置的本地镜像功能生效,数据监测设备可以成功对需要监控的流量进行监控

配置文件

mirroring-group 1 local
interface GigabitEthernet1/0/1
port link-mode route
ip address 10.1.1.1 255.255.255.0
mirroring-group 1 mirroring-port inbound
#
interface GigabitEthernet1/0/2
port link-mode route
ip address 12.1.1.1 255.255.255.0
mirroring-group 1 mirroring-port inbound
#
interface GigabitEthernet1/0/3
port link-mode bridge
undo stp enable
mirroring-group 1 monitor-port
#
interface GigabitEthernet1/0/4
port link-mode route
ip address 56.56.56.5 255.255.255.0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19







hh_0211

思科|锐捷|迈普|华为|华三等常见厂商交换机端口镜像配置命令详细说明

微思网络

【案例分享】H3C设备配置端口镜像

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/400601
推荐阅读
相关标签
  

闽ICP备14008679号