{"id":6376,"date":"2026-05-04T12:10:35","date_gmt":"2026-05-04T12:10:35","guid":{"rendered":"http:\/\/docs.connexite.co.uk\/index.php\/docs\/connexite-documentation\/synapse-cli-documentation\/cli-configure-sflow\/"},"modified":"2026-05-04T12:19:10","modified_gmt":"2026-05-04T12:19:10","slug":"cli-configure-sflow","status":"publish","type":"docs","link":"https:\/\/docs.connexite.co.uk\/index.php\/docs\/network\/synapse-cli-documentation\/cli-configure-sflow\/","title":{"rendered":"Configure sFlow"},"content":{"rendered":"<h2 class=\"connexite-doc-h2\">Overview<\/h2>\n<p>sFlow is a network monitoring technology jointly developed by InMon , HP and Foundry Networks in 2001. It has been standardized and can provide complete second to fourth layer information and can adapt to traffic analysis in extremely large network traffic environments. Allows users to analyze the performance , trends and existing problems of network transmission streams in detail and in real time. sFlow has the following advantages:<\/p>\n<ul class=\"connexite-doc-list\">\n<li>Enables precise monitoring of network traffic on gigabit or higher-speed networks.<\/li>\n<li>sFlow Collector can monitor thousands or hundreds of sFlow Agents, has good scalability.<\/li>\n<li>sFlow agent is embedded in the network device and the cost is low.<\/li>\n<\/ul>\n<h2 class=\"connexite-doc-h2\">Principle<\/h2>\n<p>sFlow system composition As shown in the figure, the sFlow system includes an sFlow Agent embedded in the device and a remote sFlow Collector. Among them, sFlow Agent obtains interface statistics and data information through sFlow sampling, and encapsulates the information into sFlow messages. When the sFlow message buffer is full or the sFlow message cache time times out (the cache time is 1 second), sFlow Agent The sFlow message will be sent to the specified sFlow Collector. sFlow Collector analyzes sFlow messages and displays the analysis results. sFlow sampling sFlow Agent provides two sampling methods for users to analyze network traffic conditions from different perspectives, namely Flow sampling and Counter sampling.<\/p>\n<h2 class=\"connexite-doc-h2\">Flow sampling<\/h2>\n<p>Flow sampling means that the sFlow Agent device performs sampling and analysis on packets on a specified interface according to a specific sampling direction and sampling comparison to obtain information related to the packet data content. This sampling method mainly focuses on the details of traffic, so that the traffic behavior on the network can be monitored and analyzed. Field<\/p>\n<h2 class=\"connexite-doc-h2\">Raw packet<\/h2>\n<p>Intercept all or part of the header of the original message (the specific length of the interception is determined by the configuration), encapsulate this part of the original message into an sFlow message and send it to the Collector.<\/p>\n<h2 class=\"connexite-doc-h2\">Ethernet Frame Data<\/h2>\n<p>For Ethernet messages, parse the Ethernet header information of the message, encapsulate the parsed data into sFlow messages and send them to the Collector.<\/p>\n<h2 class=\"connexite-doc-h2\">Extended Switch Data<\/h2>\n<p>For forwarded Ethernet packets, record the VLAN conversion and VLAN priority conversion of the packets, encapsulate the forwarding information into sFlow packets and send them to the Collector. When the VLAN ID is 0, it indicates an invalid VLAN.<\/p>\n<h2 class=\"connexite-doc-h2\">Counter sampling<\/h2>\n<p>Counter sampling allows the sFlow Agent device to periodically obtain traffic statistics information on the interface. Counter sampling supports the acquisition of sampling information as shown in the following table. Compared with Flow sampling, Counter sampling only focuses on the quantity of traffic on the interface, but not on the detailed information of the traffic. Field<\/p>\n<h2 class=\"connexite-doc-h2\">Generic Interface Counters<\/h2>\n<p>General interface statistics, including basic interface information and general interface traffic statistics.<\/p>\n<h2 class=\"connexite-doc-h2\">Ethernet Interface Counters<\/h2>\n<p>For the Ethernet interface, it is used to collect Ethernet-related traffic statistics.<\/p>\n<h2 class=\"connexite-doc-h2\">Processor Information<\/h2>\n<p>Used to count device CPU usage and memory usage. sFlow message sFlow messages are encapsulated by UDP, and the default destination port number is the well-known port 6343. There are four header formats for sFlow messages, namely Flow sample, Expanded Flow sample, Counter sample, and Expanded Counter sample. The Expanded Flow sample and Expanded Counter sample are new additions to sFlow version 5 and are extensions of the Flow sample and Counter sample, but are not forward compatible. All Extended sampling content must be encapsulated using the Expanded sampling packet header.<\/p>\n<h2 class=\"connexite-doc-h2\">Configuration commands<\/h2>\n<ul class=\"connexite-doc-list\">\n<li>Configure agent address<\/li>\n<\/ul>\n<h2 class=\"connexite-doc-h2\">Order<\/h2>\n<pre class=\"connexite-doc-command\"><code>SWITCH( config )# sflow agent { ip IPV4ADDR | ipv6 IPV6ADDR }<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH( config )# no sflow agent { ip | ipv6}<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">describe Configure\/delete a gent address; IPV4ADDR: agent\/ device IPv4 address IPV6ADDR: a gent\/device IPv6 address Supports configuring ipv 4 and ipv 6 addresses at the same time, for collectors of ipv 4 and ipv 6 respectively There is no configuration by default. If not configured, the protocol may not send packets.<\/p>\n<h2 class=\"connexite-doc-h2\">Order<\/h2>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config )# sflow collector &lt;1-2&gt; { ip IPV4ADDR | ipv6 IPV6ADDR } [datagram-size &lt;200-9000&gt; | port &lt;1024-65535&gt; | description STRING ]<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config )# no sflow collector &lt;1-2&gt;<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">describe Configure\/delete collector; &lt;1-2&gt;: collector index IPV4ADDR: collector\/ server IPv4 address IPV6ADDR: collector\/ server IPv6 address &lt;200-9000&gt;: Maximum length of data packet, optional, default 1 400 &lt;1024-65535&gt;: Server port number, optional, default 6 343 STRING: c collector description information, optional, default is none<\/p>\n<h2 class=\"connexite-doc-h2\">Order<\/h2>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config -if) #sflow flow -sampling collector &lt;1-2&gt;<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config -if)# no flow-sampling collector<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">describe Configure\/delete interface flow sampling; &lt;1-2&gt;: c collector index ss<\/p>\n<h2 class=\"connexite-doc-h2\">Order<\/h2>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config -if)# sflow counter-sampling collector &lt;1-2&gt;<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config -if)# no counter-sampling collector<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">describe Configure\/delete interface counter sampling; &lt;1-2&gt;: collector index ss<\/p>\n<h2 class=\"connexite-doc-h2\">Order<\/h2>\n<pre class=\"connexite-doc-command\"><code>SWITCH( config-if)# sflow flow-sampling direction { inbound | outbound }<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH( config-if)# sflow flow-sampling rate &lt;1024-65536&gt;<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH( config-if)# sflow flow-sampling max-header &lt;18-256&gt;<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH( config-if)# no flow-sampling direction<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config -if)# no flow-sampling rate<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config -if)# no flow-sampling max-header<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">describe Configure\/ reset interface flow sampling parameters; { inbound | outbound } : flow sampling direction, optional, the default is to sample inbound + outbound at the same time &lt;1024-65536&gt;: flow sampling rate, optional, default is 2 048, one sample for every 2 048 flows &lt;18-256&gt; : Flow sampling message length, unit byte, optional, default 6 4<\/p>\n<h2 class=\"connexite-doc-h2\">Order<\/h2>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config -if)# sflow counter-sampling interval &lt;3-65535&gt;<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config -if)# no sflow counter-sampling interval<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">describe Configure\/reset interface counter sampling parameters; &lt;3-65535&gt;: counter sampling period, unit seconds, optional, default 1 0<\/p>\n<h2 class=\"connexite-doc-h2\">Examples<\/h2>\n<h2 class=\"connexite-doc-h2\">Requirements<\/h2>\n<p>sFlow network management server is 2.2.2.2 and the device IP address is 2.2.2.95. The network management server needs to monitor the status of device port 3 through sFlow . It is required to perform flow sampling and counter sampling at the same time. The parameters can be defaulted. Configurations<\/p>\n<h2 class=\"connexite-doc-h2\">Initialize network management configuration<\/h2>\n<pre class=\"connexite-doc-command\"><code>SWITCH#<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH#configure terminal<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">Enter configuration commands, one per line. End with CNTL\/Z.<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config )# sflow -agent- ip 2.2.2.95<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config )# sflow collector 1 ip 2.2.2.2<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config )#<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">Configure sampling for port 3<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH( config)#int gi 0\/3<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH( config-if)#sflow flow-sampling collector 1<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH( config-if)#sflow counter-sampling collector 1<\/code><\/pre>\n<h2 class=\"connexite-doc-h2\">Display Information<\/h2>\n<ul class=\"connexite-doc-list\">\n<li>Show sFlow<\/li>\n<\/ul>\n<pre class=\"connexite-doc-command\"><code>SWITCH#show sflow<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">Collector 1: Address: 2.2.2.2 Agent: 2.2.2.95 Port: 6343 Datagram-Size: 1400 Description: Fd : 11 Seq: 45 Tx Timer: (nil) Buf : 0xab0d8 Alloc : 1400 Used: 0 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- | Flow | Counter | Interface | ID Rate Direction Max-header Sequence | ID Interval Sequence | &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- GiE0\/3 1 2048 both 64 2 1 10 7462<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH#<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Networking \u203a Switching \u203a Edge \u203a Synapse<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":6349,"menu_order":27,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[115,119,116],"class_list":["post-6376","docs","type-docs","status-publish","hentry","doc_tag-connexite","doc_tag-network","doc_tag-synapse-cli-documentation","no-post-thumbnail"],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/docs\/6376","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=6376"}],"version-history":[{"count":1,"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/docs\/6376\/revisions"}],"predecessor-version":[{"id":6424,"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/docs\/6376\/revisions\/6424"}],"up":[{"embeddable":true,"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/docs\/6349"}],"wp:attachment":[{"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=6376"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/doc_tag?post=6376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}