• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

10 网络管理和监控命令参考

目录

07-镜像命令

本章节下载 07-镜像命令  (100.49 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/E/E528[E552]/Command/Command_Manual/H3C_E528[E552]_CR-Release_1505-6W100/10/201111/731691_30005_0.htm

07-镜像命令


1 端口镜像配置命令

1.1  端口镜像配置命令

1.1.1  display mirroring-group

【命令】

display mirroring-group { group-id | all | local | remote-destination | remote-source } [ | { begin | exclude | include } regular-expression ]

【视图】

任意视图

【缺省级别】

2:系统级

【参数】

group-id:显示指定镜像组的信息。group-id表示镜像组的编号,取值范围为1~5。

all:显示所有镜像组的信息。

local:显示本地镜像组的信息。

remote-destination:显示远程目的镜像组的信息。

remote-source:显示远程源镜像组的信息。

|:使用正则表达式对显示信息进行过滤。有关正则表达式的详细介绍,请参见“基础配置指导”中的“CLI配置”。

begin:从包含指定正则表达式的行开始显示。

exclude:只显示不包含指定正则表达式的行。

include:只显示包含指定正则表达式的行。

regular-expression:表示正则表达式,为1~256个字符的字符串,区分大小写。

【描述】

display mirroring-group命令用来显示镜像组的信息。

需要注意的是:

l              不同的镜像组类型,其显示内容不同。

l              显示顺序按照镜像组的编号顺序排列。

【举例】

# 显示所有镜像组的信息。

<Sysname> display mirroring-group all

mirroring-group 1:

    type: local

    status: active

    mirroring port:

        GigabitEthernet1/0/1  both

    monitor port: GigabitEthernet1/0/2

mirroring-group 2:

    type: remote-source

    status: active

    mirroring port:

        GigabitEthernet1/0/3  inbound

    monitor egress port:

    remote-probe VLAN: 100         

表1-1  display mirroring-group命令显示信息描述表

字段

描述

mirroring-group

镜像组的编号

type

镜像组的类型:

l      local:本地镜像组

l      remote-source:远程源镜像组

l      remote-destination:远程目的镜像组

status

镜像组的状态:

l      Active:表示已经生效

l      Inactive:表示没有生效

mirroring port

镜像源端口

monitor port

镜像目的端口

remote-probe vlan

远程镜像VLAN

 

1.1.2  mirroring-group

【命令】

mirroring-group group-id { local | remote-destination | remote-source }

undo mirroring-group { group-id | all | local | remote-destination | remote-source }

【视图】

系统视图

【缺省级别】

2:系统级

【参数】

group-id:表示镜像组的编号,取值范围为1~5。

local:表示本地镜像组。

remote-destination:表示远程目的镜像组。

remote-source:表示远程源镜像组。

all:表示所有镜像组。

【描述】

mirroring-group命令用来创建一个镜像组。undo mirroring-group命令用来删除已创建的镜像组。

缺省情况下,不存在任何镜像组。

【举例】

# 创建本地镜像组1。

<Sysname> system-view

[Sysname] mirroring-group 1 local

1.1.3  mirroring-group mirroring-port

【命令】

mirroring-group group-id mirroring-port mirroring-port-list { both | inbound | outbound }

undo mirroring-group group-id mirroring-port mirroring-port-list { both | inbound | outbound }

【视图】

系统视图

【缺省级别】

2:系统级

【参数】

group-id:表示镜像组的编号,取值范围为1~5。

mirroring-port-list:源端口列表,表示多个源端口。表示方式为mirroring-port-list = { interface-type interface-number [ to interface-type interface-number ] }&<1-8>。其中,interface-type为端口类型,interface-number为端口编号。&<1-8>表示前面的参数最多可以输入8次。

both:表示对从端口收到和发出的报文都进行镜像。

inbound:表示仅对从端口收到的报文进行镜像。

outbound:表示仅对从端口发出的报文进行镜像。

【描述】

mirroring-group mirroring-port命令用来为镜像组配置源端口。undo mirroring-group mirroring-port命令用来删除镜像组的源端口。

缺省情况下,镜像组没有源端口。

需要注意的是:

l              只能为本地镜像组或远程源镜像组配置源端口,不能为远程目的镜像组配置源端口。

l              undo mirroring-group mirroring-port命令中配置的报文镜像方向(bothinboundoutbound)必须与mirroring-group mirroring-port命令中配置的报文镜像方向相同,否则执行该命令无效。

l              指定的镜像组必须存在。

相关配置可参考命令mirroring-group

【举例】

# 创建本地镜像组1,配置其源端口为GigabitEthernet1/0/1,并对从该端口收到和发出的报文都进行镜像。

<Sysname> system-view

[Sysname] mirroring-group 1 local

[Sysname] mirroring-group 1 mirroring-port gigabitethernet 1/0/1 both

# 删除镜像组1的源端口GigabitEthernet1/0/1。

<Sysname> system-view

[Sysname] undo mirroring-group 1 mirroring-port gigabitethernet 1/0/1 both

1.1.4  mirroring-group monitor-egress

【命令】

在系统视图下:

mirroring-group group-id monitor-egress monitor-egress-port

undo mirroring-group group-id monitor-egress monitor-egress-port

在以太网端口视图下:

mirroring-group group-id monitor-egress

undo mirroring-group group-id monitor-egress

【视图】

系统视图/以太网端口视图

【缺省级别】

2:系统级

【参数】

group-id:表示镜像组的编号,取值范围为1~5。

monitor-egress-port:表示出端口。表示方式为interface-type interface-number,其中,interface-type为端口类型,interface-number为端口编号。

【描述】

mirroring-group monitor-egress命令用来为远程源镜像组配置出端口。undo mirroring-group monitor-egress命令用来删除远程源镜像组的出端口。

缺省情况下,镜像组没有出端口,任何端口都不是任何镜像组的出端口。

需要注意的是:

l              只能为远程源镜像组配置出端口,不能为本地镜像组或远程目的镜像组配置出端口。

l              指定的镜像组必须存在。

相关配置可参考命令mirroring-group

【举例】

# 创建远程源镜像组1,并在系统视图下配置其出端口为GigabitEthernet1/0/1。

<Sysname> system-view

[Sysname] mirroring-group 1 remote-source

[Sysname] mirroring-group 1 monitor-egress gigabitethernet 1/0/1

# 创建远程源镜像组2,并在以太网端口视图下配置其出端口为GigabitEthernet1/0/2。

<Sysname> system-view

[Sysname] mirroring-group 2 remote-source

[Sysname] interface gigabitethernet 1/0/2

[Sysname-GigabitEthernet1/0/2] mirroring-group 2 monitor-egress

1.1.5  mirroring-group monitor-port

【命令】

mirroring-group group-id monitor-port monitor-port-id

undo mirroring-group group-id monitor-port monitor-port-id

【视图】

系统视图

【缺省级别】

2:系统级

【参数】

group-id:表示镜像组的编号,取值范围为1~5。

monitor-port-id:表示目的端口。表示方式为interface-type interface-number,其中,interface-type为端口类型,interface-number为端口编号。

【描述】

mirroring-group monitor-port命令用来为镜像组配置目的端口。undo mirroring-group monitor-port命令用来删除镜像组的目的端口。

缺省情况下,镜像组没有目的端口。

需要注意的是:

l              只能为本地镜像组或远程目的镜像组配置目的端口,不能为远程源镜像组配置目的端口。

l              目的端口不能是现有镜像组的成员端口。

l              指定的镜像组必须存在。

相关配置可参考命令mirroring-group

【举例】

# 创建远程目的镜像组1,并配置其目的端口为GigabitEthernet1/0/1。

<Sysname> system-view

[Sysname] mirroring-group 1 remote-destination

[Sysname] mirroring-group 1 monitor-port gigabitethernet 1/0/1

1.1.6  mirroring-group remote-probe vlan

【命令】

mirroring-group group-id remote-probe vlan rprobe-vlan-id

undo mirroring-group group-id remote-probe vlan rprobe-vlan-id

【视图】

系统视图

【缺省级别】

2:系统级

【参数】

group-id:表示镜像组的编号,取值范围为1~5。

rprobe-vlan-id:表示远程镜像VLAN的编号,必须为已存在的静态VLAN。

【描述】

mirroring-group remote-probe vlan命令用来为镜像组配置远程镜像VLAN。undo mirroring-group remote-probe vlan命令用来删除镜像组的远程镜像VLAN。

缺省情况下,镜像组没有远程镜像VLAN。

需要注意的是:

l              只有为远程源镜像组和远程目的镜像组配置远程镜像VLAN,不能为本地镜像组配置远程镜像VLAN。

l              只能将已存在的静态VLAN配置为远程镜像VLAN,且一个VLAN只能配置为一个镜像组的远程镜像VLAN。

l              当某VLAN被配置为远程镜像VLAN后,必须先删除远程镜像VLAN的配置才能删除该VLAN。

l              指定的镜像组必须存在。

相关配置可参考命令mirroring-group

【举例】

# 创建远程源镜像组1,并为其配置远程镜像VLAN为VLAN 2。

<Sysname> system-view

[Sysname] mirroring-group 1 remote-source

[Sysname] mirroring-group 1 remote-probe vlan 2

1.1.7  mirroring-port

【命令】

[ mirroring-group group-id ] mirroring-port { both | inbound | outbound }

undo [ mirroring-group group-id ] mirroring-port { both | inbound | outbound }

【视图】

以太网端口视图

【缺省级别】

2:系统级

【参数】

mirroring-group group-id:指定镜像组。group-id表示镜像组的编号,取值范围为1~5,缺省值为1。

both:表示对从端口收到和发出都进行镜像。

inbound:表示仅对从端口收到的报文进行镜像。

outbound:表示仅对从端口发出的报文进行镜像。

【描述】

mirroring-port命令用来配置本端口为镜像组的源端口。undo mirroring-port命令用来取消本端口为镜像组的源端口。

缺省情况下,端口不是任何镜像组的源端口。

需要注意的是:

l              只能为本地镜像组或远程源镜像组配置源端口,不能为远程目的镜像组配置源端口。

l              undo mirroring-port命令中配置的报文镜像方向(bothinboundoutbound)必须与mirroring-port命令中配置的报文镜像方向相同,否则执行该命令无效。

l              指定的镜像组必须存在。

【举例】

# 创建本地镜像组1,配置其源端口为GigabitEthernet1/0/1,并对从该端口收到和发出的报文都进行镜像。

<Sysname> system-view

[Sysname] mirroring-group 1 local

[Sysname] interface gigabitethernet 1/0/1

[Sysname-GigabitEthernet1/0/1] mirroring-group 1 mirroring-port both

# 删除镜像组1的源端口GigabitEthernet1/0/1。

<Sysname> system-view

[Sysname] interface gigabitethernet 1/0/1

[Sysname-GigabitEthernet1/0/1] undo mirroring-group 1 mirroring-port both

1.1.8  monitor-port

【命令】

[ mirroring-group group-id ] monitor-port

undo [ mirroring-group group-id ] monitor-port

【视图】

以太网端口视图

【缺省级别】

2:系统级

【参数】

mirroring-group group-id:指定镜像组。group-id表示镜像组的编号,取值范围为1~5,缺省值为1。

【描述】

monitor-port命令用来配置本端口为镜像组的目的端口。undo monitor-port命令用来取消本端口为镜像组的目的端口。

缺省情况下,端口不是任何镜像组的目的端口。

需要注意的是:

l              只能为本地镜像组或远程目的镜像组配置目的端口,不能为远程源镜像组配置目的端口。

l              目的端口不能是现有镜像组的成员端口。

l              指定的镜像组必须存在。

相关配置可参考命令mirroring-group

【举例】

# 创建本地镜像组1,并配置其目的端口为GigabitEthernet1/0/1。

<Sysname> system-view

[Sysname] mirroring-group 1 local

[Sysname] interface gigabitethernet 1/0/1

[Sysname-GigabitEthernet1/0/1] monitor-port

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们