Minimum Traffic Sampling or Forwarding Configuration
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 family family-name]hierarchy level. In the filterthenstatement, you must specify the action modifiersampleand the actionaccept.[edit firewall family family-name]filterfilter-name{termterm-name{then {sample;accept;}}}For more information about firewall filter actions and action modifiers, see the JUNOS Policy Framework Configuration Guide.
Another option is to configure the direction of traffic to be sampled by including the
samplingstatement at the[edit interfacesinterface-nameunitlogical-unit-numberfamily inet]hierarchy level, specifyinginput,output, or both.[edit interfacesinterface-nameunitlogical-unit-numberfamily inet]sampling {input;output;}
- Apply the filter to the interfaces on which you want to sample traffic by including the
addressandfilterstatements at the[edit interfaces interface-name unit logical-unit-number familyfamily-name]hierarchy level:[edit interfacesinterface-nameunitlogical-unit-numberfamily family-name]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:[edit forwarding-options]sampling {input {family inet{max-packets-per-secondnumber;ratenumber;}}}