switch as mirror port

switch as mirror port

Example: Port 1 of the switch is used as the observation port, connect to the PC and use wireshark to capture packets.
Ports 3~13 are the ports to capture packets

H3C switch

[H3C]mirroring-group 1 local   //创建本地镜像端口组1
[H3C]mirroring-group 1 mirroring-port GigabitEthernet 1/0/3 to GigabitEthernet 1/0/13 both  //配置镜像端口3-13,both:监控入方向和出方向
[H3C]mirroring-group 1 monitor-port GigabitEthernet 1/0/1  //配置1口为镜像组1的观察口
##查看端口镜像配置
[H3C]dis mirroring-group all

insert image description here

Huawei switch

[SW1]observe-port 1 interface GigabitEthernet 0/0/1 //配置1口为观察口1
[SW1]int gig 0/0/3 //进入3口
[SW1-GigabitEthernet0/0/3]port-mirroring to observe-port 1 both //把3口的出入流量镜像到观察口1
[SW1]port-group group-member GigabitEthernet 0/0/4 to GigabitEthernet 0/0/13 //临时选择4-13口
[SW1-port-group]port-mirroring to observe-port 1 both   //把4-13口的出入流量都镜像到观察口1口
##查看端口镜像配置
[H3C]dis port-mirroring

insert image description here

Cisco switch

SW1<config>#monitor session 1 source interface gigabitEthernet 1/0/3- 13
SW1<config>#monitor session 1 destination interface gigabitEthernet 1/0/1
##查看端口镜像配置
SW1#show monitor

insert image description here

Guess you like

Origin blog.csdn.net/qq_42906357/article/details/123707622