Because the CLI is a superset of the J-Web interface, you can perform certain tasks only through the CLI. For an overview of the CLI operational mode commands, along with instructions for filtering command output, see CLI Diagnostic Commands Overview.
This section contains the following topics:
Use the CLI ping command to verify that a host can be reached over the network. This command is useful for diagnosing host and network connectivity problems. The device sends a series of ICMP echo (ping) requests to a specified host and receives ICMP echo responses.
Alternatively, you can use the J-Web interface. (See Using the J-Web Ping Host Tool.)
Enter the ping command with the following syntax. Table 204 describes the ping command options.
user@host> ping host <interface source-interface> <bypass-routing> <count number> <do-not-fragment> <inet | inet6> <interval seconds> <loose-source [hosts]> <no-resolve> <pattern string> <rapid> <record-route> <routing-instance routing-instance-name> <size bytes> <source source-address> <strict> <strict-source [hosts]> <tos number> <ttl number> <wait seconds> <detail> <verbose>
To quit the ping command, press Ctrl-C.
Table 204: CLI ping Command Options
Following is sample output from a ping command:
user@host> ping host3 count 4
PING host3.site.net (176.26.232.111): 56 data bytes 64 bytes from 176.26.232.111: icmp_seq=0 ttl=122 time=0.661 ms 64 bytes from 176.26.232.111: icmp_seq=1 ttl=122 time=0.619 ms 64 bytes from 176.26.232.111: icmp_seq=2 ttl=122 time=0.621 ms 64 bytes from 176.26.232.111: icmp_seq=3 ttl=122 time=0.634 ms --- host3.site.net ping statistics --- 4 packets transmitted, 4 packets received, 0% packet loss round-trip min/avg/max/stddev = 0.619/0.634/0.661/0.017 ms
The fields in the display are the same as those displayed by the J-Web ping host diagnostic tool. For information, see Ping Host Results and Output Summary.
Use the ping mpls commands to diagnose the state of LSPs, Layer 2 and Layer 3 VPNs, and Layer 2 circuits. When you issue a command from a J Series device operating as the inbound node at the entry point of an LSP or VPN, the router sends probe packets into the LSP or VPN. Based on how the LSP or VPN outbound node at the remote endpoint of the connection replies to the probes, you can determine the connectivity of the LSP or VPN.
Each probe is an echo request sent to the LSP or VPN exit point as an MPLS packet with a UDP payload. If the outbound node receives the echo request, it checks the contents of the probe and returns a value in the UDP payload of the response packet. If the J Series device receives the response packet, it reports a successful ping response. Responses that take longer than 2 seconds are identified as failed probes.
Alternatively, you can use the J-Web ping MPLS tool. For more information, see Checking MPLS Connections from the J-Web Interface.
Before using ping mpls commands in your network, read Ping MPLS Preparation.
The ping mpls commands diagnose the connectivity of MPLS and VPN networks in the following ways:
Enter the ping mpls command with the following syntax. Table 205 describes the ping mpls command options.
user@host> ping mpls (ldp fec | lsp-end-point prefix-name | rsvp lsp-name) <exp forwarding-class> <count number> <source source-address> <detail>
To quit the ping mpls command, press Ctrl-C.
Alternatively, you can use the J-Web interface. (See Checking MPLS Connections from the J-Web Interface.)
Table 205: CLI ping mpls ldp and ping mpls lsp-end-point Command Options
Following is sample output from a ping mpls command:
user@host> ping mpls rsvp count 5
!!xxx --- lsping statistics --- 5 packets transmitted, 2 packets received, 60% packet loss 3 packets received with error status, not counted as received.
The fields in the display are the same as those displayed by the J-Web ping MPLS diagnostic tool. For information, see Ping MPLS Results and Output.
Enter the ping mpls l3vpn command with the following syntax. Table 206 describes the ping mpls l3vpn command options.
user@host> ping mpls l3vpn prefix prefix-name <l3vpn-name> <bottom-label-ttl> <exp forwarding-class> <count number> <source source-address> <detail>
To quit the ping mpls l3vpn command, press Ctrl-C.
Alternatively, you can use the J-Web interface. (See Checking MPLS Connections from the J-Web Interface.)
Table 206: CLI ping mpls l3vpn Command Options
Following is sample output from a ping mpls l3vpn command:
user@host> ping mpls l3vpn vpn1 prefix
10.255.245.122/32
!!!!! --- lsping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss
The fields in the display are the same as those displayed by the J-Web ping MPLS diagnostic tool. For information, see Ping MPLS Results and Output.
Enter the ping mpls l2vpn command with the following syntax. Table 207 describes the ping mpls l2vpn command options.
user@host> ping mpls l2vpn interface interface-name | instance l2vpn-instance-name local-site-id local-site-id-number remote-site-id remote-site-id-number <bottom-label-ttl> <exp forwarding-class> <count number> <source source-address> <detail>
To quit the ping mpls l2vpn command, press Ctrl-C.
Alternatively, you can use the J-Web interface. (See Checking MPLS Connections from the J-Web Interface.)
Table 207: CLI ping mpls l2vpn Command Options
Following is sample output from a ping mpls l2vpn command:
user@host> ping mpls l2vpn instance
vpn1 remote-site-id 1 local-site-id 2 detail
Request for seq 1, to interface 68, labels <800001, 100176> Reply for seq 1, return code: Egress-ok Request for seq 2, to interface 68, labels <800001, 100176> Reply for seq 2, return code: Egress-ok Request for seq 3, to interface 68, labels <800001, 100176> Reply for seq 3, return code: Egress-ok Request for seq 4, to interface 68, labels <800001, 100176> Reply for seq 4, return code: Egress-ok Request for seq 5, to interface 68, labels <800001, 100176> Reply for seq 5, return code: Egress-ok --- lsping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss
The fields in the display are the same as those displayed by the J-Web ping MPLS diagnostic tool. For information, see Ping MPLS Results and Output.
Enter the ping mpls l2circuit command with the following syntax. Table 208 describes the ping mpls l2circuit command options.
user@host> ping mpls l2circuit (interface interface-name | virtual-circuit neighbor prefix-name virtual-circuit-id) <exp forwarding-class> <count number> <source source-address> <detail>
To quit the ping mpls l2circuit command, press Ctrl-C.
Alternatively, you can use the J-Web interface. (See Checking MPLS Connections from the J-Web Interface.)
Table 208: CLI ping mpls l2circuit Command Options
Following is sample output from a ping mpls l2circuit command:
user@host> ping mpls l2circuit interface
fe-1/0/0.0
Request for seq 1, to interface 69, labels <100000, 100208> Reply for seq 1, return code: Egress-ok, time: 0.439 ms
The fields in the display are the same as those displayed by the J-Web ping MPLS diagnostic tool. For information, see Ping MPLS Results and Output.
Use the CLI traceroute command to display a list of routers between the device and a specified destination host. This command is useful for diagnosing a point of failure in the path from the device to the destination host, and addressing network traffic latency and throughput problems.
The device generates the list of routers by sending a series of ICMP traceroute packets in which the time-to-live (TTL) value in the messages sent to each successive router is incremented by 1. (The TTL value of the first traceroute packet is set to 1.) In this manner, each router along the path to the destination host replies with a Time Exceeded packet from which the source IP address can be obtained.
Alternatively, you can use the J-Web interface. (See Tracing Unicast Routes from the J-Web Interface .)
The traceroute monitor command combines ping and traceroute functionality to display real-time monitoring information about each router between the J Series device and a specified destination host.
This section contains the following topics. For more information about traceroute commands, see the JUNOS System Basics and Services Command Reference.
To display a list of routers between the device and a specified destination host, enter the traceroute command with the following syntax. Table 209 describes the traceroute command options.
user@host> traceroute host <interface interface-name> <as-number-lookup> <bypass-routing> <gateway address> <inet | inet6> <no-resolve> <routing-instance routing-instance-name> <source source-address> <tos number> <ttl number> <wait seconds>
To quit the traceroute command, press Ctrl-C.
Table 209: CLI traceroute Command Options
Following is sample output from a traceroute command:
user@host> traceroute host2
traceroute to 173.24.232.66 (172.24.230.41), 30 hops max, 40 byte packets 1 173.18.42.253 (173.18.42.253) 0.482 ms 0.346 ms 0.318 ms 2 host4.site1.net (173.18.253.5) 0.401 ms 0.435 ms 0.359 ms 3 host5.site1.net (173.18.253.5) 0.401 ms 0.360 ms 0.357 ms 4 173.24.232.65 (173.24.232.65) 0.420 ms 0.456 ms 0.378 ms 5 173.24.232.66 (173.24.232.66) 0.830 ms 0.779 ms 0.834 ms
The fields in the display are the same as those displayed by the J-Web traceroute diagnostic tool. For information, see Traceroute Results and Output Summary.
To display real-time monitoring information about each router between the J Series device and a specified destination host, enter the traceroute monitor command with the following syntax. Table 210 describes the traceroute monitor command options.
user@host> traceroute monitor host <count number> <inet | inet6> <interval seconds> <no-resolve> <size bytes><source source-address> <summary>
To quit the traceroute monitor command, press Q.
Table 210: CLI traceroute monitor Command Options
Following is sample output from a traceroute monitor command:
user@host> traceroute
monitor host2
My traceroute [v0.69] host (0.0.0.0)(tos=0x0 psize=64 bitpattern=0x00) Wed Mar 14 23:14:11 2007 Keys: Help Display mode Restart statistics Order of fields quit Packets Pings Host Loss% Snt Last Avg Best Wrst StDev 1. 173.24.232.66 0.0% 5 9.4 8.6 4.8 9.9 2.1 2. 173.24.232.66 0.0% 5 7.9 17.2 7.9 29.4 11.0 3. 173.24.232.66 0.0% 5 9.9 9.3 8.7 9.9 0.5 4. 173.24.232.66 0.0% 5 9.9 9.8 9.5 10.0 0.2
Table 211 summarizes the output fields of the display.
Table 211: CLI traceroute monitor Command Output Summary
Use CLI mtrace commands to trace information about multicast paths. The mtrace from-source command displays information about a multicast path from a source to the J Series device. The mtrace monitor command monitors and displays multicast trace operations.
This section contains the following topics. For more information about mtrace commands, see the JUNOS System Basics and Services Command Reference.
To display information about a multicast path from a source to the J Series device, enter the mtrace from-source command with the following syntax. Table 212 describes the mtrace from-source command options.
user@host> mtrace from-source source host <extra-hops number> <group address> <interval seconds> <max-hops number> <max-queries number> <response host> <routing-instance routing-instance-name> <ttl number> <wait-time seconds> <loop> <multicast-response | unicast-response> <no-resolve> <no-router-alert> <brief | detail>
Table 212: CLI mtrace from-source Command Options
Following is sample output from the mtrace from-source command:
user@host> mtrace from-source source
192.1.4.1 group 224.1.1.1
Mtrace from 192.1.4.1 to 192.1.30.2 via group 224.1.1.1 Querying full reverse path... * * 0 ? (192.1.30.2) -1 ? (192.1.30.1) PIM thresh^ 1 -2 routerC.mycompany.net (192.1.40.2) PIM thresh^ 1 -3 hostA.mycompany.net (192.1.4.1) Round trip time 22 ms; total ttl of 2 required. Waiting to accumulate statistics...Results after 10 seconds: Source Response Dest Overall Packet Statistics For Traffic From 192.1.4.1 192.1.30.2 Packet 192.1.4.1 To 224.1.1.1 v __/ rtt 16 ms Rate Lost/Sent = Pct Rate 192.168.195.37 192.1.40.2 routerC.mycompany.net v ^ ttl 2 0/0 = -- 0 pps 192.1.40.1 192.1.30.1 ? v \__ ttl 3 ?/0 0 pps 192.1.30.2 192.1.30.2 Receiver Query Source
Each line of the trace display is usually in the following format (depending on the options selected and the responses from the routers along the path):
hop-number host (ip-address) protocolttl
Table 213 summarizes the output fields of the display.
![]() |
Note: The packet statistics gathered from Juniper Networks routers and routing nodes are always displayed as 0. |
Table 213: CLI mtrace from-source Command Output Summary
To monitor and display multicast trace operations, enter the mtrace monitor command:
user@host> mtrace monitor
Mtrace query at Apr 21 16:00:54 by 192.1.30.2, resp to 224.0.1.32, qid 2a83aa packet from 192.1.30.2 to 224.0.0.2 from 192.1.30.2 to 192.1.4.1 via group 224.1.1.1 (mxhop=60) Mtrace query at Apr 21 16:00:57 by 192.1.30.2, resp to 224.0.1.32, qid 25dc17 packet from 192.1.30.2 to 224.0.0.2 from 192.1.30.2 to 192.1.4.1 via group 224.1.1.1 (mxhop=60) Mtrace query at Apr 21 16:01:00 by 192.1.30.2, resp to same, qid 20e046 packet from 192.1.30.2 to 224.0.0.2 from 192.1.30.2 to 192.1.4.1 via group 224.1.1.1 (mxhop=60) Mtrace query at Apr 21 16:01:10 by 192.1.30.2, resp to same, qid 1d25ad packet from 192.1.30.2 to 224.0.0.2 from 192.1.30.2 to 192.1.4.1 via group 224.1.1.1 (mxhop=60)
This example displays only mtrace queries. When the device captures an mtrace response, the display is similar, but the complete mtrace response is also displayed—exactly as it is displayed in mtrace from-source command output.
Table 214 summarizes the output fields of the display.
Table 214: CLI mtrace monitor Command Output Summary
You can enter the monitor start command to display real-time additions to system logs and trace files:
user@host> monitor start filename
When the device adds a record to the file specified by filename, the record is displayed on the screen. For example, if you have configured a system log file named system-log (by including the syslog statement at the [edit system] hierarchy level), you can enter the monitor start system-log command to display the records added to the system log.
To display a list of files that are being monitored, enter the monitor list command. To stop the display of records for a specified file, enter the monitor stop filename command.
This section contains the following topics:
Use the CLI monitor interface command to display real-time traffic, error, alarm, and filter statistics about a physical or logical interface. Enter the command with the following syntax:
user@host> monitor interface (interface-name | traffic)
Replace interface-name with the name of a physical or logical interface. If you specify the traffic option, statistics for all active interfaces are displayed.
The real-time statistics are updated every second. The Current delta and Delta columns display the amount the statistics counters have changed since the monitor interface command was entered or since you cleared the delta counters. Table 215 and Table 216 list the keys you use to control the display using the interface-name and traffic options. (The keys are not case sensitive.)
Table 215: CLI monitor interface Output Control Keys
Table 216: CLI monitor interface traffic Output Control Keys
Following are sample displays from the monitor interface command:
user@host> monitor interface fe-0/0/0
host1 Seconds: 11 Time: 16:47:49 Delay: 0/0/0 Interface: fe-0/0/0, Enabled, Link is Up Encapsulation: Ethernet, Speed: 100mbps Traffic statistics: Current delta Input bytes: 381588589 [11583] Output bytes: 9707279 [6542] Input packets: 4064553 [145] Output packets: 66683 [25] Error statistics: Input errors: 0 [0] Input drops: 0 [0] Input framing errors: 0 [0] Carrier transitions: 0 [0] Output errors: 0 [0] Output drops: 0 [0]
![]() |
Note: The output fields displayed when you enter the monitor interface interface-name command are determined by the interface you specify. |
user@host> monitor interface traffic
Interface Link Input packets (pps) Output packets (pps) fe-0/0/0 Up 42334 (5) 23306 (3) fe-0/0/1 Up 587525876 (12252) 589621478 (12891)
Use the CLI monitor traffic command to display packet headers transmitted through network interfaces.
![]() |
Note: Using the monitor traffic command can degrade system performance. We recommend that you use filtering options—such as count and matching—to minimize the impact to packet throughput on the system. |
Enter the monitor traffic command with the following syntax. Table 217 describes the monitor traffic command options.
user@host> monitor traffic <absolute-sequence> <count number> <interface interface-name>
<layer2-headers> <matching
"expression"> <no-domain-names> <no-promiscuous> <no-resolve> <no-timestamp> <print-ascii> <print-hex> <size bytes> <brief | detail | extensive>
To quit the monitor traffic command and return to the command prompt, press Ctrl-C.
If you want to capture and view packet headers using the J-Web interface, see Capturing and Viewing Packets with the J-Web Interface.
Table 217: CLI monitor traffic Command Options
Option |
Description |
---|---|
absolute-sequence |
(Optional) Displays the absolute TCP sequence numbers. |
count number |
(Optional) Displays the specified number of packet headers. Specify a value from 0 through 100,000. The command quits and exits to the command prompt after this number is reached. |
interface interface-name |
(Optional) Displays packet headers for traffic on the specified interface. If an interface is not specified, the lowest numbered interface is monitored. |
layer2-headers |
(Optional) Displays the link-layer packet header on each line. |
matching "expression" |
(Optional) Displays packet headers that match an expression enclosed in quotation marks (" "). Table 218 through Table 220 list match conditions, logical operators, and arithmetic, binary, and relational operators you can use in the expression. |
no-domain-names |
(Optional) Suppresses the display of the domain name portion of the hostname. |
no-promiscuous |
(Optional) Specifies not to place the monitored interface in promiscuous mode. In promiscuous mode, the interface reads every packet that reaches it. In nonpromiscuous mode, the interface reads only the packets addressed to it. |
no-resolve |
(Optional) Suppresses the display of hostnames. |
no-timestamp |
(Optional) Suppresses the display of packet header timestamps. |
print-ascii |
(Optional) Displays each packet header in ASCII format. |
print-hex |
(Optional) Displays each packet header, except link-layer headers, in hexadecimal format. |
size bytes |
(Optional) Displays the number of bytes for each packet that you specify. If a packet header exceeds this size, the displayed packet header is truncated. The default value is 96. |
brief |
(Optional) Displays minimum packet header information. This is the default. |
detail |
(Optional) Displays packet header information in moderate detail. For some protocols, you must also use the size option to see detailed information. |
extensive |
(Optional) Displays the most extensive level of packet header information. For some protocols, you must also use the size option to see extensive information. |
To limit the packet header information displayed by the monitor traffic command, include the matching "expression" option. An expression consists of one or more match conditions listed in Table 218, enclosed in quotation marks (" "). You can combine match conditions by using the logical operators listed in Table 219 (shown in order of highest to lowest precedence).
For example, to display TCP or UDP packet headers, enter the following command:
user@host> monitor traffic matching
“tcp || udp”
To compare the following types of expressions, use the relational operators listed in Table 220 (listed from highest to lowest precedence):
protocol [byte-offset <size>]
Replace protocol with any protocol in Table 218. Replace byte-offset with the byte offset, from the beginning of the packet header, to use for the comparison. The optional size parameter represents the number of bytes examined in the packet header—1, 2, or 4 bytes.
For example, the following command displays all multicast traffic:
user@host> monitor traffic matching
“ether[0] & 1 !=0”
Table 218: CLI monitor traffic Match Conditions
Table 219: CLI monitor traffic Logical Operators
Table 220: CLI monitor traffic Arithmetic, Binary, and Relational Operators
Following is sample output from the monitor traffic command:
user@host> monitor traffic count 4 matching
“arp” detail
Listening on fe-0/0/0, capture size 96 bytes 15:04:16.276780 In arp who-has 193.1.1.1 tell host1.site2.net 15:04:16.376848 In arp who-has host2.site2.net tell host1.site2.net 15:04:16.376887 In arp who-has 193.1.1.2 tell host1.site2.net 15:04:16.601923 In arp who-has 193.1.1.3 tell host1.site2.net