To configure traffic sampling on a logical interface, you must perform at least the following tasks:
- Create a firewall filter to apply to the logical interfaces being sampled by including the
filterstatement at the[edit firewall familyfamily-name]hierarchy level. In the filterthenstatement, you must specify the action modifiersampleand the actionaccept.filterfilter-name{termterm-name{then {sample;accept;}}}For more information about firewall filter actions and action modifiers, see the JUNOS Policy Framework Configuration Guide.
- Apply the filter to the interfaces on which you want to sample traffic by including the
addressandfilterstatements at the[edit interfacesinterface-nameunitlogical-unit-numberfamilyfamily-name]hierarchy level:addressaddress{destinationdestination-address;}filter{inputfilter-name;}Enable sampling and specify a nonzero sampling rate by including the samplingstatement at the[edit forwarding-options]hierarchy level:sampling{input{familyinet {max-packets-per-secondnumber;ratenumber;}}}