Defining a Layer 2 Port-Mirroring Firewall Filter
For virtual private LAN service (VPLS) traffic (family bridge or family vpls) and for Layer 2 VPNs with family cccon MX Series routers and on EX Series switches only, you can define a firewall filter that specifies Layer 2 port mirroring as the action to be performed if a packet matches the conditions configured in the firewall filter term
You can use a Layer 2 port-mirroring firewall filter in the following ways:
To mirror packets received or sent on a logical interface.
To mirror packets forwarded or flooded to a bridge domain.
To mirror packets forwarded or flooded to a VPLS routing instance.
To mirror tunnel interface input packets only to multiple destinations.
For a summary of the three types of Layer 2 port-mirroring you can configure on an MX Series router, see Application of Layer 2 Port Mirroring Types.
To define a firewall filter with a Layer 2 port-mirroring action:
- The value of the family option can be bridge,ccc, or vpls.
Enable configuration of firewall filters for Layer 2 packets that are part of a bridge domain, a Layer 2 switching cross-connect, or a virtual private LAN service (VPLS):
[edit]user@host# edit firewall family family Enable configuration of a firewall filter pm-filter-name:
[edit firewall family family]user@host# edit filter pm-filter-nameEnable configuration of a firewall filter term pm-filter-term-name:
[edit firewall family family filter pm-filter-name]user@host# edit term pm-filter-term-name- (Optional) Specify the firewall filter match conditions
based on the route source address only if you want to mirror a subset of the sampled packets.
For detailed information about Layer 2 bridging firewall filter match conditions (which are supported on MX Series routers only), see Firewall Filter Match Conditions for Layer 2 Bridging Traffic.
For detailed information about VPLS firewall filter match conditions, see Firewall Filter Match Conditions for VPLS Traffic.
For detailed information about Layer 2 circuit cross-connect (CCC) firewall filter match conditions, see Firewall Filter Match Conditions for Layer 2 CCC Traffic.
Note If you want all sampled packets to be considered to match (and be subjected to the actions specified in the then statement), then omit the from statement altogether.
Enable configuration of the action and action-modifier to apply to matching packets:
[edit firewall family family filter pm-filter-name term pm-filter-term-name]user@host# edit then- The recommended value for the action is accept. If you do not specify an action, or if you omit the then statement entirely, all packets that match the conditions in the from statement are accepted.
Specify the actions to be taken on matching packets:
[edit firewall family family filter pm-filter-name term pm-filter-term-name then]user@host# set action Specify Layer 2 port mirroring or a next-hop group as the action-modifier:
To reference the Layer 2 port mirroring properties currently in effect for the Packet Forwarding Engine or PIC associated with the underlying physical interface, use the port-mirror statement:
[edit firewall family family filter pm-filter-name term pm-filter-term-name then]user@host# set port-mirrorTo reference the Layer 2 port mirroring properties configured in a specific named instance, use the port-mirror-instance pm-instance-name action modifier:
[edit firewall family family filter pm-filter-name term pm-filter-term-name then]user@host# set port-mirror-instance pm-instance-nameIf the underlying physical interface is not bound to a named instance of Layer 2 port mirroring but instead is implicitly bound to the global instance of Layer 2 port mirroring, then traffic at the logical interface is mirrored according to the properties specified in the named instance referenced by the port-mirror-instance action modifier.
To reference a next-hop group that specifies the next-hop addresses (for sending additional copies of packets to an analyzer), use the next-hop-group pm-next-hop-group-name action modifier:
[edit firewall family family filter pm-filter-name term pm-filter-term-name then]user@host# set next-hop-group pm-next-hop-group-nameFor configuration information about next-hop groups, see Defining a Next-Hop Group for Layer 2 Port Mirroring. If you specify a next-hop group for Layer 2 port mirroring, the firewall filter term applies to the tunnel interface input only.
- In the firewall filter term then statement, the action-modifier can be port-mirror, port-mirror-instance , or next-hop-group pm-next-hop-group-name.
Verify the minimum configuration of the Layer 2 port-mirroring firewall filter:
[edit firewall ... ]user@host# top[edit]user@host# show firewallfamily (bridge | ccc | mpls | vpls) { # Type of packets to mirrorfilter pm-filter-name { # Firewall filter nameterm pm-filter-term-name {from { # Do not specify match conditions based on route source address}then {action; # Recommended action is ’accept’action-modifier; # Three options for Layer 2 port mirroring}}}}