On routing platforms containing an Internet Processor II ASIC, you can send a copy of an IPv4 packet from the routing platform to an external host address or a packet analyzer for analysis. This is known as port mirroring.
Port mirroring is different from traffic sampling. In traffic sampling, a sampling key based on the packet header is sent to the Routing Engine. There, the key can be placed in a file, or cflowd packets based on the key can be sent to a cflowd server. In port mirroring, the entire packet is copied and sent out through a next-hop interface.
One application for port mirroring sends a duplicate packet to a virtual tunnel. Then, a next-hop group can be configured to forward copies of this duplicate packet to several interfaces. For more information about next-hop groups, see Configuring a Next-Hop Group.
To configure port mirroring, include the port-mirroring statement at the [edit forwarding-options] hierarchy level:
- [edit forwarding-options]
-
port-mirroring {
-
- family (inet | inet6) {
-
- input {
- rate number;
- run-length number;
- }
-
- output {
-
- interface interface-name {
- next-hop address;
- }
- no-filter-check;
- }
- }
- }
To configure port mirroring, include the port-mirroring statement. To configure the address family, rate of sampling, and length of sampling for port mirroring, include the input statement. To specify on which interface to send duplicate packets and the next-hop address to send packets, include the output statement. To see if there are any filters on the specified interface, include the no-filter-check statement.
For information about the rate and run-length statements, see Configuring Traffic Sampling.
In typical applications, you send the sampled packets to an analyzer or a workstation for analysis, not to another router. If you must send this traffic over a network, you should use tunnels. For more information about tunnel interfaces, see the JUNOS Network Interfaces Configuration Guide.
Beginning with JUNOS release 9.3, port mirroring is supported for Layer 2 traffic on MX-series routers only. For information about how to configure, see the MX-series Layer 2 Configuration Guide.
The following restrictions apply: