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.
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 ]
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.
|
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.
|
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. |
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.