华为交换机端口镜像配置
华为交换机端口镜像配置
端口镜像
通过配置镜像功能,可以将报文复制到特定的目的地进行分析,以进行网络监控和故障定位。
镜像是指将经过指定端口(源端口或者镜像端口)的报文复制一份到另一个指定端口(目的端口或者观察端口)。
![](https://images2017.cnblogs.com/blog/1271786/201711/1271786-20171104113640091-59246892.png)
配置举例
1、 一对一本地端口镜像(一个监控设备监控一个端口)
![](https://images2017.cnblogs.com/blog/1271786/201711/1271786-20171104113710701-2111002663.png)
observe-port 1 interface GigabitEthernet1/0/2 // 观察口
#
interface GigabitEthernet1/0/1或者GigabitEthernet1/0/10 (上联口) //镜像口
port-mirroring to observe-port 1 inbound/outbound/both
2、多对一端口本地端口镜像(多个监控设备同时监控一个端口)
![](https://images2017.cnblogs.com/blog/1271786/201711/1271786-20171104113724748-1867539292.png)
方法一:(单个配置观察端口)
observe-port 1 interface GigabitEthernet1/0/2 //观察口1
observe-port 2 interface GigabitEthernet1/0/3 //观察口2
observe-port 3 interface GigabitEthernet1/0/4 //观察口3
#
interface GigabitEthernet1/0/1 或者 GigabitEthernet1/0/10 (上联口 ) //镜像口
port-mirroring to observe-port 1 inbound/outbound/both
port-mirroring to observe-port 2 inbound/outbound/both
port-mirroring to observe-port 3 inbound/outbound/both
方法二:(批量配置观察端口)
observe-port 1 interface-range GigabitEthernet1/0/2 to GigabitEthernet1/0/4 //端口2到4为观察口
#
interface GigabitEthernet1/0/1或者 GigabitEthernet1/0/10 (上联口) //镜像口
port-mirroring to observe-port 1 inbound/outbound/both
3、一对多端口镜像配置(一个监控设备监控多个端口)
![](https://images2017.cnblogs.com/blog/1271786/201711/1271786-20171104113752435-920414663.png)
observe-port 1 interface GigabitEthernet1/0/4 //观察口
#
interface GigabitEthernet1/0/1 //镜像口1
port-mirroring to observe-port 1 inbound/outbound/both
#
interface GigabitEthernet1/0/2 //镜像口2
port-mirroring to observe-port 1 inbound/outbound/both
#
interface GigabitEthernet1/0/3 //镜像口3
port-mirroring to observe-port 1 inbound/outbound/both
#
注:inbound、outbound可绑定的端口数量要根据设备、或者板卡的型号而定
如对您有帮助,支持下呗!
微信
![](https://files.cnblogs.com/files/Dev0ps/WeChat.gif)
支付宝
![](https://files.cnblogs.com/files/Dev0ps/Alipay.gif)