Configuration Guide
Network Management and Monitor...
sFlow Configuration
8 min
sflow configuration sflow configuration introduction introduction sflow is a network monitoring technology that collects network packet samples and sends them to a remote collector encapsulated in udp packets sflow technology implements the following two sampling methods flow sampling this method samples data packets from interfaces with sflow enabled according to a specific sampling method and ratio it captures the first 128 bytes of the original packet, encapsulates it in an sflow packet, and sends it to the collector the current version only supports flow sampling counter sampling the sflow agent device periodically obtains traffic statistics from the interface and encapsulates them in an sflow packet to be sent to the collector the collector is only concerned with the number of packets on the interface and not the specific details of the packets sflow configuration sflow configuration configuring sflow agent and sflow collector information configuring sflow agent and sflow collector information operation command description enter system configuration view configure terminal enable sflow sflow enable specify sflow collector information sflow collector name ip address \[ port ] specify sflow agent information sflow agent id {ethernet|vlan|loopback} id specify the source ip address of the sflow agent as a specific interface ip configuring sflow sampling methods configuring sflow sampling methods the device supports two types of flow sampling interface based flow sampling enable flow sampling on an interface and set the sampling ratio packets in the specified sampling direction on this interface will be sampled according to the specified ratio operation command description enter system configuration view configure terminal enter interface configuration view interface ethernet id configure interface sampling rate sflow sample rate number display and maintenance display and maintenance operation command description view sflow configuration information show sflow view interface sampling rates show sflow interface configuration example configuration example network requirements network requirements the pc is connected to the network through switcha, and the network administrator needs to monitor the traffic information of the pc to ensure the security of the network procedure procedure configure switcha's ip address sonic(config)# interface ethernet 1 sonic(config if 1)# ip address 10 1 10 1/24 sonic(config)# interface ethernet 2 sonic(config if 2)# ip address 10 1 20 1/24 sonic(config)# interface ethernet 3 sonic(config if 3)# ip address 192 168 0 1/24 enable sflow functionality sonic(config)# sflow enable sonic(config)# sflow collector test 192 168 0 100 sonic(config)# sflow agent id ethernet 3 enable interface based sflow sonic(config)# interface ethernet 1 sonic(config if 1)# sflow sample rate 10000
