< Home

collect forward-path

Function

The collect forward-path command configures the device to collect traffic information.

The undo collect forward-path command configures the device not to collect traffic information.

By default, the device does not collect traffic information.

Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support this command.

Format

collect forward-path { { sip source-ip-address dip destination-ip-address [ sport source-port dport destination-port [ protocol { protocol-number | gre | icmp | igmp | ip | ipinip | ospf | tcp | udp } ] ] } | { smac source-mac-address | dmac dest-mac-address | vlan vlan-id | l2-protocol { protocol-value | arp | ip | ipv6 | mpls | rarp } } * } { ingress | egress | both } [ interval interval-time ]

undo collect forward-path { { sip source-ip-address dip destination-ip-address [ sport source-port dport destination-port [ protocol { protocol-number | gre | icmp | igmp | ip | ipinip | ospf | tcp | udp } ] ] } | { smac source-mac-address | dmac dest-mac-address | vlan vlan-id | l2-protocol { protocol-value | arp | ip | ipv6 | mpls | rarp } } * } { ingress | egress | both } [ interval interval-time ]

Parameters

Parameter

Description

Value

sip source-ip-address

Specifies the source IP address.

The value is in dotted decimal notation.
dip destination-ip-address

Specifies the destination IP address.

The value is in dotted decimal notation.
sport source-port

Specifies the source port number.

The value is an integer that ranges from 0 to 65535.

dport destination-port

Specifies the destination port number.

The value is an integer that ranges from 0 to 65535.

protocol { protocol-number | gre | icmp | igmp | ip | ipinip | ospf | tcp | udp }
Specifies the protocol number or type.
  • protocol-number specifies the protocol number.

  • gre indicates that the protocol type is GRE.

  • icmp indicates that the protocol type is ICMP.

  • igmp indicates that the protocol type is IGMP.

  • ip indicates that the protocol type is IP.

  • ipinip indicates that the protocol type is IPinIP.

  • ospf indicates that the protocol type is OSPF.

  • tcp indicates that the protocol type is TCP.

  • udp indicates that the protocol type is UDP.

The value of protocol-number is an integer that ranges from 1 to 255.

smac source-mac-address Specifies the source MAC address. The value is in hexadecimal notation.
dmac dest-mac-address Specifies the destination MAC address. The value is in hexadecimal notation.
vlan vlan-id Specifies the ID of a VLAN. The value is an integer that ranges from 1 to 4094.
l2-protocol { protocol-value | arp | ip | ipv6 | mpls | rarp }
Specifies the Layer 2 protocol number or type.
  • protocol-value specifies the protocol number.

  • arp indicates that the protocol type is ARP and the protocol number is 0x0806.

  • ip indicates that the protocol type is IP and the protocol number is 0x0800.

  • ipv6 indicates that the protocol type is IPv6 and the protocol number is 0x86dd.

  • mpls indicates that the protocol type is MPLS and the protocol number is 0x8847.

  • rarp indicates that the protocol type is RARP and the protocol number is 0x8035.

The value of protocol-value is in hexadecimal notation and must start with 0x. The value contains three or six digits.
ingress Indicates the inbound direction.

-

egress Indicates the outbound direction.

-

both Indicates the inbound and outbound directions.

-

interval interval-time Indicates the collection duration.

The value is an integer that ranges from 0 to 1440, in minutes. The default value is 10. The value 0 indicates that the device continuously collects inbound and outbound interfaces and traffic information in packets with 5-tuple information.

Views

User view, System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The packet information contains the source and destination IP addresses, source and destination port numbers, source and destination MAC addresses, and protocol type. Traffic transmitted on each device interface contains different information. You can run this command to configure the device to collect traffic information, which helps you locate faults and understand the traffic forwarding path.

Precautions

The device can collect inbound and outbound interfaces and traffic information of a maximum of 8 flows.

In the outbound direction, traffic information collection (with the egress or both parameter specified) conflicts with a traffic policy or simplified traffic policy. If traffic information collection, traffic policy, or simplified traffic policy are configured, one of them may not take effect.

When the device restarts or an active/standby switchover occurs in a CSS, the collection information and report configured by the collect forward-path command will be deleted.

If traffic information collection is no longer required after the collection time ends, run the undo collect forward-path command to disable the device from collecting traffic information.

After the undo collect forward-path command is run, the collected traffic statistics will be deleted.

If commands for collecting statistics on traffic with the same packet information are configured and the directions in two consecutive commands are the same or overlap, only the previous command takes effect. Examples are as follows:
  • Scenarios where collect forward-path sip 10.1.1.1 dip 10.2.2.2 ingress interval 20 and collect forward-path sip 10.1.1.1 dip 10.2.2.2 ingress interval 30 are configured in sequence: The collect forward-path sip 10.1.1.1 dip 10.2.2.2 ingress interval 30 command does not take effect.
  • Scenarios where collect forward-path sip 10.1.1.1 dip 10.2.2.2 ingress and collect forward-path sip 10.1.1.1 dip 10.2.2.2 both are configured in sequence: The collect forward-path sip 10.1.1.1 dip 10.2.2.2 both command does not take effect.
  • Scenarios where collect forward-path sip 10.1.1.1 dip 10.2.2.2 both and collect forward-path sip 10.1.1.1 dip 10.2.2.2 ingress are configured in sequence: The collect forward-path sip 10.1.1.1 dip 10.2.2.2 ingress command does not take effect.

Example

# Configure the device to collect traffic information with source IP address 10.1.1.1 and destination IP address 10.2.2.2.

<HUAWEI> system-view
[HUAWEI] collect forward-path sip 10.1.1.1 dip 10.2.2.2 both
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >