sflow direction

Use this command to enter into the sub-menu of sflow configuration mode to configure the sFlow sampling direction. It is applicable for both sFlow Global and Interface mode. Use show sflow global to verify this configuration.

In sFlow global and interface configuration mode, the attributes sampling-rate and max-header-size could not be deleted individually, the entire sflow direction sampling must be deleted. The attributes sampling-rate and max-header-size can have their values updated. Any change in the sampling rate restarts the ongoing sampling of existing data-source interfaces, if any.

The sFlow sampling direction on the interface configuration mode includes additional attribute disable which is used to stop the sFlow monitoring on the selected sampling direction. When the disable attribute is removed, the sFlow sampling starts again in the given direction.

Use no parameter of this command to remove this configuration. sFlow interface config take precedence over global sFlow configuration.

Data packets to the CPU are rate limited. In case of unknown Unicast, the rate limit is applied to such packets as well as sampled data packets.

Command Syntax

Copy
Global Config Mode
sflow direction (ingress | egress)
sampling-rate <1024-16777215>
max-header-size <16-256>
exit

no sflow direction (egress | ingress)
Copy
Interface Config Mode
sflow direction (egress | ingress)
 sampling-rate <1024-16777215>
 max-header-size <16-256>
 disable
exit

no sflow direction (egress | ingress)

Parameters

direction

The direction of sampling an interface.

ingress

Ingress traffic

egress

Egress traffic

<1024-16777215>

The range value for sampling rate.

<16-256>

Maximum header size in bytes.

disable

Disable the sFlow sampling in the given direction.

Default

None

Command Mode

sFlow global config mode

sFlow interface config mode

Applicability

This command was introduced before OcNOS version 1.3 The sFlow interface config mode and sFlow global config mode is introduced in OcNOS version 6.6.1

Examples

Copy
Global Config Mode
OcNOS#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
OcNOS(config)#feature sflow
OcNOS(config)#
OcNOS(config)#sflow direction egress
OcNOS(config-global-sflow)#sampling-rate 2048
OcNOS(config-global-sflow)#max-header-size 80
OcNOS(config-global-sflow)#exit
OcNOS(config)#commit
OcNOS(config)#sflow direction ingress
OcNOS(config-global-sflow)#sampling-rate 4096
OcNOS(config-global-sflow)#max-header-size 90
OcNOS(config-global-sflow)#exit
OcNOS(config)#commit
OcNOS(config)#
OcNOS(config)#interface eth1
OcNOS(config-if)#sflow enable
OcNOS(config-if)#exit
OcNOS(config)#commit
Copy
Interface Config Mode
OcNOS#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
OcNOS(config)#feature sflow
OcNOS(config)#
OcNOS(config)#interface eth2
OcNOS(config-if)#sflow direction egress
OcNOS(config-if-sflow)#sampling-rate 2048
OcNOS(config-if-sflow)#max-header-size 80
OcNOS(config-if-sflow)#disable
OcNOS(config-if-sflow)#exit
OcNOS(config-if)#sflow direction ingress
OcNOS(config-if-sflow)#sampling-rate 4096
OcNOS(config-if-sflow)#max-header-size 90
OcNOS(config-if-sflow)#disable
OcNOS(config-if-sflow)#exit
OcNOS(config-if)#commit
OcNOS(config-if)#exit
OcNOS(config)#