Command Line Reference
Network Management And Monitor...
Mirror Configuration
6 min
show mirror session show mirror session \[command] show mirror session \[ number ] \[purpose] show configuration related to mirror \[view] system view \[use cases] sonic# show mirror session + + + + + + \| session name | destination port | source port | type | direction | +==============+==================+=============+======+===========+ \| 1 | ethernet1 | ethernet2 | span | both | + + + + + + mirror session mirror session \[command] mirror session session id span \[direction {rx|tx|both}] {src ethernet|src vlan} port name {dst ethernet|dst vlan|dst link aggregation} port name no mirror session id span \[purpose] create a mirror session or add port to the mirror session \[parameter] true 227,434#2166ae #4283c7 unhandled content type #2166ae #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type \[view] system configuration view \[use cases] sonic# configure sonic(config)# mirror session 1 span direction both sonic(config)# mirror session 1 span src ethernet 1 dst ethernet 20 mirror session rspan mirror session rspan \[command] mirror session id rspan \[direction {rx|tx|both}] {src ethernet|src vlan} port name {dst ethernet|dst link aggregation} port name remote vlan vlan id no mirror session id rspan \[purpose] create a remote mirroring session or add source/destination interfaces to an existing mirroring session \[parameter] true 294,367#2166ae #4283c7 unhandled content type #2166ae #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type \[view] system view \[usage scenario] rspan's main function is to copy the traffic of ports on one switch to an analysis port on another remote switch, allowing network administrators to monitor and analyze traffic on the remote switch without direct access to the target device remote switched port analyzer (rspan) builds upon local port mirroring by encapsulating packets with a specified vlan, transmitting them through intermediate devices, and ultimately reaching the destination switch the vlan is then stripped off at the destination switch before being forwarded to the backend analyzer \[notes] as the rspan dedicated vlan, "remote vlan" is not recommended for other purposes the destination interface needs to be added to the "remote vlan " \[use cases] sonic# configure sonic(config)# mirror session 1 rspan direction rx sonic(config)# mirror session 1 rspan src ethernet 1 dst ethernet 20 remote vlan 200 mirror session erspan mirror session erspan \[command] mirror session id erspan \[direction {rx|tx|both}] {src ethernet|src vlan} port name gre src ip a b c d/a b gre dst ip a b c d/a b \[gre vrf vrf name ] no mirror session id erspan \[purpose] create a remote mirroring session and add the source and destination addresses for gre encapsulation \[parameter] true 199,462#2166ae #4283c7 unhandled content type #2166ae #4283c7 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type unhandled content type unhandled content type #d8e5f5 unhandled content type #d8e5f5 unhandled content type \[view] system view \[usage scenario] erspan is a layer 3 remote mirroring technology that duplicates packets from specified ports or vlans it sends the duplicated packets to a remote data monitoring device through a gre tunnel, allowing users to analyze these packets using the monitoring device for network monitoring and troubleshooting \[notes] to configure encapsulation parameters for layer 3 remote mirroring, you only need to specify the mirror source and destination port on the source device additionally, all devices must have a unicast routing protocol configured, ensuring a seamless layer 3 network between the devices \[use cases] sonic# configure sonic(config)# mirror session 1 erspan direction rx gre src ip 10 1 1 1 gre dst ip 30 1 1 2 src vlan 20
