Cisco交换机设备配置镜像端口

查看交换机端口的基本情况,输入命令 show ip int bri,可以查看端口状态

FastEthernet表示百兆以太网端口,GigabitEthernet表示千兆以太网端口。

进入全局模式

设置源镜像口,设置1到20口为源端口镜像

Switch(config)#monitor session 1 source interface gigabitEthernet 1/0/1- 20 both

这条命令的最后-与20之间有空格的。20后面的参数both,表示监听双向数据,20后面加上rx只监听接收数据,20后面加tx只监听发送数据。如果只镜像一个口的数据,直接写某个口

配置目的镜像口

Switch(config)#monitor session 1 destination interface gigabitEthernet 1/0/22

配置1/0/22口为目的镜像口

查看配置情况

Switch#show monitor 
Session 1
---------
Type : Local Session
Source Ports : 
Both : Gi1/0/1-20
Destination Ports : Gi1/0/22
Encapsulation : Native
Ingress : Disabled

删除镜像端口

Switch(config)#no monitor session 1
Switch(config)#end 
Switch#show monitor
No SPAN configuration is present in the system.

  

原文地址:https://www.cnblogs.com/chuyiwang/p/9992419.html