Command Line Reference
Network Management And Monitor...
Mirror Configuration
5 min
mirror configuration 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 \[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(config)# mirror session 1 span sonic(config span mirror 1)# src ethernet 4 sonic(config span mirror 1)# dst ethernet 7 sonic(config span mirror 1)# 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(config)# mirror session 1 rspan sonic(config rspan mirror 1)# src ethernet 4 sonic(config rspan mirror 1)# dst ethernet 7 sonic(config rspan mirror 1)# remote vlan 100
