Switching

Expand all | Collapse all

Sflow config for 4300s

Jump to Best Answer
  • 1.  Sflow config for 4300s

    Posted 02-13-2019 14:47

    Is there an easy way to include all the interfaces to send sflow data instead of doing set sflow interfaces ge-x/x/x.x for each interface ?

     

    I already have the following

    {master:0} [edit protocols]

    username@vcname# show sflow

    polling-interval 10;

    sample-rate {

    ingress 500;

    egress500;

    }

    collector ip address of collector {

    udp-port 6343;

    }

    interfaces ge-0/0/7.0;

    interfaces xe-0/2/0.0;

    interfaces xe-1/2/0.0;

    {master:0}[edit protocols]


    #sflow


  • 2.  RE: Sflow config for 4300s

     
    Posted 02-13-2019 17:54
    Hi Modus,

    Please try this:

    set groups sflow_group protocols sflow interfaces <*> sample-rate ingress 4096
    set groups sflow_group protocols sflow interfaces <*> sample-rate egress 4096

    You can refer to this documentation for the apply-groups usage: https://www.juniper.net/documentation/en_US/junos/topics/topic-map/configuration-groups-usage.html

    To verify:
    show protocols sflow | display inheritance | display set


    Hope this helps.

    Regards,
    -r.

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

    If this solves your problem, please mark this post as "Accepted Solution."
    Kudos are always appreciated :).


  • 3.  RE: Sflow config for 4300s

     
    Posted 02-13-2019 20:03

    Hi Modus,

     

    Since we cannot configure an interface-range under sflow, there is no other option but to configure each interface  individually.  We can only use apply-groups to add the same sample-rate to all interfaces.

     

    Please refer this documentation for the apply-groups usage: https://www.juniper.net/documentation/en_US/junos/topics/topic-map/configuration-groups-usage.html

     

    root@Juniper# show groups sflo | display set

    set groups test protocols sflow interfaces <*> sample-rate ingress 4096

    set groups test protocols sflow interfaces <*> sample-rate egress 4096

     

    {master:0}[edit]

    root@Juniper# show protocols sflow | display set

    set protocols sflow agent-id 1.1.1.1

    set protocols sflow sample-rate ingress 4096

    set protocols sflow source-ip 1.1.1.1

    set protocols sflow collector 2.2.2.2 udp-port 6343

    set protocols sflow collector 3.3.3.3 udp-port 6343

    set protocols sflow interfaces xe-0/0/0.0 apply-groups test

    set protocols sflow interfaces xe-0/0/1.0 apply-groups test

     

    {master:0}[edit]

    root@Juniper# show protocols sflow | display inheritance

    agent-id 1.1.1.1;

    sample-rate ingress 4096;

    source-ip 1.1.1.1;

    collector 2.2.2.2 {

        udp-port 6343;

    }

    collector 3.3.3.3 {

        udp-port 6343;

    }

    interfaces xe-0/0/0.0 {

        ##

        ## 'sample-rate' was inherited from group 'test'

        ##

        sample-rate {

            ##

            ## '4096' was inherited from group 'test'

            ##

            ingress 4096;

            ##

            ## '4096' was inherited from group 'test'

            ##

            egress 4096;

        }

    }

    interfaces xe-0/0/1.0 {

        ##

        ## 'sample-rate' was inherited from group 'test'

        ##

        sample-rate {

            ##

            ## '4096' was inherited from group 'test'

            ##

            ingress 4096;

            ##

            ## '4096' was inherited from group 'test'

            ##

            egress 4096;

        }

    }

     

    {master:0}[edit]

    root@Juniper# show protocols sflow | display inheritance | display set

    set protocols sflow agent-id 1.1.1.1

    set protocols sflow sample-rate ingress 4096

    set protocols sflow source-ip 1.1.1.1

    set protocols sflow collector 2.2.2.2 udp-port 6343

    set protocols sflow collector 3.3.3.3 udp-port 6343

    set protocols sflow interfaces xe-0/0/0.0 sample-rate ingress 4096

    set protocols sflow interfaces xe-0/0/0.0 sample-rate egress 4096

    set protocols sflow interfaces xe-0/0/1.0 sample-rate ingress 4096

    set protocols sflow interfaces xe-0/0/1.0 sample-rate egress 4096

     

    In this example, we have a config group for applying sample-rate to interfaces and we apply this to protocols sflow interfaces<interface-name> and the sample rate gets inherited from the group "test".

     

     

    Hope this helps.

     

    Regards,

    -r.

     

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

     

    If this solves your problem, please mark this post as "Accepted Solution."

    Kudos are always appreciated :).



  • 4.  RE: Sflow config for 4300s
    Best Answer

    Posted 02-15-2019 06:41

    That sucks that we have to list ever interfaces and we can't do a wildcard. I'll just enter the uplinks