aaa accounting
To enable authentication, authorization, and accounting (AAA) accounting of requested services for billing or security purposes when you use RADIUS or TACACS+, use the aaa accounting command in global configuration mode or template configuration mode. To disable AAA accounting, use the no form of this command.
aaa accounting {auth-proxy | system | network | exec | connection | commands level | dot1x} {default | list-name | guarantee-first} [vrf vrf-name] {start-stop | stop-only | none} [broadcast] {radius | group group-name}
no aaa accounting {auth-proxy | system | network | exec | connection | commands level | dot1x} {default | list-name | guarantee-first} [vrf vrf-name] {start-stop | stop-only | none} [broadcast] {radius | group group-name}
Syntax Description
auth-proxy |
Provides information about all authenticated-proxy user events. |
||
system |
Performs accounting for all system-level events not associated with users, such as reloads.
|
||
network |
Runs accounting for all network-related service requests, including Serial Line Internet Protocol (SLIP), PPP, PPP Network Control Protocols (NCPs), and AppleTalk Remote Access Protocol (ARAP). |
||
exec |
Runs accounting for the EXEC shell session. This keyword might return user profile information such as what is generated by the autocommand command. |
||
connection |
Provides information about all outbound connections made from the network access server, such as Telnet, local-area transport (LAT), TN3270, packet assembler and disassembler (PAD), and rlogin. |
||
commands level |
Runs accounting for all commands at the specified privilege level. Valid privilege level entries are integers from 0 through 15. |
||
dot1x |
Provides information about all IEEE 802.1x-related user events. |
||
default |
Uses the listed accounting methods that follow this keyword as the default list of methods for accounting services. |
||
list-name |
Character string used to name the list of at least one of the following accounting methods:
|
||
guarantee-first |
Guarantees system accounting as the first record. |
||
vrf vrf-name |
(Optional) Specifies a virtual routing and forwarding (VRF) configuration. VRF is used only with system accounting. |
||
start-stop |
Sends a “start” accounting notice at the beginning of a process and a “stop” accounting notice at the end of a process. The “start” accounting record is sent in the background. The requested user process begins regardless of whether the “start” accounting notice was received by the accounting server. |
||
stop-only |
Sends a stop accounting record for all cases including authentication failures regardless of whether the aaa accounting send stop-record authentication failure command is configured. |
||
none |
Disables accounting services on this line or interface. |
||
broadcast |
(Optional) Enables sending accounting records to multiple AAA servers. Simultaneously sends accounting records to the first server in each group. If the first server is unavailable, failover occurs using the backup servers defined within that group. |
||
radius |
Runs the accounting service for RADIUS. |
||
group group-name |
Specifies the accounting method list. Enter at least one of the following keywords:
|
||
delay-start |
Delays PPP network start records until the peer IP address is known. |
||
send |
Sends records to the accounting server. |
||
stop-record |
Generates stop records for a specified event. |
||
authentication |
Generates stop records for authentication failures. |
||
failure |
Generates stop records for authentication failures. |
||
success |
Generates stop records for authenticated users. |
||
remote-server |
Specifies that the users are successfully authenticated through access-accept message, by a remote AAA server. |
Command Default
AAA accounting is disabled.
Command Modes
Global configuration (config)
Command History
Release |
Modification |
---|---|
10.3 |
This command was introduced. |
12.0(5)T |
Group server support was added. |
12.1(1)T |
The broadcast keyword was added on the Cisco AS5300 and Cisco AS5800 universal access servers. |
12.1(5)T |
The auth-proxy keyword was added. |
12.2(1)DX |
The vrf keyword and vrf-name argument were added on the Cisco 7200 series and Cisco 7401ASR. |
12.2(2)DD |
This command was integrated into Cisco IOS Release 12.2(2)DD. |
12.2(4)B |
This command was integrated into Cisco IOS Release 12.2(4)B. |
12.2(13)T |
The vrf keyword and vrf-name argument were integrated into Cisco IOS Release 12.2(13)T. |
12.2(15)B |
The tunnel and tunnel-link accounting methods were introduced. |
12.3(4)T |
The tunnel and tunnel-link accounting methods were integrated into Cisco IOS Release 12.3(4)T. |
12.2(28)SB |
This command was integrated into Cisco IOS Release 12.2(28)SB. |
12.2(33)SRA |
This command was integrated into Cisco IOS Release 12.2(33)SRA. |
12.4(11)T |
The dot1x keyword was integrated into Cisco IOS Release 12.4(11)T. |
12.2(33)SXH |
This command was integrated into Cisco IOS Release 12.2(33)SXH. |
12.2(33)SXI |
This command was integrated into Cisco IOS Release 12.2(33)SXI. |
Cisco IOS XE Release 2.6 |
This command was integrated into Cisco IOS XE Release 2.6. The radius keyword was added. |
15.3(1)S |
This command was integrated into Cisco IOS Release 15.3(1)S. |
Usage Guidelines
General Information
Use the aaa accounting command to enable accounting and to create named method lists that define specific accounting methods on a per-line or per-interface basis.
The table below contains descriptions of keywords for AAA accounting methods.
Keyword |
Description |
---|---|
group group-name |
Uses a subset of RADIUS or TACACS+ servers for accounting as defined by the server group group-name argument. |
group radius |
Uses the list of all RADIUS servers for authentication as defined by the aaa group server radius command. |
group tacacs+ |
Uses the list of all TACACS+ servers for authentication as defined by the aaa group server tacacs+ command. |
In the table above, the group radius and group tacacs + methods refer to a set of previously defined RADIUS or TACACS+ servers. Use the radius-server host and tacacs-server host commands to configure the host servers. Use the aaa group server radius and aaa group server tacacs+ commands to create a named group of servers.
Cisco IOS software supports the following two methods of accounting:
-
RADIUS--The network access server reports user activity to the RADIUS security server in the form of accounting records. Each accounting record contains accounting attribute-value (AV) pairs and is stored on the security server.
-
TACACS+--The network access server reports user activity to the TACACS+ security server in the form of accounting records. Each accounting record contains accounting AV pairs and is stored on the security server.
Method lists for accounting define the way accounting will be performed. Named accounting method lists enable you to designate a particular security protocol to be used on specific lines or interfaces for particular types of accounting services. Create a list by entering values for the list-name argument where list-name is any character string used to name this list (excluding the names of methods, such as RADIUS or TACACS+) and method list keywords to identify the methods to be tried in sequence as given.
If the aaa accounting command for a particular accounting type is issued without a named method list specified, the default method list is automatically applied to all interfaces or lines (where this accounting type applies) except those that have a named method list explicitly defined. (A defined method list overrides the default method list.) If no default method list is defined, then no accounting takes place.
Note |
System accounting does not use named accounting lists; you can define the default list only for system accounting. |
For minimal accounting, include the stop-only keyword to send a “stop” accounting record for all cases including authentication failures. For more accounting, you can include the start-stop keyword, so that RADIUS or TACACS+ sends a “start” accounting notice at the beginning of the requested process and a “stop” accounting notice at the end of the process. Accounting is stored only on the RADIUS or TACACS+ server. The none keyword disables accounting services for the specified line or interface.
To specify an accounting configuration for a particular VRF, specify a default system accounting method list, and use the vrf keyword and vrf-name argument. System accounting does not have knowledge of VRF unless VRF is specified.
When AAA accounting is activated, the network access server monitors either RADIUS accounting attributes or TACACS+ AV pairs pertinent to the connection, depending on the security method you have implemented. The network access server reports these attributes as accounting records, which are then stored in an accounting log on the security server. For a list of supported RADIUS accounting attributes, see the appendix “RADIUS Attributes” in the Cisco IOS Security Configuration Guide . For a list of supported TACACS+ accounting AV pairs, see the appendix “TACACS+ Attribute-Value Pairs” in the Cisco IOS Security Configuration Guide .
Note |
This command cannot be used with TACACS or extended TACACS. |
Cisco Service Selection Gateway Broadcast Accounting
To configure Cisco Service Selection Gateway (SSG) broadcast accounting, use ssg_broadcast_accounting for the list-name argument. For more information about configuring SSG, see the chapter “Configuring Accounting for SSG” in the Cisco IOS Service Selection Gateway Configuration Guide , Release 12.4.
Layer 2 LAN Switch Port
You must configure the RADIUS server to perform accounting tasks, such as logging start, stop, and interim-update messages and time stamps. To turn on these functions, enable logging of “Update/Watchdog packets from this AAA client” in your RADIUS server Network Configuration tab. Next, enable “CVS RADIUS Accounting” in your RADIUS server System Configuration tab.
You must enable AAA before you can enter the aaa accounting command. To enable AAA and 802.1X (port-based authentication), use the following global configuration mode commands:
-
aaa new-model
-
aaa authentication dot1x default group radius
-
dot1x system-auth-control
Use the show radius statistics command to display the number of RADIUS messages that do not receive the accounting response message.
Use the aaa accounting system default start-stop group radius command to send “start” and “stop” accounting records after the router reboots. The “start” record is generated while the router is booted and the stop record is generated while the router is reloaded.
The router generates a “start” record to reach the AAA server. If the AAA server is not reachable, the router retries sending the packet four times. The retry mechanism is based on the exponential backoff algorithm. If there is no response from the AAA server, the request will be dropped.
Establishing a Session with a Router if the AAA Server Is Unreachable
The aaa accounting system guarantee-first command guarantees system accounting as the first record, which is the default condition. In some situations, users may be prevented from starting a session on the console or terminal connection until after the system reloads, which can take more than three minutes.
To establish a console or telnet session with the router if the AAA server is unreachable when the router reloads, use the no aaa accounting system guarantee-first start-stop radius command.
Note |
Entering the no aaa accounting system guarantee-first command is not the only condition by which the console or telnet session can be started. For example, if the privileged EXEC session is being authenticated by TACACS and the TACACS server is not reachable, then the session cannot start. |
Examples
The following example shows how to define a default command accounting method list, where accounting services are provided by a TACACS+ security server, set for privilege level 15 commands with a stop-only restriction:
aaa accounting commands 15 default stop-only group tacacs+
The following example shows how to defines a default auth-proxy accounting method list, where accounting services are provided by a TACACS+ security server with a start-stop restriction. The aaa accounting command activates authentication proxy accounting.
aaa new-model
aaa authentication login default group tacacs+
aaa authorization auth-proxy default group tacacs+
aaa accounting auth-proxy default start-stop group tacacs+
The following example shows how to define a default system accounting method list, where accounting services are provided by RADIUS security server “server1” with a start-stop restriction. The aaa accounting command specifies accounting for vrf “vrf1.”
aaa accounting system default vrf vrf1 start-stop group server1
The following example shows how to define a default IEEE 802.1x accounting method list, where accounting services are provided by a RADIUS server. The aaa accounting command activates IEEE 802.1x accounting.
aaa new model
aaa authentication dot1x default group radius
aaa authorization dot1x default group radius
aaa accounting dot1x default start-stop group radius
The following example shows how to enable network accounting and send tunnel and tunnel-link accounting records to the RADIUS server. (Tunnel-Reject and Tunnel-Link-Reject accounting records are automatically sent if either start or stop records are configured.)
aaa accounting network tunnel start-stop group radius
aaa accounting network session start-stop group radius
The following example shows how to enable IEEE 802.1x accounting:
aaa accounting dot1x default start-stop group radius
aaa accounting system default start-stop group radius