• 產品與解決方案
  • 行業解決方案
  • 服務
  • 支持
  • 合作夥伴
  • 關於我們

11-網絡管理和監控命令參考

目錄

11-鏡像命令

本章節下載 11-鏡像命令  (242.08 KB)

11-鏡像命令


1 端口鏡像

1.1  端口鏡像配置命令

1.1.1  display mirroring-group

display mirroring-group命令用來顯示鏡像組的信息。

【命令】

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

【視圖】

任意視圖

【缺省用戶角色】

network-admin

network-operator

【參數】

group-id:顯示鏡像組的信息,取值範圍為1~4。

all:顯示所有鏡像組的信息。

local:顯示本地鏡像組的信息。

remote-destination:顯示遠程目的鏡像組的信息。

remote-source:顯示遠程源鏡像組的信息。

【使用指導】

顯示信息的顯示順序按照鏡像組的編號順序排列,顯示內容包括鏡像組的類型、狀態和構成等信息。

【舉例】

# 顯示所有鏡像組的信息。

<Sysname> display mirroring-group all

Mirroring group 1:

    Type: Local

    Status: Active

    Mirroring port:

        GigabitEthernet1/0/1  Inbound

    Monitor port: GigabitEthernet1/0/2

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

字段

描述

Mirroring group

鏡像組的編號

Type

鏡像組的類型:

·     Local:本地鏡像組

·     Remote source:遠程源鏡像組

·     Remote destination:遠程目的鏡像組

Status

鏡像組的狀態:

·     Active:表示鏡像組已經生效

·     Incomplete:表示鏡像組沒有配完,暫不生效

Mirroring port

鏡像源端口

Monitor port

鏡像目的端口

Reflector port

鏡像組反射端口

Remote probe VLAN

遠程鏡像VLAN

 

1.1.2  mirroring-group

mirroring-group命令用來創建鏡像組。

undo mirroring-group命令用來刪除鏡像組。

【命令】

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

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

【缺省情況】

未創建鏡像組。

【視圖】

係統視圖

【缺省用戶角色】

network-admin

【參數】

group-id:表示鏡像組的編號,取值範圍為1~4。

local:表示本地鏡像組。

remote-destination:表示遠程目的鏡像組。

remote-source:表示遠程源鏡像組。

all:表示所有鏡像組。

【舉例】

# 創建本地鏡像組1。

<Sysname> system-view

[Sysname] mirroring-group 1 local

1.1.3  mirroring-group mirroring-port (interface view)

mirroring-group mirroring-port命令用來配置端口為鏡像組的源端口。

undo mirroring-group mirroring-port命令用來恢複缺省情況。

【命令】

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

undo mirroring-group group-id mirroring-port

【缺省情況】

未配置端口為鏡像組的源端口。

【視圖】

接口視圖

【缺省用戶角色】

network-admin

【參數】

group-id:表示鏡像組的編號,該鏡像組必須存在,取值範圍為1~4。

both:表示對端口收發的報文都進行鏡像。

inbound:表示僅對端口收到的報文進行鏡像。

outbound:表示僅對端口發出的報文進行鏡像。

【使用指導】

隻能為本地鏡像組或遠程源鏡像組配置源端口,不能為遠程目的鏡像組配置源端口。

設備不支持將二層聚合接口配置為鏡像源端口。

請不要將源端口加入到遠程鏡像VLAN中,否則會影響鏡像功能的正常使用。

設備僅支持配置一個對源端口的出方向、或雙向進行鏡像的鏡像組。

一個源端口無論單向還是雙向,都隻能加入一個鏡像組。

源端口不能再被用作本鏡像組或其他鏡像組的反射端口、出端口或目的端口。

【舉例】

# 創建本地鏡像組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

# 創建遠程源鏡像組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 mirroring-port both

【相關命令】

·     mirroring-group

1.1.4  mirroring-group mirroring-port (system view)

mirroring-group mirroring-port命令用來為鏡像組配置源端口。

undo mirroring-group mirroring-port命令用來取消鏡像組的源端口配置。

【命令】

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

undo mirroring-group group-id mirroring-port interface-list

【缺省情況】

未為鏡像組配置源端口。

【視圖】

係統視圖

【缺省用戶角色】

network-admin

【參數】

group-id:表示鏡像組的編號,該鏡像組必須存在,取值範圍為1~4。

interface-list:源端口列表,表示一個或多個源端口。表示方式為interface-list = { interface-type interface-number [ to interface-type interface-number ] }&<1-8>。其中,interface-type interface-number為端口類型和端口編號。&<1-8>表示前麵的參數最多可以輸入8次。當使用to參數配置端口範圍時,起始端口和終止端口必須是相同slot上相同類型的端口,且終止端口的端口編號必須大於等於起始端口的端口編號。

both:表示對端口收發的報文都進行鏡像。

inbound:表示僅對端口收到的報文進行鏡像。

outbound:表示僅對端口發出的報文進行鏡像。

【使用指導】

隻能為本地鏡像組或遠程源鏡像組配置源端口,不能為遠程目的鏡像組配置源端口。

設備不支持將二層聚合接口配置為鏡像源端口。

請不要將源端口加入到遠程鏡像VLAN中,否則會影響鏡像功能的正常使用。

設備僅支持配置一個對源端口的出方向、或雙向進行鏡像的鏡像組。

一個源端口無論單向還是雙向,都隻能加入一個鏡像組。

源端口不能再被用作本鏡像組或其他鏡像組的反射端口、出端口或目的端口。

【舉例】

# 創建本地鏡像組1,配置其源端口為GigabitEthernet1/0/1,並對該端口收發的報文都進行鏡像。

<Sysname> system-view

[Sysname] mirroring-group 1 local

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

# 創建遠程源鏡像組2,配置其源端口為GigabitEthernet1/0/2,並對該端口收發的報文都進行鏡像。

<Sysname> system-view

[Sysname] mirroring-group 2 remote-source

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

【相關命令】

·     mirroring-group

1.1.5  mirroring-group monitor-egress

mirroring-group monitor-egress命令用來為遠程源鏡像組配置出端口。

undo mirroring-group monitor-egress命令用來恢複缺省情況。

【命令】

在係統視圖下:

mirroring-group group-id monitor-egress interface-type interface-number

undo mirroring-group group-id monitor-egress interface-type interface-number

在接口視圖下:

mirroring-group group-id monitor-egress

undo mirroring-group group-id monitor-egress

【缺省情況】

未為遠程源鏡像組配置出端口。

【視圖】

係統視圖

接口視圖

【缺省用戶角色】

network-admin

【參數】

group-id:表示鏡像組的編號,該鏡像組必須存在,取值範圍為1~4。

interface-type interface-number:表示出端口。其中,interface-type interface-number為端口類型和端口編號。

【使用指導】

隻能為遠程源鏡像組配置出端口,不能為本地鏡像組和遠程目的鏡像組配置出端口。

不能在出端口上配置下列功能:生成樹協議、802.1X、IGMP Snooping、靜態ARP和MAC地址學習,否則會影響鏡像功能的正常使用。

出端口不能是現有鏡像組的成員端口。

出端口不能是聚合組的成員端口。

【舉例】

# 創建遠程源鏡像組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

【相關命令】

·     mirroring-group

1.1.6  mirroring-group monitor-port (interface view)

mirroring-group monitor-port命令用來配置端口為鏡像組的目的端口。

undo mirroring-group monitor-port命令用來恢複缺省情況。

【命令】

mirroring-group group-id monitor-port

undo mirroring-group group-id monitor-port

【缺省情況】

未配置端口為鏡像組的目的端口。

【視圖】

接口視圖

【缺省用戶角色】

network-admin

【參數】

group-id:鏡像組。group-id表示鏡像組的編號,該鏡像組必須存在,取值範圍為1~4。

【使用指導】

隻能為本地鏡像組或遠程目的鏡像組配置目的端口,不能為遠程源鏡像組配置目的端口。

請不要在目的端口上使能生成樹協議,否則會影響鏡像功能的正常使用。

當聚合接口作為目的端口時,請勿將其成員端口配置為源端口,否則會影響鏡像功能的正常使用。

從目的端口發出的報文包括鏡像報文和其他端口正常轉發來的報文。為了保證數據監測設備隻對鏡像報文進行分析,請將目的端口隻用於端口鏡像,不作其他用途。

目的端口不能是現有鏡像組的成員端口。

目的端口不能是聚合組的成員端口。

一個鏡像組內隻能配置一個目的端口。

【舉例】

# 創建本地鏡像組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 monitor-port

# 創建遠程目的鏡像組2,並配置其目的端口為GigabitEthernet1/0/2。

<Sysname> system-view

[Sysname] mirroring-group 2 remote-destination

[Sysname] interface gigabitethernet 1/0/2

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

【相關命令】

·     mirroring-group

1.1.7  mirroring-group monitor-port (system view)

mirroring-group monitor-port命令用來為鏡像組配置目的端口。

undo mirroring-group monitor-port命令用來取消鏡像組的目的端口配置。

【命令】

mirroring-group group-id monitor-port interface-type interface-number

undo mirroring-group group-id monitor-port interface-type interface-number

【缺省情況】

未為鏡像組配置目的端口。

【視圖】

係統視圖

【缺省用戶角色】

network-admin

【參數】

group-id:表示鏡像組的編號,該鏡像組必須存在,取值範圍為1~4。

interface-type interface-number:表示目的端口。其中,interface-type interface-number為端口類型和端口編號。

【使用指導】

隻能為本地鏡像組或遠程目的鏡像組配置目的端口,不能為遠程源鏡像組配置目的端口。

不能在目的端口上使能生成樹協議,否則會影響鏡像功能的正常使用。

當聚合接口作為目的端口時,請勿將其成員端口配置為源端口,否則會影響鏡像功能的正常使用。

從目的端口發出的報文包括鏡像報文和其他端口正常轉發來的報文。為了保證數據監測設備隻對鏡像報文進行分析,請將目的端口隻用於端口鏡像,不作其他用途。

目的端口不能是現有鏡像組的成員端口。

目的端口不能是聚合組的成員端口。

一個鏡像組內隻能配置一個目的端口。

【舉例】

# 創建本地鏡像組1,並配置其目的端口為GigabitEthernet1/0/1。

<Sysname> system-view

[Sysname] mirroring-group 1 local

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

# 創建遠程目的鏡像組2,並配置其目的端口為GigabitEthernet1/0/2。

<Sysname> system-view

[Sysname] mirroring-group 2 remote-destination

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

【相關命令】

·     mirroring-group

1.1.8  mirroring-group reflector-port

mirroring-group reflector-port命令用來為遠程源鏡像組配置反射端口。

undo mirroring-group reflector-port命令用來恢複缺省情況。

【命令】

在係統視圖下:

mirroring-group group-id reflector-port interface-type interface-number

undo mirroring-group group-id reflector-port interface-type interface-number

在接口視圖下:

mirroring-group group-id reflector-port

undo mirroring-group group-id reflector-port

【缺省情況】

未為遠程源鏡像組配置反射端口。

【視圖】

係統視圖

接口視圖

【缺省用戶角色】

network-admin

【參數】

group-id:表示鏡像組的編號,該鏡像組必須存在,取值範圍為1~4。

interface-type interface-number:表示反射端口。其中,interface-type interface-number為端口類型和端口編號。

【使用指導】

注意

·     建議選擇設備上未被使用的端口作為反射端口,並不要在該端口上連接網線,否則會影響鏡像功能的正常使用。

·     在將端口配置為反射端口時,該端口上已存在的所有配置都將被清除;在配置為反射端口後,該端口上不能再配置其他業務。

·     當IRF端口隻綁定了一個物理端口時,請勿將該物理端口配置為反射端口,以免IRF分裂。

 

隻能為遠程源鏡像組配置反射端口,不能為本地鏡像組和遠程目的鏡像組配置反射端口。

當端口已配置為反射端口後,不能再修改其雙工模式、端口速率和MDI屬性值,即這些屬性隻能取缺省值。

反射端口不能是聚合組的成員端口。

【舉例】

# 創建遠程源鏡像組1,並在係統視圖下配置其反射端口為GigabitEthernet1/0/1。

<Sysname> system-view

[Sysname] mirroring-group 1 remote-source

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

This operation may delete all settings made on the interface. Continue? [Y/N]: y

# 創建遠程源鏡像組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 reflector-port

This operation may delete all settings made on the interface. Continue? [Y/N]: y

【相關命令】

·     mirroring-group

1.1.9  mirroring-group remote-probe vlan

mirroring-group remote-probe vlan命令用來為鏡像組配置遠程鏡像VLAN。

undo mirroring-group remote-probe vlan命令用來恢複缺省情況。

【命令】

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

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

【缺省情況】

未為鏡像組配置遠程鏡像VLAN。

【視圖】

係統視圖

【缺省用戶角色】

network-admin

【參數】

group-id:表示鏡像組的編號,該鏡像組必須存在,取值範圍為1~4。

vlan-id:表示遠程鏡像VLAN的編號。

【使用指導】

隻能為遠程源鏡像組和遠程目的鏡像組配置遠程鏡像VLAN,不能為本地鏡像組配置遠程鏡像VLAN。

當一個VLAN已被指定為遠程鏡像VLAN後,請不要將該VLAN再作其他用途。

源設備和目的設備上的遠程鏡像組必須使用相同的遠程鏡像VLAN。

隻能將已存在的靜態VLAN配置為遠程鏡像VLAN,且一個VLAN隻能配置為一個鏡像組的遠程鏡像VLAN。

當某VLAN被配置為遠程鏡像VLAN後,必須先刪除遠程鏡像VLAN的配置才能刪除該VLAN。

設備僅支持配置一個遠程鏡像VLAN。

【舉例】

# 創建遠程源鏡像組1,並為其配置遠程鏡像VLAN為VLAN 10。

<Sysname> system-view

[Sysname] mirroring-group 1 remote-source

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

# 創建遠程目的鏡像組2,並為其配置遠程鏡像VLAN為VLAN 20。

<Sysname> system-view

[Sysname] mirroring-group 2 remote-destination

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

【相關命令】

·     mirroring-group

 


2 流鏡像

2.1  流鏡像配置命令

2.1.1  mirror-to cpu

mirror-to cpu命令用來配置流鏡像到CPU。

undo mirror-to命令用來取消流鏡像到CPU。

【命令】

mirror-to cpu

undo mirror-to cpu

【缺省情況】

未配置流鏡像到CPU。

【視圖】

流行為視圖

【缺省用戶角色】

network-admin

【舉例】

# 配置流行為1,並在該流行為中配置流鏡像到CPU。

<Sysname> system-view

[Sysname] traffic behavior 1

[Sysname-behavior-1] mirror-to cpu

2.1.2  mirror-to interface

mirror-to interface命令用來配置流鏡像到接口。

undo mirror-to interface命令用來取消流鏡像到接口。

【命令】

mirror-to interface interface-type interface-number

undo mirror-to interface interface-type interface-number

【缺省情況】

未配置流鏡像到接口。

【視圖】

流行為視圖

【缺省用戶角色】

network-admin

【參數】

interface-type interface-number:表示流鏡像接口的接口類型和接口編號。

【使用指導】

同一流行為中可以通過多次配置將流鏡像到多個不同接口。

設備最多支持配置四個用於流鏡像的流行為,如果多於四個流行為,則隻有前四個流行為生效。

同一流行為中隻能配置一個目的接口,多次執行該命令,僅最後一次執行的命令生效。

【舉例】

# 配置流行為1,並在該流行為中配置流鏡像到接口GigabitEthernet1/0/1。

<Sysname> system-view

[Sysname] traffic behavior 1

[Sysname-behavior-1] mirror-to interface gigabitethernet 1/0/1

 

不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!

BOB登陆
官網
聯係我們