Command Line Reference
Network Management And Monitor...
Mirror Configuration
7 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] parameter description session id mirror session id, value range 1 6 port name interface name, support vlan interface and ethernet interface direction {rx|tx|both} direction of traffic to be mirroredrx is the entry directiontx is the outgoing directionboth is mirror in both directions {src ethernet|src vlan} the interface on which traffic needs to be mirrored {dst ethernet|dst vlan|dst link aggregation} the destination interface for mirrored traffic \[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] parameter description id mirror session id, valid range 1 6 port name interface name, supports vlan interfaces and ethernet interfaces direction {rx|tx|both} traffic direction to be mirrored rx inbound direction tx outbound direction both both directions, mirroring all traffic {src ethernet|src vlan} interface to be mirrored {dst ethernetdst link aggregation} destination interface for mirrored traffic vlan id rspan dedicated vlan for mirroring traffic \[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] parameter description id mirror session id, valid range 1 6 direction {rx|tx|both} traffic direction to be mirrored rx inbound direction tx outbound direction {src ethernet|src vlan} interface to be mirrored gre src ip a b c d/a b source ip for gre encapsulation gre dst ip a b c d/a b destination ip for gre encapsulation vrf name vrf for gre encapsulation, with the default vrf set to "default" \[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
