· 在一个三层网络中,Device A、Device B、Device C及Server如下图所示连接。其中,Device A通过端口Ten-GigabitEthernet1/0/1连接市场部。
· 通过配置三层远程端口镜像,并建立OSPF方式的GRE隧道,使得Server可以通过由GRE隧道传输的镜像报文来监控所有进、出市场部的报文。
2. 组网图图1-8 三层远程端口镜像配置组网图
3. 配置步骤
(1) 配置IP地址
请按照图1-8配置各接口的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
4. 验证配置# 显示Device A上所有镜像组的配置信息。
[DeviceA] display mirroring-group all
Mirroring group 1:
Type: Local
Status: Active
Mirroring port:
Ten-GigabitEthernet1/0/1 Both
Monitor port: Tunnel0
# 显示Device C上所有镜像组的配置信息。
[DeviceC] display mirroring-group all
Mirroring group 1:
Type: Local
Status: Active
Mirroring port:
Ten-GigabitEthernet1/0/1 Inbound
Monitor port: Ten-GigabitEthernet1/0/2
配置完成后,用户可以通过Server监控所有进、出市场部的报文。
,