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 polling 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: Getting Started. You must assign a unique name for each accounting profile; this name cross-references the information specified in theaccounting-optionshierarchy withinterfacesorfirewallconfiguration statements.Configure Physical 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;}}}}To enable accounting on an interface, include the
accounting-profilestatement at the [edit interfacesinterface-name] hierarchy level:[edit interfacesinterface-name]accounting-profilename;You can also reference profiles by logical unit; for more information, see Configure Logical Interface Profiles. For information about configuring a firewall filter accounting profile, see the JUNOS Internet Software Configuration Guide: Policy Framework.