sFlow scenario 2

In this scenario, two hosts connected to different switches send sFlow traffic to a collector. A LAG is used to connect the two switches. The physical topology of the network looks like this:

Procedure

  1. Configure switch 1.
    1. Enable sFlow globally.

      switch# config

      switch(config)# sflow

    2. Set the sFlow agent IP address to 10.10.12.1.

      switch(config)# sflow agent-ip 10.10.12.1

    3. Set the sFlow collector IP address to 10.10.12.2.

      switch(config)# sflow collector 10.10.12.2

    4. Configure sFLow sampling rate and polling interval.

      switch(config)# sflow sampling 5000

      switch(config)# sflow polling 10

    5. Create VLAN 8.

      switch(config)# vlan 8

      switch(config-vlan-8)# no shutdown

      switch(config)# exit

    6. Define LAG 100 and assign VLAN vlan 8 to it.

      switch(config)# interface lag 100

      switch(config-lag-if)# no shutdown

      switch(config-lag-if)# no routing

      switch(config-lag-if)# vlan access 8

      switch(config-lag-if)# lacp mode active

    7. Configure interface 1/1/1.

      switch(config)# interface 1/1/1

      switch(config-if)# no shutdown

      switch(config-lag-if)# no routing

      switch(config-if)# vlan access 8

    8. Configure interface 1/1/2 and 1/1/3 as members of LAG 100.

      switch# (config)#interface 1/1/2

      switch(config-if)# no shutdown

      switch(config-if)# lag 100

      switch(config-if)# exit

      switch(config)# interface 1/1/3

      switch(config-if)# no shutdown

      switch(config-if)# lag 100

      switch(config-if)# exit

    9. Configure interface 1/1/4 with IP address 10.10.12.1/24.

      switch# (config)#interface 1/1/4

      switch(config-if)# no shutdown

      switch(config-if)# ip address 10.10.12.1/24

      switch(config-if)# quit

    10. Verify sFlow configuration.

    switch# show sflow

    sFlow Global Configuration

    -----------------------------------------

    sFlow enabled

    Collector IP/Port/Vrf 10.10.10.2/6343/default

    Agent Address 10.0.0.1

    Sampling Rate 1024

    Polling Interval 30

    Header Size 128

    Max Datagram Size 1400

     

    sFlow Status

    -----------------------------------------

    Running - Yes

     

    sFlow enabled on Interfaces:

    -----------------------------------------

    lag100

     

    sFlow Statistics

    -----------------------------------------

    Number of Samples 200

     
  2. Configure switch 2.
    1. Create VLAN 8.

      switch(config)# vlan 8 switch(config-vlan-8)# no shutdown switch(config)# exit

    2. Define LAG 100 and assign VLAN vlan 8 to it.

      switch(config)# interface lag 100

      switch(config-lag-if)# no shutdown

      switch(config-lag-if)# no routing

      switch(config-lag-if)# vlan access 8

      switch(config-lag-if)# lacp mode active

    3. Configure interface 1/1/1.

      switch(config)# interface 1/1/1

      switch(config-if)# no shutdown

      switch(config-lag-if)# no routing

      switch(config-if)# vlan access 8

    4. Configure interface 1/1/2 and 1/1/3 as members of LAG 100.

      switch# (config)#interface 1/1/2

      switch(config-if)# no shutdown

      switch(config-if)# lag 100

      switch(config-if)# exit

      switch(config)-if# interface 1/1/3

      switch(config-if)# no shutdown

      switch(config-if)# lag 100

      switch(config-if)# exit