13-Network Management and Monitoring Command Reference

HomeSupportSwitchesH3C S9500E Switch SeriesReference GuidesCommand ReferencesH3C S9500E Command References-Release1828P04-6W18213-Network Management and Monitoring Command Reference
01-System Maintenance and Debugging Commands
Title Size Download
01-System Maintenance and Debugging Commands 122.79 KB

Ping and tracert commands

ping

Syntax

ping [ ip ] [ -a source-ip | -c count | -f | -h ttl | -i interface-type interface-number | -m interval | -n | -p pad | -q | -r | -s packet-size | -t timeout | -tos tos | -v | -vpn-instance vpn-instance-name ] * host

View

Any view

Default level

0: Visit level

Parameters

ip: Distinguishes between a destination host name and the ping command keywords if the name of the destination host is i, ip, ipv, or ipv6. For example, you must use the command in the form of ping ip ip instead of ping ip if the destination host name is ip.

-a source-ip: Specifies the source IP address of an ICMP echo request (ECHO-REQUEST). It must be an IP address configured on the switch. If this option is not specified, the source IP address of an ICMP echo request is the primary IP address of the outbound interface of the request.

-c count: Specifies the number of times that an ICMP echo request is sent. The value range is 1 to 4294967295, and the default is 5.

-f: Sets the DF bit in the IP header.

-h ttl: Specifies the TTL value for an ICMP echo request. The value range is 1 to 255, and the default is 255.

-i interface-type interface-number: Specifies the ICMP echo request sending interface by its type and number. If this option is not specified, the ICMP echo request sending interface is determined by searching the routing table or forwarding table according to the destination IP address.

-m interval: Specifies the interval (in milliseconds) to send an ICMP echo request. The value range is 1 to 65535, and the default is 200.

If a response from the destination is received within the timeout time, the interval to send the next echo request equals the actual response period plus the value of interval.

·     If no response from the destination is received within the timeout time, the interval to send the next echo request equals the timeout value plus the value of interval.

-n: Disables domain name resolution for the host argument. If this keyword is not specified and the host argument represents the host name of the destination, the switch translates host into an address.

-p pad: Specifies the value of the pad field in an ICMP echo request, in hexadecimal format, 1 to 8 bits, in the range 0 to ffffffff. If the specified value is less than 8 bits, 0s are added in front of the value to extend it to 8 bits. For example, if pad is configured as 0x2f, then the packets are padded with 0x0000002f repeatedly to make the total length of the packet meet the requirements of the switch. By default, the padded value starts from 0x01 up to 0xff, where another round starts again if necessary, like 0x010203…feff01….

-q: Presence of this keyword indicates that only statistics are displayed. Absence of this keyword indicates that all information is displayed.

-r: Records routing information. If this keyword is not specified, routes are not recorded.

-s packet-size: Specifies length (in bytes) of an ICMP echo request. The value range is 20 to 8100, and the default is 56.

-t timeout: Specifies the timeout value (in milliseconds) of an ICMP echo reply (ECHO-REPLY). If the source does not receive an ICMP echo reply within the timeout, it considers the ICMP echo reply timed out. The value range is 0 to 65535, and default is 2000.

-tos tos: Specifies the ToS value of an echo request. The value range is 0 to 255, and the default is 0.

-v: Displays non ICMP echo reply received. If this keyword is not specified, the system does not display non ICMP echo reply.

-vpn-instance vpn-instance-name: Specifies the MPLS L3VPN instance to which the destination belongs, where the vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If the destination is on the public network, do not specify this option.

host: IP address or host name (a string of 1 to 20 characters) of the destination.

Description

Use ping to verify whether the destination in an IP network is reachable, and to display the related statistics.

With the ping command executed, the source sends an ICMP echo request to the destination:

·     If the destination name is unrecognizable, the system outputs "Error:  Ping: Unknown host host-name".

·     If the source receives an ICMP echo reply from the destination within the timeout, the system outputs the related information of the reply.

·     If the source does not receive an ICMP echo reply from the destination within the timeout, the system outputs "Request time out".

To use the name of the destination host to perform the ping operation, you must configure the Domain Name System (DNS) on the switch first; otherwise, the ping operation fails. For more information about DNS, see Layer 3IP Services Configuration Guide. In addition, you must use the command in the form of ping ip ip instead of ping ip if the destination name is a key word, such as ip.

Only the directly connected segment address can be pinged if the outbound interface is specified with the -i keyword.

To abort the ping operation during the execution of the command, press Ctrl+C.

Examples

# Test whether the switch with an IP address of 10.1.1.5 is reachable.

<Sysname> ping 10.1.1.5

PING 10.1.1.5 : 56 data bytes, press CTRL_C to break

Reply from 10.1.1.5 : bytes=56 Sequence=1 ttl=255 time = 20 ms

Reply from 10.1.1.5 : bytes=56 Sequence=2 ttl=255 time = 12 ms

Reply from 10.1.1.5 : bytes=56 Sequence=3 ttl=255 time = 12 ms

Reply from 10.1.1.5 : bytes=56 Sequence=4 ttl=255 time = 13 ms

Reply from 10.1.1.5 : bytes=56 Sequence=5 ttl=255 time = 12 ms

--- 10.1.1.5 ping statistics ---

5 packet(s) transmitted

5 packet(s) received

0.00% packet loss

round-trip min/avg/max = 12/13/20 ms

The output shows the following:

·     The destination is reachable.

·     All ICMP echo requests sent by the source have got responses.

·     The minimum time, average time, and maximum time for the packet’s roundtrip time are 12 ms, 13 ms, and 20 ms respectively.

# Test whether the device with an IP address of 1.1.2.2 in VPN 1 is reachable.

<Sysname> ping -vpn-instance vpn1 1.1.2.2

  PING 1.1.2.2: 56  data bytes, press CTRL_C to break

    Reply from 1.1.2.2: bytes=56 Sequence=1 ttl=254 time=205 ms

    Reply from 1.1.2.2: bytes=56 Sequence=2 ttl=254 time=1 ms

    Reply from 1.1.2.2: bytes=56 Sequence=3 ttl=254 time=1 ms

    Reply from 1.1.2.2: bytes=56 Sequence=4 ttl=254 time=1 ms

    Reply from 1.1.2.2: bytes=56 Sequence=5 ttl=254 time=1 ms

 

  --- 1.1.2.2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

round-trip min/avg/max = 1/41/205 ms

The output shows the following:

·     The destination in VPN 1 is reachable.

·     All ICMP echo requests sent by the source have got responses.

·     The minimum time, average time, and maximum time for the packet’s roundtrip time are 1 ms, 41 ms, and 205 ms respectively.

# Test whether the device with an IP address of 1.1.2.2 in topology voice is reachable.

<Sysname> ping -mt voice 1.1.2.2

  PING 1.1.2.2: 56  data bytes, press CTRL_C to break

    Reply from 1.1.2.2: bytes=56 Sequence=1 ttl=254 time=205 ms

    Reply from 1.1.2.2: bytes=56 Sequence=2 ttl=254 time=1 ms

    Reply from 1.1.2.2: bytes=56 Sequence=3 ttl=254 time=1 ms

    Reply from 1.1.2.2: bytes=56 Sequence=4 ttl=254 time=1 ms

    Reply from 1.1.2.2: bytes=56 Sequence=5 ttl=254 time=1 ms

 

  --- 1.1.2.2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 1/41/205 ms

The output shows the following:

·     The destination in topology voice is reachable.

·     All ICMP echo requests sent by the source have got responses.

·     The minimum time, average time, and maximum time for the packet’s roundtrip time are 1 ms, 41 ms, and 205 ms respectively.

# Test whether the device with an IP address of 1.1.2.2 is reachable. Only the test results are displayed.

<Sysname> ping -q 1.1.2.2

  PING 1.1.2.2: 56  data bytes, press CTRL_C to break

 

  --- 1.1.2.2 ping statistics ---

    5 packet(s) transmitted

    4 packet(s) received

    20.00% packet loss

    round-trip min/avg/max = 1/12/29 ms

# Test whether the device with an IP address of 1.1.2.2 is reachable. The route information is displayed.

<Sysname> ping -r 1.1.2.2

  PING 1.1.2.2: 56  data bytes, press CTRL_C to break

    Reply from 1.1.2.2: bytes=56 Sequence=1 ttl=254 time=53 ms

      Record Route:

         1.1.2.1

         1.1.2.2

         1.1.1.2

         1.1.1.1

    Reply from 1.1.2.2: bytes=56 Sequence=2 ttl=254 time=1 ms

      Record Route:

         1.1.2.1

         1.1.2.2

         1.1.1.2

         1.1.1.1

    Reply from 1.1.2.2: bytes=56 Sequence=3 ttl=254 time=1 ms

      Record Route:

         1.1.2.1

         1.1.2.2

         1.1.1.2

         1.1.1.1

    Reply from 1.1.2.2: bytes=56 Sequence=4 ttl=254 time=1 ms

      Record Route:

         1.1.2.1

         1.1.2.2

         1.1.1.2

         1.1.1.1

    Reply from 1.1.2.2: bytes=56 Sequence=5 ttl=254 time=1 ms

      Record Route:

         1.1.2.1

         1.1.2.2

         1.1.1.2

         1.1.1.1

 

  --- 1.1.2.2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 1/11/53 ms

The output shows the following:

·     The destination is reachable.

·     The route is 1.1.1.1 <-> {1.1.1.2; 1.1.2.1} <-> 1.1.2.2.

Table 1 Command output

Field

Description

PING 10.1.1.5

Check whether the switch with IP address 10.1.1.5 is reachable.

56 data bytes

Number of data bytes in each ICMP echo request.

press CTRL_C to break

During the execution of the command, you can press Ctrl+C to abort the ping operation.

Reply from 10.1.1.5 : bytes=56 Sequence=1 ttl=255 time= 20 ms

Received the ICMP reply from the switch whose IP address is 10.1.1.5. If no reply is received during the timeout period, "Request time out" will be displayed.

·     bytesNumber of data bytes in the ICMP reply.

·     SequencePacket sequence, used to determine whether a segment is lost, disordered or repeated.

·     ttl—TTL value in the ICMP reply.

·     timeResponse time.

Record Route

Routers through which the ICMP echo request passed. They are displayed in inversed order, that is, the router with a smaller distance to the destination is displayed first.

Record Route:

Routers through which the ICMP echo request passed. They are displayed in inversed order, that is, the router with a smaller distance to the destination is displayed first.

--- 10.1.1.5 ping statistics ---

Statistics on data received and sent in the ping operation.

5 packet(s) transmitted

Number of ICMP echo requests sent.

5 packet(s) received

Number of ICMP echo requests received.

0.00% packet loss

Percentage of packets not responded to the total packets sent.

round-trip min/avg/max = 12/13/20 ms

Minimum/average/maximum response time, in ms. The field is not available for failed ping attempts in an IPv4 network. In an IPv6 network, however, the field is available and set to 0/0/0 ms.

 

ping ipv6

Syntax

ping ipv6 [ -a source-ipv6 | -c count | -m interval | -s packet-size | -t timeout | -vpn-instance vpn-instance-name ] * host [ -i interface-type interface-number ]

View

Any view

Default level

0: Visit level

Parameters

-a source-ipv6: Specifies the source IPv6 address of an ICMP echo request. It must be a legal IPv6 address configured on the switch. If this option is not specified, the source IPv6 address of an ICMP echo request is the primary IPv6 address of the outbound interface of the request.

-c count: Specifies the number of times that an ICMPv6 echo request is sent. The value range is 1 to 4294967295, and the default is 5.

-m interval: Specifies the interval (in milliseconds) to send an ICMPv6 echo reply. The value range is 1 to 65535, and the default is 200.

If a response from the destination is received within the timeout time, the interval to send the next echo request equals the actual response period plus the value of interval.

·     If no response from the destination is received within the timeout time, the interval to send the next echo request equals the timeout value plus the value of interval.

-s packet-size: Specifies length (in bytes) of an ICMPv6 echo request. The value range is 20 to 8100, and the default is 56.

-t timeout: Specifies the timeout value (in milliseconds) of an ICMPv6 echo reply. The value range is 0 to 65535, and the default is 2000.

host: IPv6 address or host name of the destination, which is a string of 1 to 46 characters.

-i interface-type interface-number: Specifies an outbound interface by its type and number. This parameter can be used only when the destination address is the link local address and the specified outbound interface must have a link local address (see Layer 3—IP Services Configuration Guide). If this option is not specified, the ICMP echo request sending interface is determined by searching the routing table or forwarding table according to the destination IP address.

-vpn-instance vpn-instance-name: Specifies the MPLS L3VPN instance to which the destination belongs, where the vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If the destination is on the public network, do not specify this option.

Description

Use ping ipv6 to verify whether an IPv6 address is reachable, and display the corresponding statistics.

To use the name of the destination host to perform the ping operation, you must configure DNS on the switch first; otherwise, the ping operation fails. For more information about DNS, see Layer 3—IP Services Configuration Guide. You must use the command in the form of ping ipv6 ipv6 instead of ping ipv6 if the destination name is an ipv6 name.

To abort the ping ipv6 operation during the execution of the command, press Ctrl+C.

Examples

# Verify whether the IPv6 address 2001::2 is reachable.

<Sysname> ping ipv6 2001::2

  PING 2002::2 : 56  data bytes, press CTRL_C to break

    Reply from 2002::2

    bytes=56 Sequence=1 hop limit=64  time = 117 ms

    Reply from 2002::2

    bytes=56 Sequence=2 hop limit=64  time = 22 ms

    Reply from 2002::2

    bytes=56 Sequence=3 hop limit=64  time = 24 ms

    Reply from 2002::2

    bytes=56 Sequence=4 hop limit=64  time = 37 ms

    Reply from 2002::2

    bytes=56 Sequence=5 hop limit=64  time = 29 ms

  --- 2002::2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

round-trip min/avg/max = 22/45/117 ms

# Verify whether the IPv6 address 2001::1 in VPN 1 is reachable.

<Sysname> ping ipv6 –vpn-instance vpn1 2001::1

  PING 2001::1 : 56  data bytes, press CTRL_C to break

    Reply from 2001::1

    bytes=56 Sequence=1 hop limit=64  time = 62 ms

    Reply from 2001::1

    bytes=56 Sequence=2 hop limit=64  time = 26 ms

    Reply from 2001::1

    bytes=56 Sequence=3 hop limit=64  time = 20 ms

    Reply from 2001::1

    bytes=56 Sequence=4 hop limit=64  time = 4 ms

    Reply from 2001::1

    bytes=56 Sequence=5 hop limit=64  time = 16 ms

  --- 2001::2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 4/25/62 ms

The "hop limit" field in this prompt information has the same meaning as the "ttl" field in the prompt information displayed by the IPv4 ping command, indicating the TTL value in the ICMPv6 echo request. For the description on other fields, see Table 1.

tracert

Syntax

tracert [ -a source-ip | -f first-ttl | -m max-ttl | -p port | -q packet-number | -vpn-instance vpn-instance-name | -w timeout ] * host

View

Any view

Default level

0: Visit level

Parameters

-a source-ip: Specifies the source IP address of a tracert packet. It must be a legal IP address configured on the switch. If this option is not specified, the source IP address of an ICMP echo request is the primary IP address of the outbound interface of the tracert packet.

-f first-ttl: Specifies the first TTL, or, the allowed number of hops for the first packet. The value range is 1 to 255, and the default is 1. The value must be less than the maximum TTL.

-m max-ttl: Specifies the maximum TTL, that is, the maximum allowed number of hops for a packet. The value range is 1 to 255, and the default is 30. The value must be greater than the first TTL.

-p port: Specifies the UDP port number of the destination. The value range is 1 to 65535, and the default is 33434. You do not need to modify this parameter.

-q packet-number: Specifies the number of probe packets sent each time. The value range is 1 to 65535, and the default is 3.

-vpn-instance vpn-instance-name: Specifies the MPLS L3VPN instance to which the destination belongs, where the vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If the destination is on the public network, do not specify this option.

-w timeout: Specifies the timeout time of the reply packet of a probe packet, in milliseconds. The value range is 1 to 65535, and the default is 5000.

host: IP address or host name (a string of 1 to 20 characters) of the destination.

Description

Use tracert to trace the path the packets traverse from source to destination.

After having identified network failure with the ping command, use the tracert command to determine the failed nodes.

Output from the tracert command includes IP addresses of all the Layer 3 devices the packets traverse from source to destination. If a switch times out, asterisks (* * *) will be displayed.

To abort the tracert operation during the execution of the command, press Ctrl+C.

Examples

# Display the path the packets traverse from source to destination with an IP address of 1.1.2.2.

<Sysname> tracert 1.1.2.2

 traceroute to 1.1.2.2(1.1.2.2) 30 hops max,40 bytes packet, press CTRL_C to break

 1  1.1.1.2 673 ms 425 ms 30 ms

 2  1.1.2.2 580 ms 470 ms 80 ms

# Trace the path to destination 192.168.0.46 over an MPLS network.

<Sysname> tracert 192.168.0.46

 traceroute to 192.168.0.46(192.168.0.46) 30 hops max,40 bytes packet, press CTRL_C to break

 1  192.0.2.13 (192.0.2.13)  0.661 ms  0.618 ms  0.579 ms

 2  192.0.2.9 (192.0.2.9)  0.861 ms  0.718 ms  0.679 ms

    MPLS Label=100048 Exp=0 TTL=1 S=1

 3  192.0.2.5 (192.0.2.5)  0.822 ms  0.731 ms  0.708 ms

    MPLS Label=100016 Exp=0 TTL=1 S=1

 4  192.0.2.1 (192.0.2.1)  0.961 ms  8.676 ms  0.875 ms

Table 2 Command output

Field

Description

traceroute to 1.1.2.2(1.1.2.2)

Display the route the IP packets traverse from the current switch to the device whose IP address is 1.1.2.2.

hops max

Maximum number of hops of the probe packets, which can be set through the -m keyword.

bytes packet

Number of bytes of a probe packet.

press CTRL_C to break

During the execution of the command, you can press Ctrl+C to abort the tracert operation.

1  1.1.1.2 673 ms 425 ms 30 ms

Probe result of the probe packets whose TTL is 1, including the IP address of the first hop and the roundtrip time of three probe packets.

The number of packets that can be sent in each probe can be set through the -q keyword.

MPLS Label=100048 Exp=0 TTL=1 S=1

ICMP timeout packets on an MPLS network, carry MPLS label information:

·     Label—Label value that is used to identify a forwarding equivalence class (FEC).

·     Exp—Reserved, usually used for class of service (CoS).

·     TTL—TTL value.

·     S—MPLS supports multiple levels of labels. Value 1 indicates that the label is at the bottom of the label stack, and value 0 indicates that the label is not at the bottom of the label stack.

 

tracert ipv6

Syntax

tracert ipv6 [ -f first-ttl | -m max-ttl | -p port | -q packet-number | -vpn-instance vpn-instance-name  | -w timeout ] * host

View

Any view

Default level

0: Visit level

Parameters

-f first-ttl: Specifies the first TTL, that is, the allowed number of hops for the first packet The value range is 1 to 255, and the default is 1. The value must be less than the maximum TTL.

-m max-ttl: Specifies the maximum TTL, that is, the maximum allowed number of hops for a packet. The value range is 1 to 255, and the default is 30. The value must be greater than the first TTL.

-p port: Specifies the UDP port number of the destination. The value range is 1 to 65535, and the default is 33434. You do not need to modify this parameter.

-q packet-number: Specifies the number of probe packets sent each time. The value range is 1 to 65535, and the default is 3.

-w timeout: Specifies the timeout time of the reply packet of a probe packet, in milliseconds. The value range is 1 to 65535, and the default is 5000.

host: IPv6 address or host name of the destination, which is a string of 1 to 46 characters.

-vpn-instance vpn-instance-name: Specifies the MPLS L3VPN to which the destination belongs, where the vpn-instance-name argument is a case-sensitive string of 1 to 31 characters. If the destination is on the public network, do not specify this option.

Description

Use tracert ipv6 to view the path the IPv6 packets traverse from source to destination.

After having identified network failure with the ping command, you can use the tracert command to determine the failed nodes.

Output from the tracert ipv6 command includes IPv6 addresses of all the Layer 3 devices the packets traverse from source to destination. If a device times out, asterisks (* * *) will be displayed.

To abort the tracert operation during the execution of the command, press Ctrl+C.

Examples

# View the path the packets traverse from source to destination with IPv6 address 2001::1.

<Sysname> tracert ipv6 2001::1

 traceroute to 2001::1  30 hops max,60 bytes packet, press CTRL_C to break

 1 2001::1 3 ms <1 ms 19 ms

# View the path the packets traverse from source to destination with IPv6 address 2001::1 in VPN 1.

<Sysname> tracert ipv6 –vpn-instance vpn1 2001::1

 traceroute to 2001::1  30 hops max,60 bytes packet, press CTRL_C to break

 1  2001::1 3 ms <1 ms 19 ms

For description on the fields in the command output, see Table 2.

System debugging commands

debugging

Syntax

debugging { all [ timeout time ] | module-name [ option ] }

undo debugging { all | module-name [ option ] }

View

User view

Default level

1: Monitor level

Parameters

all: All debugging functions.

timeout time: Specifies the timeout time in minutes for the debugging all command. When all debugging is enabled, the system automatically executes the undo debugging all command after the time argument. The value range is 1 to 1440.

module-name: Module name, such as arp or switch. To display the current module name, use the debugging ? command.

option: The debugging option for a specific module. Different modules have different debugging options in terms of their number and content. To display the currently supported options, use the debugging module-name ? command.

Description

Use debugging to enable the debugging of a specific module.

Use undo debugging to disable the debugging of a specific module.

By default, debugging functions of all modules are disabled.

Output from the debugging command may degrade system efficiency, so you should enable the debugging of the corresponding module for diagnosing network failure, and not to enable debugging of multiple modules at the same time.

Default level describes the default level of the debugging all command. Different debugging commands may have different default levels.

You must configure the debugging, terminal debugging and terminal monitor commands first to display detailed debugging information on the terminal. For more information about the terminal debugging and terminal monitor commands, see "Information center configuration commands."

Related commands: display debugging.

Examples

# Enable IP packet debugging.

<Sysname> debugging ip packet

display debugging

Syntax

display debugging [ interface interface-type interface-number ] [ module-name ] [ | { begin | exclude | include } regular-expression ]

View

Any view

Default level

1: Monitor level

Parameters

interface interface-type interface-number: Displays the debugging settings of the specified interface, where the interface-type interface-number argument represents the interface type and number.

module-name: Module name.

|: Filters command output by specifying a regular expression. For more information about regular expressions, see Fundamentals Configuration Guide.

begin: Displays the first line that matches the specified regular expression and all lines that follow.

exclude: Displays all lines that do not match the specified regular expression.

include: Displays all lines that match the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Description

Use display debugging to display enabled debugging functions.

Related commands: debugging.

Examples

# Display all enabled debugging functions.

<Sysname> display debugging

IP packet debugging is on

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网