#configure terminal | Enter configure mode. |
(config)#feature sflow | Enable the sFlow feature. |
(config)#sflow collector 2.2.2.2 port 6343 receiver-time-out 0 max-datagram-size 200 | Configure the sFlow collector.The IP address must be reachable via the management VRF. |
(config)#interface xe1 | Enter interface mode |
(config-if)#sflow poll-interval 5 | Set the counter poll Interval on the interface. |
(config-if)#sflow sampling-rate 1024 direction ingress max-header-size 200 | Set the sFlow sampling interval on the interface in ingress directions. |
(config-if)#sflow sampling-rate 1024 direction egress max-header-size 120 | Set the sFlow sampling interval on the interface in egress directions. |
(config-if)#sflow enable | Start packet sampling on the interface |
(config-if)#commit | Commit the candidate configuration to the running configuration |
(config-if)#end | Exit interface and configure mode. |