MTR - Formated Command

From IT-Arts.net
Revision as of 19:56, 12 January 2026 by Admin (talk | contribs)


Command

mtr -o "SDRL  NBAW  VG  JMXI" --mpls <TARGET>

Where :

- `-o "SDRL NBAW VG JMXI"`: This option specifies the output format for MTR. The letters correspond to different fields in the report, where each letter represents a specific column in the MTR output.

 - `S`: Shows the sequence number of each hop.
 - `D`: Displays the destination IP address.
 - `R`: Displays the round-trip time (RTT) in milliseconds for each hop.
 - `L`: Displays the loss percentage for each hop.
 - `N`: Displays the number of packets received at each hop.
 - `B`: Shows the address of the router at each hop.
 - `A`: Displays the hostname or IP address of the destination.
 - `W`: Displays the average round-trip time.
 - `V`: Displays the variance of round-trip time.
 - `G`: Displays the "good" packets (packets that returned successfully).
 - `J`: Displays jitter values for round-trip time.
 - `M`: Displays the maximum round-trip time.
 - `X`: Displays the minimum round-trip time.
 - `I`: Displays the IP address for each hop.
 The letters are arranged in the order you want the columns to appear in the MTR output. In this case, the columns will show:
 - Sequence number (S)
 - Destination address (D)
 - Round-trip time (R)
 - Loss percentage (L)
 - Number of packets received (N)
 - Address of the router (B)
 - Average RTT (W)
 - Variance (V)
 - Jitter (G)
 - Maximum RTT (M)
 - Minimum RTT (X)
 - IP address (I)

- `--mpls`: This option enables MPLS (Multiprotocol Label Switching) tracing, which displays additional information related to MPLS labels used in the routing path. This is useful in networks that use MPLS for routing and switching, as it can help identify label-switched paths.

Script Example

#!/bin/bash
#
# mtr.sh script
# USAGE : root#~: ./mtr.sh <TARGET> 

mtr -o "SDRL  NBAW  VG  JMXI" --mpls $1