Example: Passive Flow Monitoring Configuration
Figure 1: Passive Flow Monitoring—Topology Diagram

In Figure 1, traffic enters the monitoring station through interfaces so-0/0/0 and so-0/1/0. After the firewall filter accepts the traffic to be monitored, the packets enter a VRF instance.
The original packets travel within the VRF instance to the Monitoring Services PIC for flow processing. The final flow packets are sent from the monitoring services interfaces out the fe-3/0/0 interface to a flow server.
A copy of the accepted traffic is port-mirrored to the Tunnel PIC. As the copied packets enter the tunnel interface, a second firewall filter separates TCP and UDP packets and places them into two filter-based forwarding instances. The UDP instance directs the UDP packets to a packet analyzer attached to fe-3/2/0. The TCP instance sends the TCP packets to the ES PIC for encryption and the ES PIC sends the packets to a second packet analyzer connected to fe-3/2/1.
Your first step is to define a firewall filter to select packets for monitoring. All filtered traffic must be accepted, and the port-mirror statement at the [edit firewall family inet filter filter-name term term-name then] hierarchy level facilitates port mirroring.
Next, configure the input SONET/SDH interfaces and apply the firewall filter that you just defined. The passive-monitor-mode statement disables SONET keepalives on the SONET/SDH interfaces and enables passive flow monitoring.
Configure all other interfaces that you will use with the monitoring application, including the monitoring services interfaces, the export interfaces, the tunnel interface, and the ES interface. Once the interfaces are in place, configure a VRF instance and monitoring group to direct the original packets from the input interfaces to the monitoring services interfaces for processing. The resulting flow description packets exit fe-3/0/0 to reach the flow server.
Next, configure statements to port-mirror the monitored traffic to a tunnel interface. Design a firewall filter that selects some of this copied traffic for further analysis and some of the traffic for discarding. In this case, isolate TCP and UDP traffic and direct these two flows into separate filter-based forwarding routing instances. Remember to apply the filter to the tunnel interface to enable the separation of TCP traffic from UDP traffic. Also, import the interface routes into the forwarding instances with a routing table group.
In the filter-based forwarding instances, define static route next hops. The next hop for the TCP instance is the ES interface and the next hop for the UDP instance is the packet analyzer connected to fe-3/2/0. Finally, configure IPSec so that the next hop for the TCP traffic is the second packet analyzer attached to fe-3/2/1.
mo-4/2/0.1 mo-4/3/0.1];}}} tcp-routing-table { # This is the filter-based forwarding instance for TCP traffic.instance-type forwarding; routing-options { # The next hop is the ES PIC.static {route 0.0.0.0/0 next-hop es-3/1/0.0;}}}udp-routing-table { # This is the filter-based forwarding instance for UDP traffic.instance-type forwarding;routing-options { # The next hop is the second packet analyzer.static {route 0.0.0.0/0 next-hop 10.9.1.2;}}}}
Verifying Your Work
To verify that your configuration is correct, use the following commands on the monitoring station that is configured for passive flow monitoring:
- show route 0/0
- show passive-monitoring error
- show passive-monitoring flow
- show passive-monitoring memory
- show passive-monitoring status
- show passive-monitoring usage
To clear statistics for the show passive-monitoring error and show passive-monitoring flow commands, issue the clear passive-monitoring (all | interface-name) command.
You can also view passive flow monitoring status with the Simple Network Management Protocol (SNMP). The following Management Information Base (MIB) tables are supported:
- jnxPMonErrorTable—Corresponds to the show passive-monitoring error command.
- jnxPMonFlowTable—Corresponds to the show passive-monitoring flow command.
- jnxPMonMemoryTable—Corresponds to the show passive-monitoring memory command.
The following section shows the output of the show commands used with the configuration example:
user@mon-station> show route 0/0 <skip inet.0>
# We are only concerned with the routing-instance route.
bc-vrf.inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
bc-vrf.inet.0:+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 5d 17:34:57
via mo-4/0/0.1
> via mo-4/1/0.1
via mo-4/2/0.1
via mo-4/3/0.1
tcp-rt.inet.0: 13 destinations, 13 routes (12 active, 0 holddown, 1
hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 19:24:39
> via es-3/1/0.0
: <other interface routes>
udp-rt.inet.0: 13 destinations, 13 routes (12 active, 0 holddown, 1
hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 19:24:39
> to 10.9.1.2 via fe-3/2/0.0
: <other interface routes>
![]() | Note: For all show passive-monitoring commands, the output obtained when using a wildcard (such as *) or the all option is based on the configured interfaces listed at the [edit forwarding-options monitoring group-name] hierarchy level. In the output from the configuration example, you see information only for the configured interfaces mo-4/0/0, mo-4/1/0, mo-4/2/0, and mo-4/3/0. Many of the statements you can configure in a monitoring group, such as engine-id and engine-type, are visible in the output of the show passive-monitoring commands. |
Table 1: Output Fields for the show passive-monitoring error Command
Field | Explanation |
|---|---|
Packets dropped (no memory) | Number of packets dropped because of memory. |
Packets dropped (not IP) | Number of non-IP packets dropped. |
Packets dropped (not IPv4) | Number of packets dropped because they failed the IPv4 check. |
Packets dropped (header too small) | Number of packets dropped because the packet length or IP header length was too small. |
Memory allocation failures | Number of flow record memory allocation failures. A small number reflects failures to replenish the free list. A large number indicates the monitoring station is almost out of memory space. |
Memory free failures | Number of flow record memory frees. |
Memory free list failures | Number of flow records received from free list that failed. Memory is nearly exhausted or too many new flows greater than 128K are being created in one second. |
Memory warning | The flows have exceeded 1 million packets per second (Mpps) on a Monitoring Services PIC or 2 Mpps on a Monitoring Services II PIC. The response can be Yes or No. |
Memory overload | The memory has been overloaded. The response is Yes or No. |
PPS overload | In packets per second, whether the PIC is receiving more traffic than the configured threshold. The response can be Yes or No. |
BPS overload | In bytes per second, whether the PIC is receiving more traffic than the configured threshold. The response can be Yes or No. |
user@mon-station> show passive-monitoring
error all Passive monitoring interface: mo-4/0/0, Local interface index: 44
Error information
Packets dropped (no memory): 0, Packets dropped (not IP): 0
Packets dropped (not IPv4): 0, Packets dropped (header too small): 0
Memory allocation failures: 0, Memory free failures: 0
Memory free list failures: 0
Memory warning: No, Memory overload: No, PPS overload: No, BPS overload: No
Passive monitoring interface: mo-4/1/0, Local interface index: 45
Error information
Packets dropped (no memory): 0, Packets dropped (not IP): 0
Packets dropped (not IPv4): 0, Packets dropped (header too small): 0
Memory allocation failures: 0, Memory free failures: 0
Memory free list failures: 0
Memory warning: No, Memory overload: No, PPS overload: No, BPS overload: No
Passive monitoring interface: mo-4/2/0, Local interface index: 46
Error information
Packets dropped (no memory): 0, Packets dropped (not IP): 0
Packets dropped (not IPv4): 0, Packets dropped (header too small): 0
Memory allocation failures: 0, Memory free failures: 0
Memory free list failures: 0
Memory warning: No, Memory overload: No, PPS overload: No, BPS overload: No
Passive monitoring interface: mo-4/3/0, Local interface index: 47
Error information
Packets dropped (no memory): 0, Packets dropped (not IP): 0
Packets dropped (not IPv4): 0, Packets dropped (header too small): 0
Memory allocation failures: 0, Memory free failures: 0
Memory free list failures: 0
Memory warning: No, Memory overload: No, PPS overload: No, BPS overload: No
Table 2: Output Fields for the show passive-monitoring flow Command
Field | Explanation |
|---|---|
Flow packets | Number of packets received by an operational PIC. |
Flow bytes | Number of bytes received by an operational PIC. |
Flow packets 10-second rate | Number of packets per second handled by the PIC and displayed as a 10-second average. |
Flow bytes 10-second rate | Number of bytes per second handled by the PIC and displayed as a 10-second average. |
Active flows | Number of currently active flows tracked by the PIC. |
Total flows | Total number of flows received by an operational PIC. |
Flows exported | Total number of flows exported by an operational PIC. |
Flows packets exported | Total number of flow packets exported by an operational PIC. |
Flows inactive timed out | Total number of flows that are exported because of inactivity. |
Flows active timed out | Total number of long-lived flows that are exported because of an active timeout. |
user@mon-station> show passive-monitoring
flow all Passive monitoring interface: mo-4/0/0, Local interface index: 44
Flow information
Flow packets: 6533434, Flow bytes: 653343400
Flow packets 10-second rate: 0, Flow bytes 10-second rate: 0
Active flows: 0, Total flows: 1599
Flows exported: 1599, Flows packets exported: 55
Flows inactive timed out: 1599, Flows active timed out: 0
Passive monitoring interface: mo-4/1/0, Local interface index: 45
Flow information
Flow packets: 6537780, Flow bytes: 653778000
Flow packets 10-second rate: 0, Flow bytes 10-second rate: 0
Active flows: 0, Total flows: 1601
Flows exported: 1601, Flows packets exported: 55
Flows inactive timed out: 1601, Flows active timed out: 0
Passive monitoring interface: mo-4/2/0, Local interface index: 46
Flow information
Flow packets: 6529259, Flow bytes: 652925900
Flow packets 10-second rate: 0, Flow bytes 10-second rate: 0
Active flows: 0, Total flows: 1599
Flows exported: 1599, Flows packets exported: 55
Flows inactive timed out: 1599, Flows active timed out: 0
Passive monitoring interface: mo-4/3/0, Local interface index: 47
Flow information
Flow packets: 6560741, Flow bytes: 656074100
Flow packets 10-second rate: 0, Flow bytes 10-second rate: 0
Active flows: 0, Total flows: 1598
Flows exported: 1598, Flows packets exported: 55
Flows inactive timed out: 1598, Flows active timed out: 0
Table 3: Output Fields for the show passive-monitoring memory Command
Field | Explanation |
|---|---|
Allocation count | Number of flow records allocated. |
Free count | Number of flow records freed. |
Maximum allocated | Maximum number of flow records allocated since the monitoring station booted. This number represents the peak number of flow records allocated at a time. |
Allocations per second | Flow records allocated per second during the last statistics interval on the PIC. |
Frees per second | Flow records freed per second during the last statistics interval on the PIC. |
Total memory used | Total amount of memory currently used (in bytes). |
Total memory free | Total amount of memory currently free (in bytes). |
user@mon-station> show
passive-monitoring memory allPassive monitoring interface: mo-4/0/0, Local interface index: 44
Memory utilization
Allocation count: 1600, Free count: 1599, Maximum allocated: 1600
Allocations per second: 3200, Frees per second: 1438
Total memory used (in bytes): 103579176, Total memory free (in bytes): 163914184
Passive monitoring interface: mo-4/1/0, Local interface index: 45
Memory utilization
Allocation count: 1602, Free count: 1601, Maximum allocated: 1602
Allocations per second: 3204, Frees per second: 1472
Total memory used (in bytes): 103579176, Total memory free (in bytes): 163914184
Passive monitoring interface: mo-4/2/0, Local interface index: 46
Memory utilization
Allocation count: 1600, Free count: 1599, Maximum allocated: 1600
Allocations per second: 3200, Frees per second: 1440
Total memory used (in bytes): 103579176, Total memory free (in bytes): 163914184
Passive monitoring interface: mo-4/3/0, Local interface index: 47
Memory utilization
Allocation count: 1599, Free count: 1598, Maximum allocated: 1599
Allocations per second: 3198, Frees per second: 1468
Total memory used (in bytes): 103579176, Total memory free (in bytes): 163914184
Table 4: Output Fields for the show passive-monitoring status Command
Field | Explanation |
|---|---|
Interface state | Indicates whether the interface is monitoring (operating properly), disabled (administratively disabled), or not monitoring (not configured). |
Group index | Integer that represents the monitoring group of which the PIC is a member. (This does not indicate the number of monitoring groups.) |
Export interval | Configured export interval for flow records, in seconds. |
Export format | Configured export format (only v5 is currently supported). |
Protocol | Protocol the PIC is configured to monitor (only IPv4 is currently supported). |
Engine type | Configured engine type that is inserted in output flow packets. |
Engine ID | Configured engine ID that is inserted in output flow packets. |
Route record count | Number of routes recorded. |
IFL to SNMP index count | Number of logical interfaces mapped to an SNMP index. |
AS count | Number of AS boundaries that the flow has crossed. |
Time set | Indicates whether the time stamp is in place. |
Configuration set | Indicates whether the monitoring configuration is set. |
Route record set | Indicates whether routes are being recorded. |
IFL SNMP map set | Indicates whether logical interfaces are being mapped to an SNMP index. |
user@mon-station> show passive-monitoring
status all Passive monitoring interface: mo-4/0/0, Local interface index: 44 Interface state: Monitoring Group index: 0 Export interval: 15 secs, Export format: cflowd v5 Protocol: IPv4, Engine type: 1, Engine ID: 1 Route record count: 13, IFL to SNMP index count: 30, AS count: 1 Time set: Yes, Configuration set: Yes Route record set: Yes, IFL SNMP map set: Yes Passive monitoring interface: mo-4/1/0, Local interface index: 45 Interface state: Monitoring Group index: 0 Export interval: 15 secs, Export format: cflowd v5 Protocol: IPv4, Engine type: 1, Engine ID: 2 Route record count: 13, IFL to SNMP index count: 30, AS count: 1 Time set: Yes, Configuration set: Yes Route record set: Yes, IFL SNMP map set: Yes Passive monitoring interface: mo-4/2/0, Local interface index: 46 Interface state: Monitoring Group index: 0 Export interval: 15 secs, Export format: cflowd v5 Protocol: IPv4, Engine type: 1, Engine ID: 3 Route record count: 13, IFL to SNMP index count: 30, AS count: 1 Time set: Yes, Configuration set: Yes Route record set: Yes, IFL SNMP map set: Yes Passive monitoring interface: mo-4/3/0, Local interface index: 47 Interface state: Monitoring Group index: 0 Export interval: 15 secs, Export format: cflowd v5 Protocol: IPv4, Engine type: 1, Engine ID: 4 Route record count: 13, IFL to SNMP index count: 30, AS count: 1 Time set: Yes, Configuration set: Yes Route record set: Yes, IFL SNMP map set: Yes
Table 5: Output Fields for the show passive-monitoring usage Command
Field | Explanation |
|---|---|
Uptime | Time, in milliseconds, that the PIC has been operational. |
Interrupt time | Cumulative time that the PIC spent in processing packets since the last PIC reset. |
Load (5 second) | CPU load on the PIC averaged over 5 seconds. The number is a percentage obtained by dividing the time spent on active tasks by the total elapsed time. |
Load (1 minute) | CPU load on the PIC averaged over 1 minute. The number is a percentage obtained by dividing the time spent on active tasks by the total elapsed time. |
user@mon-station> show passive-monitoring
usage * Passive monitoring interface: mo-4/0/0, Local interface index: 44
CPU utilization
Uptime: 653155 milliseconds, Interrupt time: 40213754 microseconds
Load (5 second): 20%, Load (1 minute): 17%
Passive monitoring interface: mo-4/1/0, Local interface index: 45
CPU utilization
Uptime: 652292 milliseconds, Interrupt time: 40223178 microseconds
Load (5 second): 22%, Load (1 minute): 15%
Passive monitoring interface: mo-4/2/0, Local interface index: 46
CPU utilization
Uptime: 649491 milliseconds, Interrupt time: 40173645 microseconds
Load (5 second): 22%, Load (1 minute): 10098862%
Passive monitoring interface: mo-4/3/0, Local interface index: 47
CPU utilization
Uptime: 657328 milliseconds, Interrupt time: 40368704 microseconds
Load (5 second): 1%, Load (1 minute): 15%

