Command Line Reference
Network Management And Monitor...
Mirror Configuration
5 min
mirror configuration mirror configuration show mirror show mirror \[command] show mirror \[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 name \[command] mirror session id span \[direction {rx|tx|both}] {src ethernet|src vlan} port name {dst ethernet} port name no mirror session id span \[purpose] create a mirror session or add port to the mirror session \[parameter] parameter description id mirror session id, value range 1 6 interface name interface name, support vlan interface and ethernet interface direction {rx|tx|both} direction of traffic to be mirrored rx the entry direction tx the outgoing direction both mirror in both directions {src ethernet|src vlan} the interface on which traffic needs to be mirrored {dst ethernet} the destination interface for mirrored traffic \[view] system configuration view \[use cases] sonic# configure sonic(config)# mirror session 1 span direction both src ethernet 2 dst ethernet 3 mirror session id erspan mirror session id erspan \[command] mirror session id erspan \[direction {rx|tx|both}] {src ethernet} 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} interface to be mirrored gre src ip source ip for gre encapsulation gre dst ip 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 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 it should be noted that erspan needs to be configured after the destination ip actually takes effect for example, if the destination ip corresponds to a static arp, then the static arp needs to be configured first before configuring the erspan function \[use cases] sonic# configure sonic(config)# mirror session 1 erspan direction rx src ethernet 3 gre src ip 10 1 1 1 gre dst ip 30 1 1 2
