深圳市鸿华锐信息技术有限公司欢迎您!
服务创新提升价值!
百度地图| SiteMap| 知识库| 联系我们
全国服务热线:0755-88855786   深圳:13058107600

知识库

全国服务热线:
0755-88855786
深圳:
13058107600

思科|锐捷|迈普|华为|华三等常见厂商交换机端口镜像配置命令详细说明





1、H3C交换机网络设备镜像端口配置
命令格式:
mirroring-group 1 local 本地镜像组 1
mirroring-group 1 mirroring-port 源端端口 流量方向【入口input、出口ouput、双向both】
mirroring-group 1 monitor-port 目的端口

示例:
【创建本地镜像组 1】
mirroring-group 1 local 本地镜像组 1

【在本地镜像组1将 G1/0/1 设成镜像源端口,both为双向流量】
mirroring-group 1 mirroring-port GigabitEthernet 1/0/1 both

【在本地镜像组1将 G1/0/2 设成镜像源端口,both为双向流量】
mirroring-group 1 mirroring-port GigabitEthernet 1/0/2 both

mirroring-group 1 monitor-port GigabitEthernet 1/0/32
【在本地镜像组1将 G1/0/32 设成镜像目的端口,镜像上面G1/0/1和G1/0/32的流量】

disp cu查看源端口配置信息
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan all
mirroring-group 1 mirroring-port both

源端口G1/0/1
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan all
mirroring-group 1 mirroring-port both

目的端口G1/0/32截图
interface GigabitEthernet1/0/32
port link-mode bridge
mirroring-group 1 monitor-port

2、思科|锐捷|迈普交换机网络设备镜像端口配置
命令格式:
monitor session 1 filter packet-type good rx 创建session1组、并指定端口流量方向
monitor session 1 source interface 镜像源端口 流量方向【入口rx、出口tx、双向both】
monitor session 1 destination interface  目的端口 流量方向【入口rx、出口tx、双向both】

示例:
monitor session 1 source interface g1/0/1 rx
(上述命令的意思是将g1/0/1端口作为镜像源端口,后面的rx是入口方向流量,如果需要出口方向流量,将rx改成tx即可,如果业务环境不是特别清楚,写both也行,both代表双向流量;)

monitor session 1 destination interface g1/0/2
(上述命令的意思是将g1/0/2端口作为镜像目的端口)

monitor session 1 filter packet-type good rx
(上述命令的意思是指定session 1 组的流量方向)
【Tx指上行(传出),Rx指下行(传入),both指双向流量】


show monitor session 1
(上述命令的意思是通过show 命令查看session 1的配置)

3、华为交换机网络设备镜像端口配置
【华为的交换机配置镜像端口与之前的可能不太一样,需要进入到接口模式】
【部分华为网络设备也可以使用华三的配置命令、如果不行,请尝试以下配置方法】

命令格式:
int 10ge 端口名称  (进入接口)
ort-mirroring observe-port 1 inbound(设置为镜像源端口)
observe-port 1 interface 10ge 端口名称(设置为镜像目的端口)

示例:

int 10ge1/0/9 (源端口)

port-mirroring observe-port 1 inbound
(上述命令的意思是将ge1/0/9作为镜像源端口)

observe-port 1 interface 10ge 1/0/2 配置本地观察端口(目的端口)
commit
(上述命令的意思是将ge1/0/2作为镜像目的端口)

display observe-port
display port-mirroring
(上述命令的意思是配置完可通disp命令进行查看)


4、华为路由器

配置命令:
observe-prt interface Ethernet2/0/1  // 将端口 E2/0/1定义为观察端口。#
acl number 2000  // 用 ACL 匹配 IP 为 192.168.1.10 主机。
 rule 5 permit source 192.168.1.10 0
#
traffic classifier c1 operator or
 if-match acl 2000
#
traffic behavior b1
 mirror to observe-port
#
traffic policy p1  // 定义流策略,将 ACL 匹配的流量镜像到观察端口。
 classifier c1 behavior b1
#
interface Ethernet2/0/0
 traffic-policy p1 inbound  // 在镜像端口 E2/0/0 入方向应用流策略。

[AR1]dis cu
#
 sysname AR1
#
 observe-port interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/0
 ip address 192.168.1.254 255.255.255.0
 mirror to observe-port inbound
#
interface GigabitEthernet0/0/1
 ip address 10.0.12.1 255.255.255.0
#


本地端口镜像:

配置命令:
#
 observe-port interface Ethernet2/0/3  // 将 E2/0/3 接口配置为观察端口。
#
l nterface Ethernet2/0/1
 mirror to observe-port inbound  // 将 E2/0/1 接口配置为镜像端口,镜像所有入方向报文。
因为现在是主要针对办公区域进来的流量,去往外访问的流量,用的是inbound,所以在配置端口镜像的时候,得根据实际情况,去判断到底是用inbound还是outbound
#
interface Ethernet2/0/2
 mirror to observe-port inbound  // 将 E2/0/2 接口配置为镜像端口,镜像所有入方向报文。


原文链接:https://blog.csdn.net/weixin_42463871/article/details/106530559


QQ客服在线咨询
业务咨询:
223883921
QQ客服在线咨询
技术支持:
56802890
联系方式
联系电话:
0755-88855786
微信客服
扫码二维码
返回顶部
✉ 

留言