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

H3C園區盒式交換機 CLI快速配置指南-6W104

  • 發布時間:2025/5/12 19:56:54
  • 瀏覽量:
  • 下載量:

30-鏡像快速配置指南

本章節下載  (901.31 KB)

30-鏡像快速配置指南

鏡像快速配置指南

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2024 bobty下载软件 版權所有,保留一切權利。

非經本公司書麵許可,任何單位和個人不得擅自摘抄、複製本文檔內容的部分或全部,並不得以任何形式傳播。

除bobty下载软件 的商標外,本手冊中出現的其它公司的商標、產品標識及商品名稱,由各自權利人擁有。

本文檔中的信息可能變動,恕不另行通知。



1  本地端口鏡像

1.1  簡介

本案例介紹本地端口鏡像的配置方法。

1.2  組網需求

某公司內部各部門使用不同網段的IP地址,其中研發部使用10.1.1.0/24網段,市場部使用12.1.1.0/24網段。現要求通過配置本地端口鏡像功能,使用數據監測設備對研發部和市場部訪問Internet的流量以及兩個部門之間互訪的流量進行監控。

圖1 本地端口鏡像配置組網圖

 

1.3  配置注意事項

·     本地鏡像組需要配置源端口、目的端口才能生效。其中目的端口不能是現有鏡像組的成員端口。

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

1.4  配置步驟

# 配置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.5  驗證配置

# 在完成上述配置後,在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/3

# 以研發部某台主機10.1.1.2通過ping方式訪問56.56.56.6為例,進行鏡像測試,數據監測設備的抓包數據如圖2所示。本例以Wireshark網絡封包分析軟件的顯示為例。

圖2 Wireshark的抓包數據

 

以上抓包信息表明,配置的本地鏡像功能生效,數據監測設備可以成功對需要監控的流量進行監控。

1.6  配置文件

#

 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.7  相關資料

·     產品配套“網絡管理和監控配置指導”中的“鏡像”。

·     產品配套“網絡管理和監控命令參考”中的“鏡像”。


 

2  本地端口鏡像(1:1)快速配置指南

2.1  簡介

本案例介紹1:1本地端口鏡像的配置方法。1:1鏡像是指將單個鏡像端口的報文複製到單個觀察端口。

2.2  組網需求

研發部使用GigabitEthernet1/0/1端口接入Device,現要求通過鏡像功能,使數據檢測設備Server能夠對研發部發送和接收的報文進行鏡像。

圖3 1:1本地端口鏡像配置組網圖

 

2.3  配置注意事項

·     本地鏡像組需要配置源端口、目的端口才能生效。其中目的端口不能是現有鏡像組的成員端口。

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

2.4  配置步驟

# 創建本地鏡像組1。

<Device> system-view

[Device] mirroring-group 1 local

# 配置本地鏡像組1的源端口為GigabitEthernet1/0/1,對源端口收發的報文進行鏡像,目的端口為GigabitEthernet1/0/2。

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

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

# 在目的端口GigabitEthernet1/0/2上關閉生成樹協議。

[Device] interface gigabitethernet 1/0/2

[Device-GigabitEthernet1/0/2] undo stp enable

[Device-GigabitEthernet1/0/2] quit

2.5  驗證配置

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

<Device> display mirroring-group all

Mirroring group 1:

    Type: Local

    Status: Active

    Mirroring port:

        GigabitEthernet1/0/1  Both

    Monitor port: GigabitEthernet1/0/2

配置完成後,用戶可以通過Server監控所有進、出研發部的報文。

2.6  配置文件

#

 mirroring-group 1 local

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 mirroring-group 1 mirroring-port both

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 undo stp enable

 mirroring-group 1 monitor-port

#

2.7  相關資料

·     產品配套“網絡管理和監控配置指導”中的“鏡像”。

·     產品配套“網絡管理和監控命令參考”中的“鏡像”。


 

3  本地端口鏡像(1:N)快速配置指南

3.1  簡介

本案例介紹1:N本地端口鏡像的配置方法。1:N鏡像是指將單個鏡像端口的報文複製到N個不同的觀察端口。

3.2  組網需求

研發部使用GigabitEthernet1/0/1端口接入Device,現要求通過鏡像功能,使不同的數據檢測設備ServerA、ServerB、ServerC能夠對分別研發部發送和接收的報文進行監控分析。

圖4 1:N本地端口鏡像配置組網圖

 

3.3  配置注意事項

·     本地鏡像組需要配置源端口、目的端口才能生效。其中目的端口不能是現有鏡像組的成員端口。

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

3.4  配置步驟

# 創建本地鏡像組1。

<Device> system-view

[Device] mirroring-group 1 local

# 配置本地鏡像組1的源端口為GigabitEthernet1/0/1,對源端口收發的報文進行鏡像,目的端口為GigabitEthernet1/0/2、GigabitEthernet1/0/3、GigabitEthernet1/0/4。

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

[Device] mirroring-group 1 monitor-port gigabitethernet 1/0/2 to gigabitethernet 1/0/4

# 在目的端口GigabitEthernet1/0/2、GigabitEthernet1/0/3、GigabitEthernet1/0/4上關閉生成樹協議。

[Device] interface gigabitethernet 1/0/2

[Device-GigabitEthernet1/0/2] undo stp enable

[Device-GigabitEthernet1/0/2] quit

[Device] interface gigabitethernet 1/0/3

[Device-GigabitEthernet1/0/3] undo stp enable

[Device-GigabitEthernet1/0/3] quit

[Device] interface gigabitethernet 1/0/4

[Device-GigabitEthernet1/0/4] undo stp enable

[Device-GigabitEthernet1/0/4] quit

3.5  驗證配置

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

<Device> display mirroring-group all

Mirroring group 1:

    Type: Local

    Status: Active

    Mirroring port:

        GigabitEthernet1/0/1  Both

    Monitor port: GigabitEthernet1/0/2

                  GigabitEthernet1/0/3

                  GigabitEthernet1/0/4

配置完成後,用戶可以通過ServerA、ServerB、ServerC分別監控所有進、出研發部的報文。

3.6  配置文件

#

 mirroring-group 1 local

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 mirroring-group 1 mirroring-port both

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 undo stp enable

 mirroring-group 1 monitor-port

#

interface GigabitEthernet1/0/3

 port link-mode bridge

 undo stp enable

 mirroring-group 1 monitor-port

#

interface GigabitEthernet1/0/4

 port link-mode bridge

 undo stp enable

 mirroring-group 1 monitor-port

#

3.7  相關資料

·     產品配套“網絡管理和監控配置指導”中的“鏡像”。

·     產品配套“網絡管理和監控命令參考”中的“鏡像”。


 

4  本地端口鏡像(M:N)快速配置指南

4.1  簡介

本案例介紹M:N本地端口鏡像的配置方法。M:N鏡像是指將M個鏡像端口的報文複製到N個不同的觀察端口。

4.2  組網需求

市場部和研發部分別使用GigabitEthernet1/0/1、GigabitEthernet1/0/2端口接入Device,現要求通過鏡像功能,使不同的數據檢測設備ServerA、ServerB、ServerC能夠對分別市場部、研發部發送和接收的報文進行監控分析。

圖5 M:N本地端口鏡像配置組網圖

 

4.3  配置注意事項

·     本地鏡像組需要配置源端口、目的端口才能生效。其中目的端口不能是現有鏡像組的成員端口。

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

4.4  配置步驟

# 創建本地鏡像組1。

<Device> system-view

[Device] mirroring-group 1 local

# 配置本地鏡像組1的源端口為GigabitEthernet1/0/1、GigabitEthernet1/0/2,對源端口收發的報文進行鏡像,目的端口為GigabitEthernet1/0/3、GigabitEthernet1/0/4、GigabitEthernet1/0/5。

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

[Device] mirroring-group 1 monitor-port gigabitethernet 1/0/3 to gigabitethernet 1/0/5

# 在目的端口GigabitEthernet1/0/3、GigabitEthernet1/0/4、GigabitEthernet1/0/5上關閉生成樹協議。

[Device] interface gigabitethernet 1/0/3

[Device-GigabitEthernet1/0/3] undo stp enable

[Device-GigabitEthernet1/0/3] quit

[Device] interface gigabitethernet 1/0/4

[Device-GigabitEthernet1/0/4] undo stp enable

[Device-GigabitEthernet1/0/4] quit

[Device] interface gigabitethernet 1/0/5

[Device-GigabitEthernet1/0/5] undo stp enable

[Device-GigabitEthernet1/0/5] quit

4.5  驗證配置

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

<Device> display mirroring-group all

Mirroring group 1:

    Type: Local

    Status: Active

    Mirroring port:

        GigabitEthernet1/0/1  Both

        GigabitEthernet1/0/2  Both

    Monitor port: GigabitEthernet1/0/3

                  GigabitEthernet1/0/4

                  GigabitEthernet1/0/5

配置完成後,用戶可以通過ServerA、ServerB、ServerC分別監控所有進、出市場部和研發部的報文。

4.6  配置文件

#

 mirroring-group 1 local

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 mirroring-group 1 mirroring-port both

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 mirroring-group 1 mirroring-port both

#

interface GigabitEthernet1/0/3

 port link-mode bridge

 undo stp enable

 mirroring-group 1 monitor-port

#

interface GigabitEthernet1/0/4

 port link-mode bridge

 undo stp enable

 mirroring-group 1 monitor-port

#

interface GigabitEthernet1/0/5

 port link-mode bridge

 undo stp enable

 mirroring-group 1 monitor-port

#

4.7  相關資料

·     產品配套“網絡管理和監控配置指導”中的“鏡像”。

·     產品配套“網絡管理和監控命令參考”中的“鏡像”。


 

 

5  利用遠程鏡像VLAN實現本地鏡像支持多目的端口配置

5.1  簡介

本案例介紹利用遠程鏡像VLAN實現本地鏡像支持多目的端口配置方法。

5.2  組網需求

研發部使用GigabitEthernet1/0/1端口接入Device,現要求通過鏡像功能,使數據檢測設備ServerA和ServerB都能夠對研發部發送和接收的報文進行鏡像。

圖6 利用遠程鏡像VLAN實現本地鏡像支持多目的端口組網圖

 

5.3  配置注意事項

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

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

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

5.4  配置步驟

# 創建業務VLAN2。

<Device> system-view

[Device] vlan 2

[Device-vlan2] quit

# 創建VLAN 2接口並配置IP地址。

[Device] interface vlan-interface 2

[Device-Vlan-interface2] ip address 10.1.1.1 24

[Device-Vlan-interface2] quit

# 創建VLAN 10作為遠程鏡像VLAN。

[Device] vlan 10

[Device-vlan10] quit

# 配置端口GigabitEthernet1/0/1的端口類型為Trunk端口,允許業務VLAN 2的報文通過。

[Device] interface gigabitethernet 1/0/1

[Device-GigabitEthernet1/0/1] port link-type trunk

[Device-GigabitEthernet1/0/1] port trunk permit vlan 2

[Device-GigabitEthernet1/0/1] quit

# 創建遠程源鏡像組1。

<Device> system-view

[Device] mirroring-group 1 remote-source

# 將接入研發部的端口GigabitEthernet1/0/1配置為遠程源鏡像組1的源端口。

[Device] mirroring-group 1 mirroring-port gigabitethernet1/0/1 both

# 將設備上任意未使用的端口(此處以GigabitEthernet1/0/4為例)配置為鏡像組1的反射口。

[Device] mirroring-group 1 reflector-port gigabitethernet1/0/4

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

# 將接入數據檢測設備的端口加入VLAN10。

[Device] vlan 10

[Device-vlan10] port gigabitethernet1/0/2 to gigabitethernet1/0/3

[Device-vlan10] quit

# 配置VLAN10作為鏡像組1的遠程鏡像VLAN。

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

5.5  驗證配置

# 在完成上述配置後,在Device上顯示鏡像組1的配置信息。

[DeviceA] display mirroring-group all

Mirroring group 1:

    Type: Remote source

    Status: Active

    Mirroring port:

        GigabitEthernet1/0/1  Both

    Reflector port: GigabitEthernet1/0/4

    Remote probe VLAN: 10

5.6  配置文件

#

 mirroring-group 1 remote-source

 mirroring-group 1 remote-probe vlan 10

#

vlan 2

#

vlan 10

#

interface Vlan-interface2

 ip address 10.1.1.1 255.255.255.0

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 2

 mirroring-group 1 mirroring-port inbound

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 10

#

interface GigabitEthernet1/0/3

 port link-mode bridge

 port access vlan 10

#

interface GigabitEthernet1/0/4

 port link-mode bridge

 port access vlan 10

 mirroring-group 1 reflector-port

#

5.7  相關資料

·     產品配套“網絡管理和監控配置指導”中的“鏡像”。

·     產品配套“網絡管理和監控命令參考”中的“鏡像”。


 

6  出端口方式二層遠程端口鏡像

6.1  簡介

本案例介紹出端口方式二層遠程端口鏡像的配置方法。

6.2  組網需求

某公司內部各部門通過二層網絡連接到核心設備Device A,各部門使用不同網段的IP地址,其中研發部使用10.1.1.0/24網段,市場部使用12.1.1.0/24網段。現要求通過配置出端口方式二層遠程端口鏡像功能,使用數據監測設備對研發部發送的報文進行監控。

圖7 出端口方式二層遠程端口鏡像組網圖

 

6.3  配置注意事項

·     為確保源設備與目的設備之間的鏡像報文可以二層轉發,中間設備連接到源設備和目的設備方向的端口上需允許遠程鏡像VLAN通過。

·     建議用戶先配目的設備,再配中間設備,最後配源設備,以保證鏡像流量的正常轉發。

配置遠程端口鏡像的目的設備和源設備時均需要注意:

·     配置遠程鏡像VLAN時:

¡     要求該VLAN為靜態VLAN並預先創建。

¡     要求該VLAN不用做其他用途,僅用於遠程鏡像功能。

¡     要求該VLAN隻能被一個遠程源鏡像組使用。

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

配置遠程端口鏡像的目的設備時需要注意:

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

·     目的端口不用做其他用途,僅用於端口鏡像。

配置遠程端口鏡像的源設備時需要注意:

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

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

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

·     一個鏡像組內隻能配置一個出端口。

·     源端口為三層接口時,隻能通過配置出端口方式實現二層遠程鏡像。

6.4  配置步驟

1. Device A的配置(目的設備)

# 創建業務VLAN 2和VLAN 3。

<DeviceA> system-view

[DeviceA] vlan 2 to 3

# 創建VLAN 5作為遠程鏡像VLAN。

[DeviceA] vlan 5

[DeviceA-vlan5] quit

# 創建VLAN 2接口和VLAN 3接口並配置IP地址作為相應VLAN的網關。

[DeviceA] interface vlan-interface 2

[DeviceA-Vlan-interface2] ip address 10.1.1.1 24

[DeviceA-Vlan-interface2] quit

[DeviceA] interface vlan-interface 3

[DeviceA-Vlan-interface3] ip address 12.1.1.1 24

[DeviceA-Vlan-interface3] quit

# 配置端口GigabitEthernet1/0/1的端口類型為Trunk端口,允許業務VLAN 2、VLAN 3和鏡像VLAN 5的報文通過。

[DeviceA] interface gigabitethernet 1/0/1

[DeviceA-GigabitEthernet1/0/1] port link-type trunk

[DeviceA-GigabitEthernet1/0/1] port trunk permit vlan 2 3 5

[DeviceA-GigabitEthernet1/0/1] quit

# 創建遠程目的鏡像組1。

[DeviceA] mirroring-group 1 remote-destination

# 為遠程目的鏡像組1配置遠程鏡像VLAN為VLAN 5,及配置連接數據監測設備的端口GigabitEthernet1/0/2為目的端口。

[DeviceA] mirroring-group 1 remote-probe vlan 5

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

# 將鏡像目的端口加入遠程鏡像VLAN。將鏡像數據發送給監測設備時,不需要攜帶遠程鏡像VLAN的VLAN Tag,因此將該端口配置為Access端口。

[DeviceA] interface gigabitethernet 1/0/2

[DeviceA-GigabitEthernet1/0/2] port access vlan 5

# 關閉目的端口GigabitEthernet1/0/2上的生成樹協議。

[DeviceA-GigabitEthernet1/0/2] undo stp enable

[DeviceA-GigabitEthernet1/0/2] quit

2. Device B的配置(中間設備)

# 創建業務VLAN 2和VLAN 3。

<DeviceB> system-view

[DeviceB] vlan 2 to 3

# 創建VLAN 5作為遠程鏡像VLAN。

[DeviceB] vlan 5

[DeviceB-vlan5] quit

# 配置端口GigabitEthernet1/0/1的端口類型為Trunk端口,允許業務VLAN 2、VLAN 3和鏡像VLAN 5的報文通過。

[DeviceB] interface gigabitethernet 1/0/1

[DeviceB-GigabitEthernet1/0/1] port link-type trunk

[DeviceB-GigabitEthernet1/0/1] port trunk permit vlan 2 3 5

[DeviceB-GigabitEthernet1/0/1] quit

# 配置端口GigabitEthernet1/0/2的端口類型為Trunk端口,允許業務VLAN 2、VLAN 3和鏡像VLAN 5的報文通過。

[DeviceB] interface gigabitethernet 1/0/2

[DeviceB-GigabitEthernet1/0/2] port link-type trunk

[DeviceB-GigabitEthernet1/0/2] port trunk permit vlan 2 3 5

[DeviceB-GigabitEthernet1/0/2] quit

3. Device C的配置(源設備)

# 創建業務VLAN 2和VLAN 3。

<DeviceC> system-view

[DeviceC] vlan 2 to 3

# 將端口GigabitEthernet1/0/1加入VLAN 2。

[DeviceC] interface gigabitethernet 1/0/1

[DeviceC-GigabitEthernet1/0/1] port access vlan 2

[DeviceC-GigabitEthernet1/0/1] quit

# 將端口GigabitEthernet1/0/2加入VLAN 3。

[DeviceC] interface gigabitethernet 1/0/2

[DeviceC-GigabitEthernet1/0/2] port access vlan 3

[DeviceC-GigabitEthernet1/0/2] quit

# 創建遠程源鏡像組1。

[DeviceC] mirroring-group 1 remote-source

# 創建VLAN 5作為遠程鏡像VLAN。

[DeviceC] vlan 5

[DeviceC-vlan5] quit

# 配置遠程源鏡像組1的遠程鏡像VLAN為VLAN 5,源端口為GigabitEthernet1/0/1,出端口為GigabitEthernet1/0/3。

[DeviceC] mirroring-group 1 remote-probe vlan 5

[DeviceC] mirroring-group 1 mirroring-port gigabitethernet 1/0/1 inbound

[DeviceC] mirroring-group 1 monitor-egress gigabitethernet 1/0/3

# 配置端口GigabitEthernet1/0/3的端口類型為Trunk端口,允許業務VLAN 2、VLAN 3和鏡像VLAN 5的報文通過。

[DeviceC] interface gigabitethernet 1/0/3

[DeviceC-GigabitEthernet1/0/3] port link-type trunk

[DeviceC-GigabitEthernet1/0/3] port trunk permit vlan 2 3 5

[DeviceC-GigabitEthernet1/0/3] quit

# 關閉出端口GigabitEthernet1/0/3上的生成樹協議。

[DeviceC-GigabitEthernet1/0/3] undo stp enable

[DeviceC-GigabitEthernet1/0/3] quit

6.5  驗證配置

# 在完成上述配置後,在DeviceC上顯示鏡像組1的配置信息。

[DeviceC] display mirroring-group 1

Mirroring group 1:

    Type: Remote source

    Status: Active

    Mirroring port:

        GigabitEthernet1/0/1  Inbound

    Monitor egress port: GigabitEthernet1/0/3

        Remote probe VLAN: 5

# 在DeviceA上顯示鏡像組1的配置信息。

[DeviceA] display mirroring-group 1

Mirroring group 1:

    Type: Remote destination

    Status: Active

    Monitor port: GigabitEthernet1/0/2

    Remote probe VLAN: 5

# 以研發部某台主機10.1.1.2通過ping方式訪問市場部某台主機12.1.1.2為例,進行鏡像測試,數據監測設備的抓包數據如圖8所示。本例以Wireshark網絡封包分析軟件的顯示為例。

圖8 Wireshark的抓包數據

 

以上抓包信息表明,配置的二層遠程端口鏡像功能生效,數據監測設備可以成功對對研發部發送的報文進行監控。

6.6  配置文件

·     設備Device A:

#

 mirroring-group 1 remote-destination

 mirroring-group 1 remote-probe vlan 5

#

vlan 2 to 3

#

vlan 5

#

interface Vlan-interface2

 ip address 10.1.1.1 255.255.255.0

#

interface Vlan-interface3

 ip address 12.1.1.1 255.255.255.0

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 to 3 5

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 5

 undo stp enable

 mirroring-group 1 monitor-port

#

·     設備Device B:

#

vlan 2 to 3

#

vlan 5

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 to 3 5

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 to 3 5

#

·     設備Device C:

#

 mirroring-group 1 remote-source

 mirroring-group 1 remote-probe vlan 5

#

vlan 2 to 3

#

vlan 5

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 2

 mirroring-group 1 mirroring-port inbound

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 3

#

interface GigabitEthernet1/0/3

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 to 3 5

 mirroring-group 1 monitor-egress

#

6.7  相關資料

·     產品配套“網絡管理和監控配置指導”中的“鏡像”。

·     產品配套“網絡管理和監控命令參考”中的“鏡像”。


 

 

7  反射端口方式二層遠程端口鏡像

7.1  簡介

本案例介紹反射端口方式二層遠程端口鏡像的配置方法。

7.2  組網需求

某公司市場部通過二層網絡連接到核心設備Device A,使用10.1.1.0/24網段。現要求通過配置反射端口方式二層遠程端口鏡像功能,使用數據監測設備對市場部發送的報文進行監控。

圖9 反射端口方式二層遠程端口鏡像組網圖

 

7.3  配置注意事項

·     為確保源設備與目的設備之間的鏡像報文可以二層轉發,中間設備連接到源設備和目的設備方向的端口上需允許遠程鏡像VLAN通過。

·     建議用戶先配目的設備,再配中間設備,最後配源設備,以保證鏡像流量的正常轉發。

配置遠程端口鏡像的目的設備和源設備時均需要注意:

·     配置遠程鏡像VLAN時:

¡     要求該VLAN為靜態VLAN並預先創建。

¡     要求該VLAN不用做其他用途,僅用於遠程鏡像功能。

¡     要求該VLAN隻能被一個遠程源鏡像組使用。

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

配置遠程端口鏡像的目的設備時需要注意:

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

·     目的端口不用做其他用途,僅用於端口鏡像。

配置遠程端口鏡像的源設備時需要注意:

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

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

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

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

7.4  配置步驟

1. Device A的配置(目的設備)

# 創建業務VLAN 2。

<DeviceA> system-view

[DeviceA] vlan 2

# 創建VLAN 5作為遠程鏡像VLAN。

[DeviceA] vlan 5

[DeviceA-vlan5] quit

# 創建VLAN 2接口並配置IP地址作為相應VLAN的網關。

[DeviceA] interface vlan-interface 2

[DeviceA-Vlan-interface2] ip address 10.1.1.1 24

[DeviceA-Vlan-interface2] quit

# 配置端口GigabitEthernet1/0/1的端口類型為Trunk端口,允許業務VLAN 2和鏡像VLAN 5的報文通過。

[DeviceA] interface gigabitethernet 1/0/1

[DeviceA-GigabitEthernet1/0/1] port link-type trunk

[DeviceA-GigabitEthernet1/0/1] port trunk permit vlan 2 5

[DeviceA-GigabitEthernet1/0/1] quit

# 創建遠程目的鏡像組1。

[DeviceA] mirroring-group 1 remote-destination

# 為遠程目的鏡像組1配置遠程鏡像VLAN為VLAN 5,及配置連接數據監測設備的端口GigabitEthernet1/0/2為目的端口。

[DeviceA] mirroring-group 1 remote-probe vlan 5

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

# 將鏡像目的端口加入遠程鏡像VLAN。將鏡像數據發送給監測設備時,不需要攜帶遠程鏡像VLAN的VLAN Tag,因此將該端口配置為Access端口。

[DeviceA] interface gigabitethernet 1/0/2

[DeviceA-GigabitEthernet1/0/2] port access vlan 5

# 關閉目的端口GigabitEthernet1/0/2上的生成樹協議。

[DeviceA-GigabitEthernet1/0/2] undo stp enable

[DeviceA-GigabitEthernet1/0/2] quit

2. Device B的配置(中間設備)

# 創建業務VLAN 2。

<DeviceB> system-view

[DeviceB] vlan 2

# 創建VLAN 5作為遠程鏡像VLAN。

[DeviceB] vlan 5

[DeviceB-vlan5] quit

# 配置端口GigabitEthernet1/0/1的端口類型為Trunk端口,允許業務VLAN 2和鏡像VLAN 5的報文通過。

[DeviceB] interface gigabitethernet 1/0/1

[DeviceB-GigabitEthernet1/0/1] port link-type trunk

[DeviceB-GigabitEthernet1/0/1] port trunk permit vlan 2 5

[DeviceB-GigabitEthernet1/0/1] quit

# 配置端口GigabitEthernet1/0/2的端口類型為Trunk端口,允許業務VLAN 2和鏡像VLAN 5的報文通過。

[DeviceB] interface gigabitethernet 1/0/2

[DeviceB-GigabitEthernet1/0/2] port link-type trunk

[DeviceB-GigabitEthernet1/0/2] port trunk permit vlan 2 5

[DeviceB-GigabitEthernet1/0/2] quit

3. Device C的配置(源設備)

# 創建業務VLAN 2。

<DeviceC> system-view

[DeviceC] vlan 2

# 將端口GigabitEthernet1/0/1加入VLAN 2。

[DeviceC] interface gigabitethernet 1/0/1

[DeviceC-GigabitEthernet1/0/1] port access vlan 2

[DeviceC-GigabitEthernet1/0/1] quit

# 創建遠程源鏡像組1。

[DeviceC] mirroring-group 1 remote-source

# 創建VLAN 5作為遠程鏡像VLAN。

[DeviceC] vlan 5

[DeviceC-vlan5] quit

# 配置遠程源鏡像組1的遠程鏡像VLAN為VLAN 5,源端口為GigabitEthernet1/0/1,反射端口為GigabitEthernet1/0/2。

[DeviceC] mirroring-group 1 remote-probe vlan 5

[DeviceC] mirroring-group 1 mirroring-port gigabitethernet 1/0/1 inbound

[DeviceC] mirroring-group 1 reflector-port gigabitethernet 1/0/2

# 配置端口GigabitEthernet1/0/3為Trunk口,並允許業務VLAN 2和鏡像VLAN 5的報文通過。

[DeviceC] interface gigabitethernet 1/0/3

[DeviceC-GigabitEthernet1/0/3] port link-type trunk

[DeviceC-GigabitEthernet1/0/3] port trunk permit vlan 2

[DeviceC-GigabitEthernet1/0/3] quit

7.5  驗證配置

# 顯示Device A上所有鏡像組的配置信息。

[DeviceA] display mirroring-group all

Mirroring group 1:

    Type: Remote destination

    Status: Active

    Monitor port: GigabitEthernet1/0/2

    Remote probe VLAN: 5

# 顯示Device C上所有鏡像組的配置信息。

[DeviceC] display mirroring-group all

Mirroring group 1:

    Type: Remote source

    Status: Active

    Mirroring port:

        GigabitEthernet1/0/1  inbound

    Reflector port: GigabitEthernet1/0/2

    Remote probe VLAN: 5

7.6  配置文件

·     設備Device A:

#

 mirroring-group 1 remote-destination

 mirroring-group 1 remote-probe vlan 5

#

vlan 2

#

vlan 5

#

interface Vlan-interface2

 ip address 10.1.1.1 255.255.255.0

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 to 2 5

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port access vlan 5

 undo stp enable

 mirroring-group 1 monitor-port

#

·     設備Device B:

#

vlan 2

#

vlan 5

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 to 2 5

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 1 to 2 5

#

·     設備Device C:

#

 mirroring-group 1 remote-source

 mirroring-group 1 remote-probe vlan 5

#

vlan 2

#

vlan 5

#

interface GigabitEthernet1/0/1

 port link-mode bridge

 port access vlan 2

 mirroring-group 1 mirroring-port inbound

#

interface GigabitEthernet1/0/2

 port link-mode bridge

 mirroring-group 1 reflector-port

#

interface GigabitEthernet1/0/3

 port link-mode bridge

 port link-type trunk

 port trunk permit vlan 2 5

#

7.7  相關資料

·     產品配套“網絡管理和監控配置指導”中的“鏡像”。

·     產品配套“網絡管理和監控命令參考”中的“鏡像”。


 

8  配置封裝參數方式三層遠程端口鏡像

8.1  簡介

本案例介紹配置封裝參數方式三層遠程端口鏡像的配置方法。

8.2  組網需求

某公司研發部使用10.1.1.1/24網段。現要求通過配置三層遠程端口鏡像功能,使用數據監測設備對研發部訪問Internet的報文進行監控。

圖10 三層遠程端口鏡像組網圖

 

 

8.3  配置注意事項

如果源設備和目的設備之間存在中間設備,則需要在中間設備上配置單播路由協議,以確保源設備與目的設備之間的三層網絡暢通。

8.4  配置步驟

1. Device A的配置

# 配置接口GigabitEthernet1/0/1的IP地址為10.1.1.1。

<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地址為20.1.1.1。

[DeviceA] interface gigabitethernet 1/0/2

[DeviceA-GigabitEthernet1/0/2] port link-mode route

[DeviceA-GigabitEthernet1/0/2] ip address 20.1.1.1 24

[DeviceA-GigabitEthernet1/0/2] quit

# 配置接口GigabitEthernet1/0/3的IP地址為100.1.1.1。

[DeviceA] interface gigabitethernet 1/0/3

[DeviceA-GigabitEthernet1/0/3] port link-mode route

[DeviceA-GigabitEthernet1/0/3] ip address 100.1.1.1 24

[DeviceA-GigabitEthernet1/0/3] quit

# 配置OSPF協議。

<DeviceB> system-view

[DeviceB] ospf 1

[DeviceB-ospf-1] area 0

[DeviceB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255

[DeviceB-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255

[DeviceB-ospf-1-area-0.0.0.0] quit

[DeviceB-ospf-1] quit

# 創建本地鏡像組1。

[DeviceA] mirroring-group 1 local

# 為本地鏡像組1配置源端口。

[DeviceA] mirroring-group 1 mirroring-port gigabitethernet 1/0/1 inbound

# 為本地鏡像組1配置目的端口及鏡像報文的封裝參數。

[DeviceA] mirroring-group 1 monitor-port gigabitethernet 1/0/2 destination-ip 40.1.1.2 source-ip 20.1.1.1

2. Device B的配置

# 配置接口GigabitEthernet1/0/1的IP地址為20.1.1.2。

<DeviceA> system-view

[DeviceA] interface gigabitethernet 1/0/1

[DeviceA-GigabitEthernet1/0/1] port link-mode route

[DeviceA-GigabitEthernet1/0/1] ip address 20.1.1.2 24

[DeviceA-GigabitEthernet1/0/1] quit

# 配置接口GigabitEthernet1/0/2的IP地址為40.1.1.1。

[DeviceA] interface gigabitethernet 1/0/2

[DeviceA-GigabitEthernet1/0/2] port link-mode route

[DeviceA-GigabitEthernet1/0/2] ip address 40.1.1.1 24

[DeviceA-GigabitEthernet1/0/2] quit

# 配置OSPF協議。

<DeviceB> system-view

[DeviceB] ospf 1

[DeviceB-ospf-1] area 0

[DeviceB-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255

[DeviceB-ospf-1-area-0.0.0.0] network 40.1.1.0 0.0.0.255

[DeviceB-ospf-1-area-0.0.0.0] quit

[DeviceB-ospf-1] quit

8.5  驗證配置

# 在完成上述配置後,在DeviceA上顯示鏡像組1的配置信息。

[DeviceA] display mirroring-group 1

Mirroring group 1:

    Type: Local

    Status: Active

    Mirroring port:

        GigabitEthernet1/0/1  Inbound

    Monitor port: GigabitEthernet1/0/2

                  Encapsulation: Destination IP address 40.1.1.2

                                 Source IP address 20.1.1.1

                                 Destination MAC address 1025-4125-412b

8.6  配置文件

·     設備Device A:

#

ospf 1

 area 0.0.0.0

  network 10.1.1.0 0.0.0.255

  network 20.1.1.0 0.0.0.255

#

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 20.1.1.1 255.255.255.0

 mirroring-group 1 monitor-port  destination-ip 40.1.1.2 source-ip 20.1.1.1

#

interface GigabitEthernet1/0/3

 port link-mode route

 ip address 100.1.1.1 255.255.255.0

#

·     設備Device B:

#

ospf 1

 area 0.0.0.0

  network 20.1.1.0 0.0.0.255

  network 40.1.1.0 0.0.0.255

#

interface GigabitEthernet1/0/1

 port link-mode route

 ip address 20.1.1.2 255.255.255.0

#

interface GigabitEthernet1/0/2

 port link-mode route

 ip address 40.1.1.1 255.255.255.0

#

8.7  相關資料

·     產品配套“網絡管理和監控配置指導”中的“鏡像”。

·     產品配套“網絡管理和監控命令參考”中的“鏡像”。


 

9  本地流鏡像快速配置指南

9.1  簡介

本案例介紹本地流鏡像的配置方法。

9.2  組網需求

某公司研發部使用10.1.1.0/24網段,現要求通過配置本地流鏡像功能,使用數據監測設備對研發部主機訪問互聯網的WWW流量進行監控。

圖11 本地流鏡像組網示意圖

 

9.3  配置步驟

# 配置GigabitEthernet1/0/1接口IP地址為10.1.1.0/24,連接研發部設備。

<Device> system-view

[Device] interface gigabitethernet 1/0/1

[Device-GigabitEthernet1/0/1] port link-mode route

[Device-GigabitEthernet1/0/1] ip address 10.1.1.0 24

[Device-GigabitEthernet1/0/1] quit

#定義對研發部上網流量進行鏡像的QoS策略,創建ACL 3000,匹配研發部的上網流量。

[Device] acl number 3000

[Device-acl-adv-3000] rule permit tcp destination-port eq www source 10.1.1.0 0.0.0.255

[Device-acl-adv-3000] quit

# 創建流分類classifier_research,匹配ACL 3000。

[Device] traffic classifier classifier_research

[Device-classifier-classifier_research] if-match acl 3000

[Device-classifier-classifier_research] quit

# 定義流行為behavior_research,動作為鏡像至端口GigabitEthernet1/0/2。

[Device] traffic behavior behavior_research

[Device-behavior-behavior_research] mirror-to interface gigabitethernet 1/0/2

[Device-behavior-behavior_research] quit

# 定義策略policy_research,為類classifier_research指定流行為behavior_research。

[Device] qos policy policy_research

[Device-qospolicy-policy_research] classifier classifier_research behavior behavior_research

[Device-qospolicy-policy_research] quit

# 將policy_research策略應用到GigabitEthernet1/0/1端口的入方向。

[Device] interface gigabitethernet 1/0/1

[Device-GigabitEthernet1/0/1] qos apply policy policy_research inbound

[Device-GigabitEthernet1/0/1] quit

9.4  驗證配置

# 在完成上述配置後,在Device上驗證流鏡像的配置信息。

[Device] display qos policy interface

  Interface: GigabitEthernet1/0/1

  Direction: Inbound

  Policy: policy_research

   Classifier: classifier_research

     Operator: AND

     Rule(s) :

      If-match acl 3000

     Behavior: behavior_research

      Mirroring:

        Mirror to the interface: GigabitEthernet1/0/2

9.5  配置文件

#

acl number 3000

 rule 0 permit tcp source 10.1.1.0 0.0.0.255 destination-port eq www

#

traffic classifier classifier_research operator and

 if-match acl 3000

#

traffic behavior behavior_research

 mirror-to interface GigabitEthernet1/0/2

#

qos policy policy_research

 classifier classifier_research behavior behavior_research

#

interface GigabitEthernet1/0/1

 port link-mode route

 ip address 10.1.1.0 0.0.0.255

 qos apply policy policy_research inbound

#

9.6  相關資料

·     產品配套“網絡管理和監控配置指導”中的“鏡像”。

·     產品配套“網絡管理和監控命令參考”中的“鏡像”。

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

BOB登陆
官網
聯係我們