更新时间:2023-12-08                  
                  
                  1.端口镜像配置命令
1.1 端口镜像配置命令
端口镜像配置命令有:
1.1.1 mirror
命令描述
[no] mirror session session_number {destination {interface interface-id } [ rspan vid [tpid]] | source {interface interface-id [, | -] [rx | tx | both] }
配置端口镜像。
参数
| 参数 | 参数说明 | 
| session_number  | 端口镜像编号。取值范围为1-4。 | 
| destination | 镜像目标端口信息。 | 
| vid | 远程镜像tag的vid | 
| tpid | 远程镜像tag的tpid | 
| source | 被镜像端口信息。 | 
| rx | tx | both | 要镜像的数据流。Rx表示只镜像输入数据,tx表示镜像输出数据。Both表示两者均镜像。 | 
缺省
无
说明
在全局配置模式下配置该命令。跨线卡/机框镜像只支持session 1。
示例
本地镜像:将端口g1/2作为端口g1/1的输出镜像。
Switch_config# mirror session 1 destination interface g1/2
Switch_config# mirror session 1 source interface g1/1
远程镜像:将端口g1/2作为端口g1/1的本地输出镜像端口,远程镜像vlan为100,tpid为0x8100.
Switch_config# mirror session 1 destination interface g1/2 rspan 100 0x8100
Switch_config# mirror session 1 source interface g1/1  
 
1.1.2 show mirror
命令描述
show mirror [session session_number] 
显示端口镜像信息。
参数
| 参数 | 参数说明 | 
| session_number | 端口镜像编号。取值范围为1-4。 | 
缺省
无
使用说明
使用该命令来显示端口镜像信息 。
示例
显示所有的端口镜像信息。
Switch# show mirror
Session 1
---------
Destination Ports: g1/1
Source Ports:
        RX Only:        None
        TX Only:        None
        Both:           g3/1