Related Documentation
- M Series
- Layer 2 Port Mirroring Overview
- MX Series
- Layer 2 Port Mirroring Overview
- Layer 2 Port Mirroring Named Instances
- Binding Layer 2 Port Mirroring to Ports Grouped at the FPC Level
- Binding Layer 2 Port Mirroring to Ports Grouped at the PIC Level
- Examples: Layer 2 Port-Mirroring at Multiple Levels of the Chassis
- Example: Layer 2 Port Mirroring with Multiple Instances
Defining a Named Instance of Layer 2 Port Mirroring
On an MX Series router, you can define a set of Layer 2 port-mirroring properties that you can bind to a particular Packet Forwarding Engine (at the PIC level of the router chassis) or to group of Packet Forwarding Engines (at the DPC or FPC level of the route chassis).
To define a named instance of Layer 2 port mirroring on an MX Series router:
Enable configuration of a named instance of Layer 2 port mirroring :
[edit]user@host# edit forwarding-options port-mirroring instance pm-instance-nameEnable configuration of the packet-sampling properties:
[edit forwarding-options port-mirroring instance pm-instance-name]user@host# edit inputSpecify packet-selection properties:
- The valid range is 1 through 65535.
Specify the number of packets to select:
[edit forwarding-options port-mirroring instance pm-instance-name input]user@host# set rate number - The valid range is 0 through 20. The default value is 0.
Specify the number of packets to mirror from each selection:
[edit forwarding-options port-mirroring instance pm-named-instance input]user@host# set run-length number
Note: The run-length statement is not supported on MX80 routers.
- The valid range is 0 through 9216. The default value is 0, which means the mirrored packets are not truncated.
Specify the length to which mirrored packets are to be truncated:
[edit forwarding-options port-mirroring instance pm-instance-name input]user@host# set maximum-packet-length number
Note: The maximum-packet-length statement is not supported on MX80 routers.
Enable configuration of the mirror destination properties for Layer 2 packets that are part of bridging domain, Layer 2 switching cross-connects, or virtual private LAN service (VPLS):
- The value of the family option can be bridge, ccc, or vpls.
Specify the Layer 2 address family type of traffic to be mirrored:
[edit forwarding-options port-mirroring instance pm-instance-name input]user@host# up[edit forwarding-options port-mirroring instance pm-instance-name]user@host# edit family family
Note: Under the [edit forwarding-options port-mirroring] hierarchy level, the protocol family statement family bridge is an alias for family vpls. The command-line interface (CLI) displays Layer 2 port-mirroring configurations as family vpls, even for Layer 2 port-mirroring configured as family bridge. Use family bridge when the physical interface is configured with encapsulation ethernet-bridge.
Enable configuration of the mirror destination properties:
[edit forwarding-options port-mirroring instance pm-instance-name family family]user@host# edit output
Specify mirror destination properties.
Specify the physical interface on which to send the mirrored packets:
[edit forwarding-options port-mirroring instance pm-instance-name family family output]user@host# set interface interface-name(Optional) Allow configuration of filters on the destination interface for the global port-mirroring instance:
[edit forwarding-options port-mirroring instance pm-instance-name family family output]user@host# set no-filter-check
Note: You cannot configure port mirroring instances on MX80 routers. You can only configure port mirroring at the global level on MX80 routers.
(Optional) Specify that any packets selected for mirroring are to be mirrored only once to any mirroring destination:
[edit forwarding-options port-mirroring instance pm-instance-name family family output]user@host# up 3[edit forwarding-options port-mirroring]user@host# set mirror-once
Tip: Enable the global mirror-once option when an MX Series router is configured to perform Layer 2 port mirroring at both ingress and egress interfaces, which could result in sending duplicate packets to the same destination (which in turn would complicate the analysis of the mirrored traffic).
- To configure a mirroring destination for a different packet family type, repeat steps 4 through 6.
Verify the minimum configuration of the named instances of Layer 2 port mirroring:
[edit forwarding-options ... ]user@host# top[edit]user@host# show forwarding-options forwarding-options {port-mirroring {... optional-global-port-mirroring-configuration ...instance {pm-instance-name ( # A named instance of port mirroringinput { # Packet-selection propertiesmaximum-packet-length number; # Default is 0.rate number; run-length number; } family (ccc | vpls) { # Address- type ’bridge’ displays as ’vpls’.output { # Mirror destination properties interface interface-name; no-filter-check; # Optional. Allow filters on interface.} }}}mirror-once; # Optional. Mirror destinations do not receive duplicate packets.}}
Related Documentation
- M Series
- Layer 2 Port Mirroring Overview
- MX Series
- Layer 2 Port Mirroring Overview
- Layer 2 Port Mirroring Named Instances
- Binding Layer 2 Port Mirroring to Ports Grouped at the FPC Level
- Binding Layer 2 Port Mirroring to Ports Grouped at the PIC Level
- Examples: Layer 2 Port-Mirroring at Multiple Levels of the Chassis
- Example: Layer 2 Port Mirroring with Multiple Instances

