22-镜像命令
本章节下载: 22-镜像命令 (121.03 KB)
目 录
1.1.3 mirroring-group mirroring-mac
1.1.4 mirroring-group mirroring-port
1.1.5 mirroring-group mirroring-vlan
1.1.6 mirroring-group monitor-port
1.1.7 mirroring-group reflector-port
1.1.8 mirroring-group remote-probe vlan
【命令】
display mirroring-group { group-id | all | local | remote-destination | remote-source }
【视图】
任意视图
【参数】
group-id:端口镜像组的编号,取值范围为1~20。
local:指定镜像组为本地端口镜像组。
remote-destination:指定镜像组为远程端口镜像的目的镜像组。
remote-source:指定镜像组为远程端口镜像的源镜像组。
all:所有的镜像组。
【描述】
display mirroring-group命令用来显示端口镜像组的配置信息。
相关配置可参考命令mirroring-group mirroring-port、mirroring-group monitor-port。
【举例】
# 显示端口镜像组 1的配置信息。
<device> display mirroring-group 1
mirroring-group 1:
type: local
status: active
mirroring port:
GigabitEthernet1/0/1 both
mirroring mac:
mirroring vlan:
monitor port: GigabitEthernet1/0/2
表1-1 display mirroring-group命令显示信息描述表
字段 |
描述 |
type |
镜像组的类型 l local表示本地镜像组 l remote-source表示远程源镜像组 l remote-destination表示远程目的镜像组 |
status |
镜像组的状态 l active表示已经生效 l inactive表示没有生效 |
mirroring port |
镜像源端口 |
both |
被镜像报文的方向: l both表示对端口接收和发送的报文进行镜像 l inbound表示对端口接收的报文进行镜像 l outbound表示对端口发送的报文进行镜像 |
mirroring mac |
配置为基于MAC的镜像时指定的MAC地址和VLAN编号 |
mirroring vlan |
配置为基于VLAN的镜像时指定的VLAN编号 |
monitor port |
镜像目的端口 |
【命令】
mirroring-group group-id { local | remote-destination | remote-source }
undo mirroring-group { group-id | all | local | remote-destination | remote-source }
【视图】
系统视图
【参数】
group-id:端口镜像组的编号,取值范围为1~20。
all:所有的镜像组。
local:本地端口镜像组。
remote-destination:远程端口镜像的目的镜像组。
remote-source:远程端口镜像的源镜像组。
【描述】
mirroring-group命令用来配置端口镜像组。undo mirroring-group命令用来删除端口镜像组。
相关配置可参考命令display mirroring-group。
【举例】
# 配置本地端口镜像组 1。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] mirroring-group 1 local
【命令】
mirroring-group group-id mirroring-mac mac vlan vlan-id
undo mirroring-group group-id mirroring-mac [ [ mac ] vlan vlan-id ]
【视图】
系统视图
【参数】
group-id:端口镜像组的编号,取值范围为1~20。
mac:指定的MAC地址,形式为H-H-H。该MAC地址必须是MAC地址表项中存在的静态MAC地址。
vlan vlan-id:该静态MAC地址所在的VLAN。
【描述】
mirroring-group mirroring-mac命令用来为本地镜像组/远程源镜像组配置基于MAC的镜像。undo mirroring-group mirroring-mac命令用来取消本地镜像组/远程源镜像组的基于MAC的镜像配置。
【举例】
# 配置基于MAC的镜像,将源MAC地址或目的MAC地址匹配000f-e20f-0101的报文镜像到本设备的端口GigabitEthernet 1/0/2。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] mac-address static 000f-e20f-0101 interface Gigabitethernet 1/0/1 vlan 2
[device] mirroring-group 1 local
[device] mirroring-group 1 mirroring-mac 000f-e20f-0101 vlan 2
[device] mirroring-group 1 monitor-port GigabitEthernet 1/0/2
【命令】
mirroring-group group-id mirroring-port mirroring-port-list { both | inbound | outbound }
undo mirroring-group group-id mirroring-port mirroring-port-list
【视图】
系统视图/以太网端口视图
【参数】
group-id:端口镜像组的编号,取值范围为1~20。
mirroring-port mirroring-port-list:镜像源端口列表。mirroring-port-list参数只是在系统视图下的参数,在以太网端口视图下没有这个参数。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命令用来取消本地镜像组/远程源镜像组的镜像源端口。
需要注意的是,镜像源端口不能是现有镜像组的成员端口。
相关配置可参考命令display mirroring-group。
【举例】
# 配置端口GigabitEthernet 1/0/1为本地镜像组1的镜像源端口,并且对该端口接收的报文进行镜像。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] mirroring-group 1 local
[device] mirroring-group 1 mirroring-port GigabitEthernet 1/0/1 inbound
【命令】
mirroring-group group-id mirroring-vlan vlan-id inbound
undo mirroring-group group-id mirroring-vlan [ vlan-id inbound ]
【视图】
系统视图
【参数】
group-id:端口镜像组的编号,取值范围为1~20。
mirroring-vlan vlan-id:指定的VLAN编号,vlan-id取值范围为1~4094。该VLAN必须是设备上已经存在的VLAN。
inbound:对VLAN内所有端口接收的报文进行镜像。
【描述】
mirroring-group mirroring-vlan命令用来为本地镜像组/远程源镜像组配置基于VLAN的镜像。undo mirroring-group mirroring-vlan命令用来取消本地镜像组/远程源镜像组的基于VLAN的镜像配置。
用户可以重复执行mirroring-group mirroring-vlan命令实现对多个VLAN内的报文进行监控的功能。
【举例】
# 配置基于VLAN的镜像,将VLAN 2内所有端口接收的报文都镜像到本设备的端口GigabitEthernet1/0/2。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] mirroring-group 1 local
[device] mirroring-group 1 mirroring-vlan 2 inbound
[device] mirroring-group 1 monitor-port GigabitEthernet 1/0/2
【命令】
mirroring-group group-id monitor-port monitor-port
undo mirroring-group group-id monitor-port monitor-port
【视图】
系统视图/以太网端口视图
【参数】
group-id:端口镜像组的编号,取值范围为1~20。
monitor-port monitor-port:镜像目的端口。monitor-port参数只是在系统视图下的参数,在以太网端口视图下没有这个参数。
【描述】
mirroring-group monitor-port命令用来为本地镜像组/远程目的镜像组配置镜像目的端口。undo mirroring-group monitor-port命令用来取消本地镜像组/远程目的镜像组的镜像目的端口。
需要注意的是,用户不能将聚合成员端口、开启了LACP的端口或者开启了STP功能的端口配置为镜像目的端口。
相关配置可参考命令display mirroring-group。
【举例】
# 配置端口GigabitEthernet 1/0/4为本地镜像组1的镜像目的端口。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] mirroring-group 1 local
[device] mirroring-group 1 monitor-port GigabitEthernet 1/0/4
【命令】
mirroring-group group-id reflector-port reflector-port
undo mirroring-group group-id reflector-port reflector-port
【视图】
系统视图/以太网端口视图
【参数】
group-id:端口镜像组的编号,取值范围为1~20。
reflector-port reflector-port:反射端口。reflector-port参数只是在系统视图下的参数,在以太网端口视图下没有这个参数。
【描述】
mirroring-group reflector-port命令用来为远程源镜像组配置反射端口。undo mirroring-group reflector-port命令用来取消远程源镜像组反射端口的配置。
需要注意的是:
l 反射端口不能是现有镜像组的成员端口、聚合成员端口、开启了LACP的端口或者开启了STP功能的端口,必须是Access端口且不能配置VLAN-VPN、端口环回检测功能和端口安全功能。
l 将某个端口配置为反射端口后,不能再修改端口双工模式、端口速率、MDI属性的取值。
【举例】
# 配置端口GigabitEthernet 1/0/2为远程源镜像组 1的反射端口。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] mirroring-group 1 remote-source
[device] mirroring-group 1 reflector-port GigabitEthernet 1/0/2
【命令】
mirroring-group group-id remote-probe vlan remote-probe-vlan-id
undo mirroring-group group-id remote-probe vlan remote-probe-vlan-id
【视图】
系统视图
【参数】
group-id:端口镜像组的编号,取值范围为1~20。
remote-probe vlan remote-probe-vlan-id:镜像组的远程镜像VLAN。
【描述】
mirroring-group remote-probe vlan命令用来为远程源镜像组/远程目的镜像组配置远程镜像VLAN。undo mirroring-group remote-probe vlan命令用来取消远程源镜像组/远程目的镜像组的远程镜像 VLAN。
相关配置可参考命令display mirroring-group。
【举例】
# 配置远程源镜像组1的远程镜像VLAN为VLAN 100。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] mirroring-group 1 remote-source
[device] mirroring-group 1 remote-probe vlan 100
【命令】
mirroring-port { both | inbound | outbound }
undo mirroring-port
【视图】
以太网端口视图
【参数】
both:对端口接收和发送的报文进行镜像。
inbound:仅对端口接收的报文进行镜像。
outbound:仅对端口发送的报文进行镜像。
【描述】
mirroring-port命令用来配置镜像源端口。undo mirroring-port命令用来取消镜像源端口的配置。
需要注意到是,镜像源端口不能是现有镜像组的成员端口。
相关配置可参考命令display mirroring-group。
如果不创建镜像组而直接在以太网端口下配置镜像源端口,则设备将自动创建本地镜像组1,并将端口加入到镜像组1中。如果本地镜像组1已经存在并且为非本地镜像组,则配置不能成功。
【举例】
# 配置端口GigabitEthernet 1/0/1为镜像源端口,并且对该端口的接收和发送的报文都进行镜像。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] interface GigabitEthernet 1/0/1
[device-GigabitEthernet1/0/1] mirroring-port both
【命令】
monitor-port
undo monitor-port
【视图】
以太网端口视图
【参数】
无
【描述】
monitor-port命令用来配置镜像目的端口。undo monitor-port命令用来取消镜像目的端口的配置。
需要注意的是,用户不能将聚合成员端口、开启了LACP的端口或者开启了STP功能的端口配置为镜像目的端口。
相关配置可参考命令display mirroring-group。
如果不创建镜像组而直接在以太网端口下配置镜像目的端口,则设备将自动创建本地镜像组1,并将端口加入到镜像组1中。如果本地镜像组1已经存在并且为非本地镜像组,则配置不能成功。
【举例】
# 配置端口GigabitEthernet 1/0/4为镜像目的端口。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] interface GigabitEthernet 1/0/4
[device-GigabitEthernet1/0/4] monitor-port
【命令】
remote-probe vlan enable
undo remote-probe vlan enable
【视图】
VLAN视图
【参数】
无
【描述】
remote-probe vlan enable命令用来将当前VLAN配置为远程镜像VLAN。undo remote-probe vlan enable命令用来将当前VLAN恢复为普通VLAN。
需要注意的是,用户不能将缺省VLAN、管理VLAN或者动态VLAN配置为远程镜像VLAN。
【举例】
# 将VLAN 5配置为远程镜像VLAN。
<device> system-view
System View: return to User View with Ctrl+Z.
[device] vlan 5
[device-vlan5] remote-probe vlan enable
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!