概述
端口镜像是指设备复制一份从镜像端口流经的报文,并将此报文传送到指定的观察端口进行分析和监控。
配置
配置分为大概以下三种1:1端口镜像,1:N端口镜像,N:1端口镜像
- 配置1:1端口镜像
一个镜像端口的报文复制到一个观察端口上。例如:将镜像端口GE0/0/48出和入方向的报文复制到观察端口GE0/0/41上。
<HUAWEI> system-view
[HUAWEI] observe-port 1 interface GE 0/0/41
[HUAWEI] interface GE0/0/48
[HUAWEI-GE0/0/48] port-mirroring to observe-port 1 both
(inbound/outbound/both将接口的收/发/收发双向流量都镜像给服务器的端口)
- 配置1:N端口镜像
将一个镜像端口的报文复制到N个不同的观察端口上。例如:将镜像端口GE0/0/41出和入方向的报文复制到观察端口GE0/0/43、GE0/0/45上。
<HUAWEI> system-view
[HUAWEI] observe-port 1 interface GE 0/0/43
[HUAWEI] observe-port 2 interface GE 0/0/45
[HUAWEI] interface GE 0/0/41
[HUAWEI-GE0/0/41] port-mirroring observe-port 1 both
[HUAWEI-GE0/0/41] port-mirroring observe-port 2 both
- 配置N:1端口镜像
将N个镜像端口的报文复制到同一个观察端口上。例如:将镜像端口GE0/0/41、GE0/0/43 出和入方向的报文复制到观察端口GE0/0/45上。
<HUAWEI> system-view
[HUAWEI] observe-port 1 interface GE0/0/45
[HUAWEI] interface GE0/0/41
[HUAWEI-GE0/0/41] port-mirroring observe-port 1 both
[HUAWEI] interface GE0/0/43
[HUAWEI-GE0/0/43] port-mirroring observe-port 1 both
display observe-port,查看镜像的观察端口
display port-mirroring,查看镜像的配置信息
删除配置的话,先删镜像配置,再删除观察口配置,否则会报错
注:配置比较简单,注意英文使用observe-port 观察口,监视口 port-mirroring 镜像口
之前发现写的不是很详细,可以再参考大佬写的链接: