The sflow agent command creates an sFlow agent and specifies an IP address for the sFlow agent or updates the IP address of the existing sFlow agent.
The undo sflow agent command deletes the IP address of an sFlow agent.
By default, an sFlow agent uses the IP address of the outbound interface in the route to the sFlow collector as the sFlow agent IP address of sFlow packets.
sflow agent { ip [ vpn-instance vpn-instance-name ] ip-address | ipv6 [ vpn-instance vpn-instance-name ] ipv6-address }
undo sflow agent { ip [ vpn-instance vpn-instance-name ] ip-address | ipv6 [ vpn-instance vpn-instance-name ] ipv6-address }
Parameter |
Description |
Value |
---|---|---|
ip ip-address |
Specifies the IPv4 address of an sFlow agent. |
The value is in dotted decimal notation and is a valid unicast address except 127.X.X.X. |
ipv6 ipv6-address |
Specifies an IPv6 address of the sFlow agent. |
The value is an IPv6 unicast address, which is a 32-digit hexadecimal number. |
vpn-instance vpn-instance-name |
Specifies the name of a VPN instance. |
The value is a string of 1 to 31 case-sensitive characters without spaces. |
Usage Scenario
sFlow is a traffic monitoring technique that collects and analyzes traffic statistics. An sFlow agent encapsulates traffic statistics into sFlow packets and sends the sFlow packets to specified sFlow collectors. To send the sFlow packets to a certain sFlow collector, configure an IP address for the sFlow agent as the source address of sFlow packets. The sFlow collector analyzes and displays the traffic statistics based on the traffic in the received sFlow packets. Network administrators can view the traffic statistics on a specified interface based on the IP address of the sFlow agent and interface number.
Prerequisites
Configuration Impact
If you run the sflow agent command multiple times, only the latest configuration takes effect.
Precautions
A maximum of two sFlow agents can be configured in the system, and each VPN instance of an address family supports only one agent. The IP address of an agent must be a valid unicast IP address of an interface. If an IPv6 address is specified for an agent, the IPv6 address must be a global unicast address, but cannot be a link-local address.