Configure a routing policy to group source prefixes, and allow prefixes that match the policy statement to have a source class created for them:
- [edit]
- policy-options {
-
- policy-statement set-gold-class {
-
- term {
- from
- route-filter 10.210.0.0/16 orlonger;
- route-filter 10.215.0.0/16 orlonger;
-
- then {
- source-class gold-class;
- }
- }
- }
- }
Apply a routing policy to the forwarding table with the corresponding source class:
- [edit]
- routing-options {
-
- forwarding-table {
- export set-gold-class;
- }
- }
Enable packet counting on an interface. In this example, one interface accommodates both input and output:
- [edit interfaces]
- interfaces ge/0/0/0 {
-
- unit 0 {
-
- family inet {
-
- accounting {
-
- source-class-usage {
- input;
- output;
- }
- }
- }
- }
- }