Configuring the sFlow agent and sFlow collector information

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. (Optional.) Configure an IP address for the sFlow agent.

sflow agent { ip ipv4-address | ipv6 ipv6-address }

By default, no IP address is configured for the sFlow agent. The device periodically checks whether the sFlow agent has an IP address. If the sFlow agent does not have an IP address, the device automatically selects an IPv4 address for the sFlow agent but does not save the IPv4 address in the configuration file.

NOTE:

  • As a best practice, manually configure an IP address for the sFlow agent.

  • Only one IP address can be configured for the sFlow agent on the device, and a newly configured IP address overwrites the existing one.

3. Configure the sFlow collector information.

sflow collector collector-id [ vpn-instance vpn-instance-name ] { ip ipv4-address | ipv6 ipv6-address } [ port port-number | datagram-size size | time-out seconds | description string ] *

By default, no sFlow collector information is configured.

4. (Optional.) Specify the source IP address of sFlow packets.

sflow source { ip ipv4-address | ipv6 ipv6-address } *

By default, the source IP address is determined by routing.