The packet-trace tool is a troubleshooting command that allows the specification of a probe packet that is injected into the specified interface forwarding context. The tool records the forwarding destination or egress port for the probe packet, as well as any matched ACL records.
The packet-trace tool calculates the egress interfaces for an IP forward flow, while taking into account ECMP and LAG hashing.
The tool reports the following output:
Refer to the SR Linux Data Model Reference for more information about all packet-trace related commands and descriptions of all parameters.
The packet-trace command is a tools command that reports the forwarding behavior for a test packet specified in one of the following formats:
Only physical interface types can be used as the ingress interface for injected packets.
Use this command to report the forwarding behavior for a specified test packet (file format) that contains a packet formatted in Scapy packet definition form:
# tools system packet-trace file <input file in Scapy format> interface <interface name>
Packet trace command parameters for specifying an input file are described in Table 3.
Command/parameter | Description |
tools system packet-trace | Reports the forwarding behavior for a specified test packet (file format) |
file <file name> | File containing the packet format in Scapy packet definition form. The format of the packet definition should match that of the Linux utility Scapy. |
interface <interface name> | The name of the configured interface to inject the probe packet |
Example Scapy input file:
Example command:
Example output (bridged):
Example output (routed):
Use this command to report the forwarding behavior for a specified test packet using packets specified in base64 format:
# tools system packet-trace-base64 interface <interface name> packet <value>
Packet trace command parameters for specifying base64 format are described in Table 4.
Command/parameter | Description |
tools system packet-trace-base64 | Reports the forwarding behavior for a specified test packet (packet specified in base64 format) |
interface <interface name> | The name of the configured interface to inject the probe packet |
packet <value> | Packet format in base64 string format |
Example command (for routed):
Example output (routed):
Example command (for bridged):
Example output (bridged):
Use this command to report the forwarding behavior for a specified test packet using packets specified in pcap format:
# tools system packet-trace pcap-file <file name> [interface <interface name>] [max-packet-count <value>] [packet-number <value>]
Packet trace command parameters for specifying pcap format are described in Table 5.
Command/parameter | Description |
tools system packet-trace | Reports the forwarding behavior for a specified test packet (file format) |
pcap-file <file name> | Input file in pcap format |
interface <interface name> | The name of the configured interface to inject the probe packet |
max-packet-count <value> | Number of packets to read from the file (default: 100) |
packet-number <value> | Use packet with the specified packet number from the pcap file |
Example command:
Example output: