tft每日頭條

 > 生活

 > h3c多網口配置

h3c多網口配置

生活 更新时间:2024-07-28 22:16:34

鏡像是目前對網絡中數據報文進行監控的常用手段,我們可以對網絡中的數據報文鏡像抓取分析,可以用來網絡質量的分析監控,網絡故障的時候還可以對網絡的丢包位置進行快速的判斷。

當網絡中的鏡像源設備與鏡像目的設備不在同一個二層網絡域内時就需要跨三層的遠程端口鏡像來實現。

在一個三層網絡中,Device A、Device B、Device C及Server如下圖所示連接。其中,Device A通過端口Ten-GigabitEthernet1/0/1連接市場部。

通過配置三層遠程端口鏡像,并建立OSPF方式的GRE隧道,使得Server可以通過由GRE隧道傳輸的鏡像報文來監控所有進、出市場部的報文。

h3c多網口配置(S6800産品三層遠程端口鏡像典型配置案例)1

如圖所示,Devcie A與Device C設備通過多跳的三層網絡互聯,監控Server挂在了遠端Device C的下面,現Server需要監控Device A下面1/0/1端口的流量。

先看下我們的常規(配置手冊)配置方案:

h3c多網口配置(S6800産品三層遠程端口鏡像典型配置案例)2

配置步驟

(1)配置IP地址

請按照圖配置各接口的IP地址和子網掩碼,具體配置過程略。

(2)配置Device A

# 創建業務環回組1,并配置服務類型為Tunnel。

<DeviceA> system-view

[DeviceA] service-loopback group 1 type tunnel

# 将接口Ten-GigabitEthernet1/0/3加入業務環回組1。

[DeviceA] interface ten-gigabitethernet 1/0/3

[DeviceA-Ten-GigabitEthernet1/0/3] port service-loopback group 1

All configurations on the interface will be lost. Continue?[Y/N]:y

[DeviceA-Ten-GigabitEthernet1/0/3] quit

# 創建GRE模式的Tunnel接口0,并為其配置IP地址和掩碼。

[DeviceA] interface tunnel 0 mode gre

[DeviceA-Tunnel0] ip address 50.1.1.1 24

# 為Tunnel接口0分别指定源地址和目的地址。

[DeviceA-Tunnel0] source 20.1.1.1

[DeviceA-Tunnel0] destination 30.1.1.2

[DeviceA-Tunnel0] quit

# 配置OSPF協議。

[DeviceA] ospf 1

[DeviceA-ospf-1] area 0

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

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

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

[DeviceA-ospf-1] quit

# 創建本地鏡像組1。

[DeviceA] mirroring-group 1 local

# 配置本地鏡像組1的源端口為Ten-GigabitEthernet1/0/1,目的端口為Tunnel0。

[DeviceA] mirroring-group 1 mirroring-port ten-gigabitethernet 1/0/1 both

[DeviceA] mirroring-group 1 monitor-port tunnel 0

(3)配置Device B

# 配置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 30.1.1.0 0.0.0.255

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

[DeviceB-ospf-1] quit

(4)配置Device C

# 創建業務環回組1,并配置服務類型為Tunnel。

<DeviceC> system-view

[DeviceC] service-loopback group 1 type tunnel

# 将接口Ten-GigabitEthernet1/0/3加入業務環回組1。

[DeviceC] interface ten-gigabitethernet 1/0/3

[DeviceC-Ten-GigabitEthernet1/0/3]port service-loopback group 1

All configurations on the interface will be lost. Continue?[Y/N]:y

[DeviceC-Ten-GigabitEthernet1/0/3]quit

# 創建GRE模式的Tunnel接口0,并為其配置IP地址和掩碼。

[DeviceC] interface tunnel 0 mode gre

[DeviceC-Tunnel0] ip address 50.1.1.2 24

# 為Tunnel接口0分别指定源地址和目的地址。

[DeviceC-Tunnel0]source 30.1.1.2

[DeviceC-Tunnel0]destination 20.1.1.1

[DeviceC-Tunnel0]quit

# 配置OSPF協議。

[DeviceC]ospf 1

[DeviceC-ospf-1] area 0

[DeviceC-ospf-1-area-0.0.0.0] network 30.1.1.0 0.0.0.255

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

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

[DeviceC-ospf-1] quit

# 創建本地鏡像組1。

[DeviceC] mirroring-group 1 local

# 配置本地鏡像組1的源端口為Ten-GigabitEthernet1/0/1,目的端口為Ten-GigabitEthernet1/0/2。

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

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

上述配置方法為配置手冊中的配置案例,從上述配置過程中可以看出配置相當複雜,在鏡像源設備Device A上需要配置如下的功能:

1、配置業務環回組,将物理端口加入業務環回組,配置GRE類型的Tunel接口

2、本地鏡像,并且本地鏡像的出接口是GTE Tunne接口。

3、Tunnel接口指定了IP地址,并且指定了source 和destination ip地址

在鏡像目的設備上需要配置如下的功能:

1、配置業務環回組,将物理端口加入業務環回組,配置GRE類型的Tunel接口

2、本地鏡像,将GRE報文經過的物理端口作為鏡像源端口

3、配置Tunel接口,Tunnel接口指定了IP地址,并且指定了source和destination ip地址

上述配置方法鏡像源、目的設備上都需要占用業務環回端口,造成了物理端口的浪費,并且tunnel接口指定了ip地址,有些時候ip地址對于網絡來說非常珍貴。并且在鏡像目的設備上還需要配置本地鏡像,需要将鏡像目的設備上行口的流量全部鏡像給目的監控server,這樣肯定會把Device C這台交換機上行口的所有上行流量鏡像過去,這顯然是不合理且不可接受的。

那有啥好的方法可以解決上述問題嗎?

優化方案組網:

h3c多網口配置(S6800産品三層遠程端口鏡像典型配置案例)3

配置步驟:

(1)配置IP地址

配置各設備各接口的IP地址和子網掩碼,ip地址與常規配置組網方案中的一樣,具體配置過程略。

(2)配置Device A

# 創建業務環回組1,并配置服務類型為Tunnel。

<DeviceA> system-view

[DeviceA] service-loopback group 1 type tunnel

# 将接口Ten-GigabitEthernet1/0/3加入業務環回組1。

[DeviceA] interface ten-gigabitethernet 1/0/3

[DeviceA-Ten-GigabitEthernet1/0/3] port service-loopback group 1

All configurations on the interface will be lost. Continue?[Y/N]:y

[DeviceA-Ten-GigabitEthernet1/0/3] quit

# 創建GRE模式的Tunnel接口0,無需為其配置IP地址和掩碼。

[DeviceA] interface tunnel 0 mode gre

# 為Tunnel接口0分别指定源地址和目的地址,其中目的地址直接指定為監控Server的主機ip地址。

[DeviceA-Tunnel0] source 20.1.1.1

[DeviceA-Tunnel0] destination 40.1.1.2

[DeviceA-Tunnel0] quit

# 配置OSPF協議。

[DeviceA] ospf 1

[DeviceA-ospf-1] area 0

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

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

[DeviceA-ospf-1] quit

# 創建本地鏡像組1。

[DeviceA] mirroring-group 1 local

# 配置本地鏡像組1的源端口為Ten-GigabitEthernet1/0/1,目的端口為Tunnel0。

[DeviceA]mirroring-group 1 mirroring-port ten-gigabitethernet 1/0/1 both

[DeviceA] mirroring-group 1 monitor-port tunnel 0

(3)配置Device B

# 配置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 30.1.1.0 0.0.0.255

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

[DeviceB-ospf-1] quit

(4)配置Device C,注意這裡Device C上隻需配置OSPF協議即可,确保Server上配置ip地址40.1.1.2(加入Server上沒有配置IP地址,則在Device上配置靜态ARP表項,确保Device C上可以将目的地址是40.1.1.2的報文轉發給Server)

# 配置OSPF協議。

[DeviceC]ospf 1

[DeviceC-ospf-1] area 0

[DeviceC-ospf-1-area-0.0.0.0] network 30.1.1.0 0.0.0.255

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

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

[DeviceC-ospf-1] quit

通過上述配置,僅僅在鏡像源Device A上進行鏡像及業務環回組,tunnel相關的配置即可,在鏡像監控Server所在的主機上無需任何配置,隻要保證正常發布鏡像Server主機的路由,并且報文到鏡像目的主機可達即可。

直接在鏡像Server抓包即可抓取GRE封裝的報文,由于采用的是本地both鏡像可以抓取到如下的報文:

1、可以抓取Device A設備上XGE1/0/1端口inbound方向的單播報文、廣播及組播報文。

2、可以抓取Device A設備上XGE1/0/1端口outbound方向的單播報文、廣播及組播報文(含自身CPU發送OSPF組播的報文)。

1、鏡像源設備Device A上配置業務環回組,Tunnel端口,并且Tunnel接口的目的ip為鏡像Server的ip地址。

2、鏡像的目的接口為Tunnel口

3、配置業務環回口,否則Tunnel端口無法up。

,

更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!

查看全部

相关生活资讯推荐

热门生活资讯推荐

网友关注

Copyright 2023-2024 - www.tftnews.com All Rights Reserved