No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

AR500, AR510, and AR530 V200R007 Commands Reference

This document describes all the configuration commands of the device, including the command function, syntax, parameters, views, default level, usage guidelines, examples, and related commands.
Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Ping and Tracert Configuration Commands

Ping and Tracert Configuration Commands

ping

Function

The ping command checks whether a specified IPv4 address is reachable and exports corresponding statistics.

Format

ping [ ip ] [ -a source-ip-address | -c count | -d | -h ttl-value | { -nexthop nexthop-ip-address | -i interface-type interface-number } * | -m time | -n | -name | -p pattern | -q | -r | { -s packetsize | -range [ min min-size | max max-size | step step-size ] * } | -system-time | -t timeout | -tos tos-value | -v | -vpn-instance vpn-instance-name | [ -f | ignore-mtu ] ] * host [ ip-forwarding ]

Parameters

Parameter Description Value
ip Indicates the IPv4 protocol. If ip is not specified, the IPv4 protocol is used. -
-a source-ip-address Specifies the source IP address of the ICMP Echo Request message. If the source IP address is not specified, the IP address of the outbound interface is used as the source IP address of the ICMP Echo Request message. The value is in dotted decimal notation. The IP address must be a valid A, B, or C class address.
-c count Specifies the number of times for sending ICMP Echo Request messages.

The ping command labels each ICMP Echo Request message with a sequence ID that starts from 1 and is increased by 1. By default, five ICMP Echo Request messages are sent. You can set the number of ICMP Echo Request messages to send by specifying the parameter count.

In the case of poor network quality, you can set this parameter to a comparatively large value to check the network quality based on the packet loss rate.

The value is an integer that ranges from 1 to 4294967295. The default value is 5.
-d Indicates that the socket works in debug mode. By default, the socket works in non-debug mode.
-f Indicates that packets are not fragmented during transmission.
NOTE:

After this parameter is specified, ICMP packets are not fragmented. If the ICMP packet size exceeds the link MTU, the ICMP packet is discarded. If you do not want ICMP packets to be discarded, do not specify this parameter or increase the link MTU.

-
-h ttl-value Specifies the TTL value.

If the TTL field is reduced to 0 during message forwarding, the Layer 3 device that the message reaches sends an ICMP timeout message to the source host, indicating that the destination host is unreachable.

The value is an integer that ranges from 1 to 255. The default value is 255.
-nexthop nexthop-ip-address

Specifies an IP address for the next hop.

If you have specified this parameter, the device no longer searches the routing table before sending ICMP Echo Request packets. This process prevents ping failures caused by incorrect routing entries.

The value is in dotted decimal notation.

NOTE:
  • The specified next hop address must be the next hop address of a directly connected physical interface.

  • When you specify a next hop address, you can configure -i interface-type interface-number to specify an outbound interface. The following conditions must be met to ensure a test success:

    • The specified next hop address must match the outbound interface.
    • The specified outbound interface cannot be a logical interface's member interface.
  • If you have specified a next hop address, you cannot specify a VPN.

-i interface-type interface-number Specifies the outbound interface for sending ICMP Echo Request messages. -
-m time Specifies the time to wait before sending the next ICMP Echo Request message.

Each time the source sends an ICMP Echo Request message using the ping command, the source waits a period of time (500 ms by default) before sending the next ICMP Echo Request message. You can set the time to wait before sending the next ICMP Echo Request message using the parameter time. In the case of poor network condition, the value should be equal to or larger than 500, in milliseconds.

The value is an integer that ranges from 1 to 10000, in milliseconds. The default value is 500.
-n Uses the value of host as the IP address to spare domain name resolution. -
-name Displays the name of the destination host. -
-p pattern

Specifies pad characters for ICMP Echo Request messages.

By configuring pad characters for ICMP Echo Request messages, you can identify a specific message among the large number of received ICMP Echo Reply messages.

The value is a hexadecimal integer that ranges from 0 to FFFFFFFF. By default, the padding starts from 0x01, and continues in ascending order.
-q Displays only the statistics. If the ping command carries this parameter, the system displays only the statistics information such as the number of sent and received packets, packet loss rate, and minimum, average, and maximum RTTs of the packet. By default, the system displays all statistics information.
-r Records the route along which an IP packet is forwarded.

When -r is specified, during the transmission of an IP packet, the IP address of each Layer 3 device that the IP packet passes through is added to the Options field. When the IP packet reaches the destination, all IP addresses recorded in the Options field are copied to the ICMP Echo Reply message. In addition, the IP address of each Layer 3 device that the returned IP packet passes through is added to the message. When the ping program receives the ICMP Echo Reply message, IP addresses of the passed Layer 3 devices are displayed.

By default, the route along which an IP packet is forwarded is not recorded.
-s packetsize Specifies the length of an ICMP Echo Request message, excluding the IP header and ICMP header. The value is an integer that ranges from 20 to 9600, in bytes. The default value is 56.
-range Enables the device to send ICMP Echo Request messages with variable payload lengths.
  • If the -range parameter is not specified, the payload length of an ICMP Echo Request message is equal to the length specified by the -s packetsize parameter. The default value is 56, in bytes.
  • If the -range parameter is specified, the payload length of the first ICMP Echo Request message is min min-size, and that of the second ICMP Echo Request message is min min-size plus step step-size. The payload length increases incrementally by step step-size for subsequent ICMP Echo Request messages until max max-size is reached. After that, the device will not send ICMP Echo Request messages any more.

    By default, the payload length of an ICMP Echo Request message ranges from 56 to 9600 bytes, and the step length is 1 byte.

    NOTE:
    • The command execution takes a long period if a large number of ICMP Echo Request messages need to be sent. If you want to terminate the command execution, press Ctrl+C.
    • To change the number of ICMP Echo Request messages to be sent, change the values of min min-size and max max-size. The value of min min-size must be smaller than that of max max-size.
    • If both the -range and -c count parameters are specified, the device sends ICMP Echo Request messages of the same payload length for the number of times specified by the -c count parameter.
min min-size Specifies the minimum payload length of an ICMP Echo Request message. The value is an integer ranging from 20 to 9600, in bytes. The default value is 56.
max max-size Specifies the maximum payload length of an ICMP Echo Request message. The value is an integer ranging from 20 to 9600, in bytes. The default value is 9600.
step step-size Specifies the step length of an ICMP Echo Request message. The value is an integer ranging from 1 to 1000, in bytes. The default value is 1.
-system-time Displays the system time when the ping packet is sent. -
-t timeout

Specifies the timeout period to wait for an ICMP Echo Reply message after an ICMP Echo Request message is sent.

After the ping command is run, the source sends an ICMP Echo Request message to a destination and waits for an ICMP Echo Reply message. If the destination, after receiving the ICMP Echo Request message, returns an ICMP Echo Reply message to the source within the period specified by the parameter timeout, the destination is reachable. If the destination does not return an ICMP Echo Reply message within the specified period, the source displays that the message times out.

Normally, the source receives an ICMP Echo Reply message within 1 to 10 seconds after sending an ICMP Echo Request message. If the transmission speed is low, properly prolong the timeout period.

The value is an integer that ranges from 0 to 65535, in milliseconds. The default value is 2000.
-tos tos-value Specifies the ToS value of the sent ICMP Echo Request messages. The ToS value is used to set the packet priority. The value is an integer that ranges from 0 to 255. The default value is 0.
-v Displays all received ICMP Echo Reply messages.
  • If -v is not specified, the system displays only the ICMP Echo Reply messages received by the local user.
  • If -v is specified, the system displays all received ICMP Echo Reply messages.
By default, only ICMP Echo Reply messages for the local user are displayed.
-vpn-instance vpn-instance-name Specifies the name of a VPN instance. The value is a string of 1 to 31 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.
ignore-mtu Indicates that the system does not check the interface MTU when a packet is sent. -
host Specifies the domain name or IP address of the destination host. The value is a string of 1 to 255 case-sensitive characters with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. Alternatively, the value can be a valid IPv4 address in dotted decimal notation.
ip-forwarding Indicates that the ping packets are forcibly forwarded through IP on the first node. -

Views

All views

Default Level

0: Visit level

Usage Guidelines

Usage Scenario

The ping command is a common debugging tool for testing the network connectivity by transmitting ICMP Echo messages. It can detect the following items:
  • Availability of the remote device
  • Round-trip delay in communication between the local and remote devices
  • Packet loss rate
You can run the ping command to check the network connectivity or line quality in the following scenarios:
  • Check the protocol stack on the local device. You can run the ping loopback-address command to check whether the TCP/IP protocol stack works properly on the local device.
  • Check whether the destination host is reachable on an IP network. You can run the ping host command to send an ICMP Echo Request message to the destination host. If a reply is received, the destination host is reachable.
  • Check whether the peer is reachable on a Layer 3 VPN. On a Layer 3 VPN, devices may not have routing information about each other. Therefore, you cannot use the ping host command to check whether the peer is reachable. When a VPN instance name is specified, you can run the ping -vpn-instance vpn-instance-name host command to send an ICMP Echo Request message to the peer. If the peer returns an ICMP Echo Reply message, the peer is reachable.
  • In the case of an unstable network, you can run the ping -c count -t timeout host command to check the quality of the network between the local device and the peer. By analyzing the packet loss rate and average delay in the command output, you can evaluate the network quality. If the network is unreliable, set the packet transmission count (-c) and timeout (-t) to the upper limits. This makes the test result accurate.

  • Check the path. You can run the ping -r host command to obtain information about nodes along the path from the local device to the peer.

  • When you want to locate a fault or collect traffic statistics, specify the -m and -t parameters to allow the device to quickly send ping request packets.

  • When the packet size is large, specify the -s and -f parameters to detect the MTU on the intermediate link.

  • When IPSec or NAT is used, specify the -a parameter to configure the source address as the private network address to check the network connectivity. In addition, to check whether NAT translation succeeds using the ping test with the source address specified, you must run the ip soft-forward enhance enable command first to enable the enhanced forwarding function for control packets generated by the device.

Prerequisite

  • Before running the ping command, ensure that the ICMP module is working properly.
  • If -vpn-instance is specified, ensure that the VPN module is working properly.

Precautions

  • When you use the ping command on a third-party device to check the connectivity between the third-party device and the router, set the ping packet size to a value smaller than 64000 bytes to ensure a better test result.
  • If an intermediate device is disabled from responding to ICMP messages, detection on this node fails.
  • If a fault occurs in the ping process, you can press Ctrl+C to terminate the ping operation.
  • To ensure security, do not ping the broadcast address, such as XX.XX.XX.255.
  • When the destination host is unreachable, the system displays "Request time out", which indicates that the ICMP Echo Request message times out.

Example

# Check whether the host at 10.1.1.2 is reachable.

<Huawei> ping 10.1.1.2
  PING 10.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=2 ms
    Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=1 ms
    Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=1 ms
    Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=1 ms
    Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=1 ms
  --- 10.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 1/1/2 ms 

# Check whether the device at 10.1.1.3 in vpn1 is reachable

<Huawei> ping -vpn-instance vpn1 10.1.1.3
  PING 10.1.1.3: 56  data bytes, press CTRL_C to break
    Reply from 10.1.1.3: bytes=56 Sequence=1 ttl=255 time=31 ms
    Reply from 10.1.1.3: bytes=56 Sequence=2 ttl=255 time=31 ms
    Reply from 10.1.1.3: bytes=56 Sequence=3 ttl=255 time=31 ms
    Reply from 10.1.1.3: bytes=56 Sequence=4 ttl=255 time=31 ms
    Reply from 10.1.1.3: bytes=56 Sequence=5 ttl=255 time=31 ms
  --- 10.1.1.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 31/31/31 ms 

# Check whether the host at 10.1.1.4 is reachable, set the transmission count to 8, and set the period for waiting for an ICMP Echo Reply message to 4000 ms.

<Huawei> ping -c 8 -t 4000 10.1.1.4
  PING 10.1.1.4: 56  data bytes, press CTRL_C to break
    Reply from 10.1.1.4: bytes=56 Sequence=1 ttl=255 time=32 ms
    Reply from 10.1.1.4: bytes=56 Sequence=2 ttl=255 time=32 ms
    Reply from 10.1.1.4: bytes=56 Sequence=3 ttl=255 time=32 ms
    Reply from 10.1.1.4: bytes=56 Sequence=4 ttl=255 time=32 ms
    Reply from 10.1.1.4: bytes=56 Sequence=5 ttl=255 time=32 ms
    Reply from 10.1.1.4: bytes=56 Sequence=6 ttl=255 time=32 ms
    Reply from 10.1.1.4: bytes=56 Sequence=7 ttl=255 time=32 ms
    Reply from 10.1.1.4: bytes=56 Sequence=8 ttl=255 time=32 ms
  --- 10.1.1.4 ping statistics ---
    8 packet(s) transmitted
    8 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 32/32/32 ms
Table 16-71  Description of the ping command output

Item

Description

PING x.x.x.x

Reachability of the destination host with the IP address as x.x.x.x is tested.

x data bytes

Length of a sent ICMP Echo Request message.

press CTRL_C to break

The ongoing ping test is terminated after you press Ctrl+C.

Reply from x.x.x.x

The destination host responds to the ICMP Echo Request message with an ICMP Echo Reply message that contains the following items:
  • bytes: indicates the length of the ICMP Echo Reply message.

  • Sequence: indicates the sequence number of the ICMP Echo Reply message.

  • ttl: indicate the TTL value of the ICMP Echo Reply message.

  • time: indicates the RTT, in milliseconds.

If no ICMP Echo Reply message is received after the timeout period, the system displays "Request time out".

x.x.x.x ping statistics

Statistics collected after the ping test on the destination host. The statistics include the following information:
  • packet(s) transmitted: indicates the number of sent ICMP Echo Request messages.

  • packet(s) received: indicates the number of received ICMP Echo Reply messages.

  • % packet loss: indicates the percentage of unresponded messages to total sent messages.

  • round-trip min/avg/max: indicates the minimum, average, and maximum RTTs. The unit is ms. (On an IPv4 network, round-trip min/avg/max is not displayed if the ping fails. On an IPv6 network, round-trip min/avg/max = 0/0/0 ms is displayed if the ping fails.)

ping ipv6

Function

The ping ipv6 command checks whether a specified IPv6 address is reachable and exports corresponding statistics.

Format

ping ipv6 [ -a source-ipv6-address | -c count | -h ttl-value | -m time | -name | | -s packetsize | -t timeout | -tc traffic-class-value | vpn-instance vpn-instance-name ] * host [ -i interface-type interface-number ]

Parameters

Parameter Description Value
-a source-ipv6-address

Specifies a source IPv6 address for sending ICMPv6 Echo Request messages.

The specified source IPv6 address cannot be the virtual IPv6 address configured for VRRP6.

If no source IPv6 address is specified, the IPv6 address of the outbound interface is used as the source address for sending ICMPv6 Echo Request messages.

The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X.
-c count

Specifies the number of times for sending ICMPv6 Echo Request messages.

You can increase the number of outgoing packets to detect the network quality based on the packet loss rate.

The value is an integer that ranges from 1 to 4294967295. The default value is 5.
-h ttl-value Specifies the TTL value.

If the TTL field is reduced to 0 during message forwarding, the Layer 3 industrial switch router that the message reaches sends an ICMPv6 timeout message to the source host, indicating that the destination host is unreachable.

The value is an integer that ranges from 1 to 255. The default value is 255.
-m time Specifies the time to wait before sending the next ICMPv6 Echo Request message.

Each time the source sends an ICMPv6 Echo Request message using the ping ipv6 command, the source waits a period of time (2000 ms by default) before sending the next ICMPv6 Echo Request message. You can set the time to wait before sending the next ICMPv6 Echo Request message using the parameter time. In the case of poor network condition, the value should be equal to or larger than 2000, in milliseconds.

The value is an integer that ranges from 1 to 10000, in milliseconds. The default value is 2000.
-name Displays the name of the destination host. -
-s packetsize

Specifies the length of an ICMPv6 Echo Request message, excluding the IP header and ICMPv6 header.

The value is an integer that ranges from 20 to 9600, in bytes. The default value is 56.
-t timeout

Specifies the timeout period to wait for an ICMPv6 Echo Reply message after an ICMPv6 Echo Request message is sent.

After the ping ipv6 command is run, the source sends an ICMPv6 Echo Request message to a destination and waits for an ICMPv6 Echo Reply message. If the destination, after receiving the ICMPv6 Echo Request message, returns an ICMPv6 Echo Reply message to the source within the period specified by the parameter timeout, the destination is reachable. If the destination does not return an ICMPv6 Echo Reply message within the specified period, the source displays that the message times out. Normally, the source receives an ICMPv6 Echo Reply message within 1 to 10 seconds after sending an ICMPv6 Echo Request message. If the transmission speed is low, properly prolong the timeout period.

The value is an integer that ranges from 0 to 65535, in milliseconds. The default value is 2000.
-tc traffic-class-value

Specifies the traffic classification in the ICMPv6 Echo Request message.

To configure traffic control for ICMPv6 packets, set the parameter traffic-class-value.

The value is an integer that ranges from 0 to 255. The default value is 0.
vpn-instance vpn-instance-name

Specifies the name of a VPN instance for the IPv6 address family.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.
host

Specifies the host name or IPv6 address of the destination host.

The value is a string of 1 to 46 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. The IPv6 address is a 32–bit string in hexadecimal format, namely, the format X:X:X:X:X:X:X:X.
-i interface-type interface-number

Specifies the outbound interface for sending ICMPv6 Echo Request messages.

-

Views

All views

Default Level

0: Visit level

Usage Guidelines

Usage Scenario

The ping ipv6 command is a widely used debugging tool for checking network connectivity and host reachability on an IPv6 network by transmitting ICMPv6 messages. It can detect the following items:
  • Availability of the remote device
  • Round-trip delay in communication between the local and remote devices
  • Packet loss rate
You can run the ping ipv6 command to check the IPv6 network connectivity or line quality in the following scenarios:
  • Check the protocol stack on the local device. You can run the ping ipv6 IPv6-loopback-address command to check whether the TCP/IP protocol stack works properly on the local device.

  • Check whether the destination IPv6 host is reachable on an IPv6 network. You can run the ping ipv6 host command to send an ICMPv6 Echo Request message to the destination host. If a reply is received, the destination host is reachable.

  • In the case of an unstable network, you can run the ping ipv6 -c count -t timeout host command to check the quality of the network between the local device and the peer. By analyzing the packet loss rate and average delay in the command output, you can evaluate the network quality. If the network is unreliable, set the packet transmission count (-c) and timeout (-t) to the upper limits. This makes the test result accurate.

Prerequisites

  • Before running the ping ipv6 command, ensure that the ICMPv6 module is working properly.
  • If -vpn-instance is specified, ensure that the VPN module is working properly.

Precautions

  • If an intermediate device is disabled from responding to ICMPv6 messages, detection on this node fails.
  • If the IPv6 address of the destination host maps the local address, specify the name of the local outbound interface through which the ICMPv6 Echo Request message is sent. Otherwise, reply to the ping ipv6 command times out.
  • When the destination host is unreachable, the system displays "Request time out" indicating that the ICMPv6 Echo Request message times out and displays statistics collected by the IPv6 ping test.
  • If a fault occurs in the IPv6 ping process, you can press Ctrl+C to terminate the IPv6 ping operation.

Example

# Check whether the host with the IPv6 address as FC00::1 is reachable.

<Huawei> ping ipv6 FC00::1
 PING FC00::1 : 56  data bytes, press CTRL_C to break
    Reply from FC00::1
    bytes=56 Sequence=1 hop limit=64 time=115 ms
    Reply from FC00::1
    bytes=56 Sequence=2 hop limit=64 time=1 ms
    Reply from FC00::1
    bytes=56 Sequence=3 hop limit=64 time=1 ms
    Reply from FC00::1
    bytes=56 Sequence=4 hop limit=64 time=1 ms
    Reply from FC00::1
    bytes=56 Sequence=5 hop limit=64 time=1 ms
  ---FC00::1 ping statistics---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max=1/23/115 ms          
Table 16-72  Description of the ping ipv6 command output

Item

Description

PING HH:HH::HH:H

IPv6 address of the destination host.

x data bytes

Length of a sent ICMPv6 Echo Request message.

press CTRL_C to break

The ongoing IPv6 ping test is terminated after you press Ctrl+C.

Reply from HH:HH::HH:H

The destination host responds to the ICMPv6 Echo Request message with an ICMPv6 Echo Reply message that contains the following items:
  • bytes: indicates the length of the ICMPv6 Echo Reply message.

  • sequence: indicates the sequence number of the ICMPv6 Echo Reply message.

  • hop limit: indicates the TTL of the ICMPv6 Echo Reply message.

  • time: indicates the RTT, in milliseconds.

If no ICMPv6 Echo Reply message is received after the timeout period, the system displays "Request time out".

HH:HH::HH:H ping statistics

Statistics collected after the IPv6 ping test on the destination host. The statistics include the following information:
  • packet(s) transmitted: indicates the number of sent ICMPv6 Echo Request messages.

  • packet(s) received: indicates the number of received ICMPv6 Echo Reply messages.

  • % packet loss: indicates the percentage of unresponded messages to total sent messages.

  • round-trip min/avg/max: indicates the minimum, average, and maximum RTTs.

Related Topics

tracert

Function

The tracert command checks the path of packets from the source to the destination, checks network connectivity, and locates a network fault.

Format

tracert [ -a source-ip-address | -f first-ttl | -m max-ttl | -name | -p port | -q nqueries | -s packetsize | -v | -vpn-instance vpn-instance-name [ pipe ] | -w timeout ] * host

Parameters

Parameter Description Value
-a source-ip-address Specifies the source address of a probe packet.

If this parameter is not specified, the IP address of the outbound interface is used as the source IP address for sending tracert packets.

The value is in dotted decimal notation.
-f first-ttl Specifies the initial TTL. The TTL field is carried in the IP header. It indicates the lifetime of packets and specifies the maximum hops that packets can pass through. The TTL value is set on the source and reduced by 1 each time the packet passes through a hop. When the TTL value is reduced to 0, the packet is discarded. At the same time, an ICMP Timeout message is sent to notify the source host. If first-ttl is specified and the number of hops is smaller than the value of first-ttl, no ICMP Timeout packet is sent to the source host when the packet passes through these hops. If max-ttl is specified, the value of first-ttl must be smaller than the value of max-ttl. The value is an integer that ranges from 1 to 255. The default value is 1.
-m max-ttl Specifies the maximum TTL. Usually, the maximum TTL is set to the number of hops the packet passes through. You need to use this parameter to change the TTL. If first-ttl is specified, the value of max-ttl must be greater than the value of first-ttl. The value is an integer that ranges from 1 to 255. The default value is 30.
-name Displays the host name of each hop. -
-p port

Specifies the UDP port number of the destination.

Before specifying the UDP port number for the destination, ensure that the port is not in use; otherwise, the tracert fails.

The value is an integer that ranges from 0 to 65535. The default value is 33434.
-q nqueries Specifies the number of probe packets to be sent each time. In the case of poor network quality, you can set this parameter to a comparatively large value to ensure that the probe packet can reach the destination. The value is an integer that ranges from 1 to 65535. The default value is 3.
-v

Displays the MPLS label carried in the ICMP Time Exceeded packet.

This parameter is used to show the public label in the tracert initiated by PE.

By default, the MPLS label carried in the ICMP Time Exceeded is not displayed. Instead, only the path information carried in the ICMP Time Exceeded and Port-Unreachable packets is displayed.
-vpn-instance vpn-instance-name Specifies the name of the VPN instance to which the destination address belongs. The value is a string of 1 to 31 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.
pipe Indicates that the TTL of a VPN instance is in pipe mode. -
-w timeout Specifies the timeout period to wait for a reply. If a tracert packet times out when reaching a gateway, an asterisk (*) is displayed.

In the case of poor network quality and a low network transmission rate, you are advised to prolong the timeout period.

The value is an integer that ranges from 0 to 65535, in milliseconds. The default value is 5000.
-s packetsize

Specifies the length of an ICMP Echo Request message, excluding the IP header and ICMP header.

The value is an integer that ranges from 12 to 9600, in bytes. The default value is 12.
host Indicates the domain name or IPv4 address of the destination host. The value is a string of 1 to 255 case-sensitive characters with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. Alternatively, the value can be a valid IPv4 address in dotted decimal notation.

Views

All views

Default Level

0: Visit level

Usage Guidelines

Usage Scenario

During routine system maintenance, you can run the ping command to check network connectivity. If the ping fails, run the tracert command to locate the fault on the network.

You can specify different parameters in the tracert command for different scenarios:

  • To check information about nodes between the source and the destination, run the tracert host command.
  • To check information about nodes between the source and the destination on a Layer 3 VPN, run the tracert -vpn-instance vpn-instance-name host command. On a Layer 3 VPN, devices may not have routing information about each other. Therefore, you cannot use the tracert host command to check whether the peer is reachable. To check information about nodes between the source and the destination in a specified VPN instance, run the tracert -vpn-instance vpn-instance-name host command.
  • On an unstable network, you can run the tracert -q nqueries -w timeout host command to check information about nodes between the source and the destination. If the network is unreliable, set the packet transmission count (-q) and timeout (-w) to the upper limits. This makes the test result accurate.
  • To check information about nodes along a segment of a path, run the tracert -f first-ttl -m max-ttl host command that has initial TTL and maximum TTL specified.

Prerequisite

  • The UDP module of each node is working properly; otherwise, the tracert operation fails.
  • If -vpn-instance is specified, ensure that the VPN module of each node is working properly.
  • The ICMP module of each node is working properly; otherwise, " * * * " is displayed.

Procedure

The execution process of the tracert command is as follows:
  1. The source sends a packet with the TTL being 1. After the TTL times out, the first hop sends an ICMP Error message to the source, indicating that the packet cannot be forwarded.
  2. The source sends a packet with the TTL being 2. After the TTL times out, the second hop sends an ICMP Error message to the source, indicating that the packet cannot be forwarded.
  3. The source sends a packet with the TTL being 3. After the TTL times out, the third hop sends an ICMP Error message to the source, indicating that the packet cannot be forwarded.
  4. The preceding process proceeds until the packet reaches the destination.

When receiving a packet, each destination hop cannot find the port specified in the packet, and returns an ICMP Port Unreachable message, indicating that the destination port is unreachable and the tracert ends. In this manner, the result of each probe is displayed on the source, according to which you can find the path from the source to the destination.

Configuration Impact

If a fault occurs when you run the tracert command, the following information may be displayed:
  • !H: The host is unreachable.
  • !N: The network is unreachable.
  • !: The port is unreachable.
  • !P: The protocol type is incorrect.
  • !F: The packet is incorrectly fragmented.
  • !S: The source route is incorrect.

Precautions

To ensure that the router properly responds to a Tracert request initiated by a source device when the router is the destination device to be tested, you must run the icmp port-unreachable send command to enable the device to send ICMP port-unreachable packets.

Once -r is specified, the outputs of both the tracert and ping commands show information about nodes between the source and the destination. Differences between the outputs of the tracert and ping commands are as follows:

  • If the ping command times out on a transit node, a timeout packet is returned and the command output displays no path information.
  • If the tracert command times out on a transit node, the command output displays " * * * " indicating that the tracert times out on the node but the tracert is not interrupted.

Example

# Tracert the gateways from the source host to the destination host with the IP address being 10.1.1.11.

<Huawei> tracert 10.1.1.11
traceroute to 10.1.1.11 (10.1.1.11), max hops: 30, packet length: 40, press CTRL_C to break
1 10.3.112.1   10 ms 10 ms 10 ms
2 10.32.216.1  19 ms 19 ms 19 ms
3 * * *
4 * * *
5 * * *
6 * * *
7 10.1.1.11   339 ms 279 ms 279 ms
Table 16-73  Description of the tracert command output

Item

Description

traceroute to

Tracert to a destination IP address.

max hops

Maximum TTL value.

packet length

Length of a sent packet.

1 10.3.112.1 10 ms 10 ms 10 ms

The integer 1 indicates the first hop gateway. Each hop increments the hop count. By default, the maximum hop count is 30.

"10.3.112.1" is the gateway address of the first hop. The IPv4 address following the serial number of each hop is the gateway address of the hop.

"10 ms 10 ms 10 ms" indicates the difference between the time when the three UDP packets are sent and when corresponding ICMP Time Exceeded or ICMP Port Unreachable messages are received. By default, each hop sends three UDP probe packets.

* * *

No ICMP Time Exceeded message or ICMP Port Unreachable message is returned within a specified period on the Nth hop. By default, an ICMP Time Exceeded message or ICMP Port-unreachable message should be returned within 5000 ms.

tracert ipv6

Function

The tracert ipv6 command checks the path of packets from the source to the destination, checks IPv6 network connectivity, and locates a network fault.

Format

tracert ipv6 [ -a source-ipv6-address | -f first-hop-limit | -m max-hop-limit | -name | | -p port-number | -q probes | -s packetsize | -w timeout | vpn-instance vpn-instance-name ] * host

Parameters

Parameter Description Value
-a source-ipv6-address

Specifies the source address of a tracert packet.

If this parameter is not specified, the IP address of the outbound interface is used as the source IP address for sending tracert packets.

The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X.
-f first-hop-limit Specifies the initial hop-limit.

Carried in the IPv6 header, the hop-limit (time to live) indicates the lifetime of IPv6 packets and specifies the maximum number of hops that the IPv6 packets can pass through. The hop-limit field in IPv6 packets is similar to the TTL field in the IPv4 packets. The hop-limit value is set on the source and reduced by 1 each time the packet passes through a Layer 3 device. When the hop-limit value is reduced to 0 on a Layer 3 device, the Layer 3 device discards the packet and sends an ICMPv6 Timeout message to the source.

If first-hop-limit is specified and the number of hops is smaller than the specified value, the hop-limit value will be greater than 0 after the packet passes through all the nodes. Therefore, no ICMPv6 Timeout message is sent to the source.

If max-hop-limit is specified, the value of first-hop-limit must be smaller than the value of max-hop-limit.

The value is an integer that ranges from 1 to 255. The default value is 1.
-m max-hop-limit Specifies the maximum hop-limit.

Usually, the maximum hop-limit is set to the number of hops that a packet passes through. To change the hop-limit value, you need to use this parameter.

If first-hop-limit is specified, the value of max-hop-limit must be greater than the value of first-hop-limit.

The value is an integer that ranges from 1 to 255. The default value is 30.
-name Displays the name of the destination host. -
-p port-number Specifies the UDP port number of the destination.
  • If no UDP port number is specified for the destination, when you run the tracert ipv6 command, a port with the port number greater than 32768 is randomly chosen for the destination to receive tracert packets.
  • Before specifying the UDP port number for the destination, ensure that the port is not in use; otherwise, the tracert fails.
The value is an integer that ranges from 1 to 65535. The default value is 33434.
-q probes Specifies the number of tracert packets sent each time.

In the case of poor network quality, you can set probes to a comparatively large value to ensure that tracert packets can reach the destination.

The value is an integer that ranges from 1 to 65535. The default value is 3.
-s packetsize

Specifies the length of an ICMPv6 Echo Request message, excluding the IP header and ICMPv6 header.

The value is an integer that ranges from 20 to 9600, in bytes. The default value is 56.
-w timeout Sets the timeout period to wait for a reply.

If a tracert packet times out when reaching a gateway, an asterisk (*) is displayed.

In the case of poor network quality and a low network transmission rate, you are advised to prolong the timeout period.

The value is an integer that ranges from 1 to 65535, in milliseconds. The default value is 5000.
vpn-instance vpn-instance-name

Specifies the name of a VPN instance for the IPv6 address family.

The value is a string of 1 to 31 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.
host

Specifies the host name or IPv6 address of the destination host.

The value is a string of 1 to 46 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. The IPv6 address is a 32–bit string in hexadecimal format, namely, the format X:X:X:X:X:X:X:X.

Views

All views

Default Level

0: Visit level

Usage Guidelines

Usage Scenario

When a fault occurs on the network and the peer is an IPv6 device, you can run the ping ipv6 command to check network connectivity based on the reply message, and then run the tracert ipv6 command to locate the fault.

You can specify different parameters in the tracert ipv6 command for different scenarios:
  • To check information about nodes between the source and the IPv6 destination, run the tracert ipv6 host command.
  • To check information about nodes between the source and the IPv6 destination on a Layer 3 VPN, run the tracert ipv6 vpn-instance vpn-instance-name host command. On a Layer 3 VPN, devices may not have routing information about each other. Therefore, you cannot use the tracert ipv6 host command to check whether the peer is reachable. To check information about nodes between the source and the IPv6 destination in a specified VPN instance, run the tracert ipv6 vpn-instance vpn-instance-name host command.
  • On an unstable network, you can run the tracert ipv6 -q probes -w timeout host command to check information about nodes between the source and the IPv6 destination. If the network is unreliable, set the packet transmission count (-q) and timeout (-w) to the upper limits. This makes the test result accurate.
  • To check information about nodes along a segment of a path, run the tracert ipv6 -f first-hop-limit -m max-hop-limit host command that has initial hop-limit and maximum hop-limit specified.

Prerequisites

  • The UDP module of each node is working properly; otherwise, the IPv6 tracert operation fails.
  • The VPN module of each node is working properly if vpn-instance is specified.
  • The ICMPv6 module of each node is working properly; otherwise, " * * * " is displayed.

Procedure

The execution process of the tracert ipv6 command is as follows:
  • The source sends a packet with the hop-limit being 1. After the hop-limit times out, the first hop sends an ICMPv6 Error message to the source, indicating that the packet cannot be forwarded.
  • The source sends a packet with the hop-limit being 2. After the hop-limit times out, the second hop sends an ICMPv6 Error message to the source, indicating that the packet cannot be forwarded.
  • The source sends a packet with the hop-limit being 3. After the hop-limit times out, the third hop sends an ICMPv6 Error message to the source, indicating that the packet cannot be forwarded.
  • The preceding process proceeds until the packet reaches the destination.

When receiving an IPv6 packet, each destination hop cannot find the port specified in the IPv6 packet, and therefore returns an ICMPv6 Port Unreachable message, indicating that the destination port is unreachable and the IPv6 tracert ends. In this manner, the result of each probe is displayed on the source, according to which you can find the path from the source to the destination.

Configuration Impact

If a fault occurs when you run the tracert ipv6 command, the following information may be displayed:

  • !H: The host is unreachable.
  • !N: The network is unreachable.
  • !: The port is unreachable.
  • !P: The protocol type is incorrect.
  • !F: The packet is incorrectly fragmented.
  • !S: The source route is incorrect.

Precautions

By default, the ICMPv6 module is automatically enabled after you enable the IPv6 module.

Example

# Set the number of packets to be sent to 5 and timeout period to 8000 ms, and tracert the gateways from the source to the destination at FC00::3.

<Huawei> tracert ipv6 -q 5 -w 8000 FC00::3
traceroute to FC00::3 30 hops max,60 bytes packet
1 FC00:1::3 26 ms 23 ms 26 ms 30 ms 29 ms 
2 FC00::3 3020 ms 3024 ms 4040 ms 6820 ms 5584 ms
Table 16-74  Description of the tracert ipv6 command output

Item

Description

traceroute to HH:HH::HH:H

IPv6 address of the destination host.

x hops max

Maximum hop-limit value.

x bytes packet

Length of a tracert packet.

1

2

Sequence number of the received ICMPv6 Echo Reply message.

HH:HH::HH:H

Address of the IPCMPv6 Echo Reply message.

26 ms 23 ms 26 ms

RTT, in milliseconds.

Related Topics
Translation
Download
Updated: 2019-05-29

Document ID: EDOC1000097293

Views: 48199

Downloads: 102

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next