Configure Accounting
Juniper Networks routers can collect various kinds of data about traffic passing through the router. You can set up one or more accounting profiles that specify some common characteristics of this data, including the following:
- The fields used in the accounting records
- The number of files that the router retains before discarding, and the number of bytes per file
- The period that the system uses to record the data
You configure the profiles using statements in the
accounting-optionshierarchy; for more information, see the JUNOS Internet Software Configuration Guide: Network Management. You must assign a unique name for each accounting profile; this name cross-references the information specified in theaccounting-optionshierarchy withinterfacesorfirewallconfiguration statements.Configure Logical Interface Profiles
There are two types of accounting profiles: interface profiles and filter profiles. They have different configuration statements in the
accounting-profileshierarchy, and are implemented separately in either theinterfacesorfirewallhierarchy. If you reference the same profile from both a firewall filter and an interface statement within the same configuration, it causes an error.The following is a sample
accounting-optionsprofile for an interface; for more information, see the JUNOS Internet Software Configuration Guide: Network Management:[edit]accounting-options {file if_stats {size 4m files 10transfer-interval15;archive-sites {"ftp://login:password@host/path";}}interface-profile if_profile {interval 15;file if_stats {fields {input-bytes;output-bytes;input-packets;output-packets;input-errors;output-errors;}}}}Generally, you configure interface profiles at the physical interface level; however, you can also reference them to a particular logical circuit within the routing network. To enable accounting on a specific circuit, include the
accounting-profilestatement at the [edit interfacesinterface-nameunitlogical-unit-number] hierarchy level:[edit interfacesinterface-name]accounting-profilename1;unit 0 {accounting-profilename2;}To reference profiles by physical interface, see Configure Physical Interface Profiles. For information about configuring a firewall filter accounting profile, see the JUNOS Internet Software Configuration Guide: Policy Framework.