Configuring an Accounting Scheme

You must configure an accounting scheme before implementing accounting for users.

Context

Users successfully go online after they are authenticated and authorized, and accounting starts when they access services. Accounting is performed based on online duration, traffic volume, or both. The accounting process is as follows: The NetEngine 8000 F collects statistics about the online duration and the upstream and downstream traffic, and sends the statistics to the RADIUS server in the format specified by the RADIUS protocol. The RADIUS server then returns a message indicating whether the accounting succeeds.

Perform the following steps on the router:

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run aaa

    The AAA view is displayed.

  3. Run realtime-accounting backup enable

    Real-time accounting backup is enabled between the master and slave main control boards.

    The realtime-accounting backup enable command needs to be run if the RADIUS server has a strict requirement on the interval at which real-time accounting packets are sent. After this command is run, the real-time accounting timer is reset on the master and slave main control boards. In this manner, even if a master/slave main control board switchover occurs during the interval for sending real-time accounting packets, the NetEngine 8000 F still sends real-time accounting packets at the configured interval.

  4. Run accounting-scheme acct-scheme-name

    An accounting scheme is created.

    The NetEngine 8000 F provides two fixed accounting schemes, namely default0 and default1, which can be modified but not deleted.
    • In the default0 accounting scheme, non-accounting is performed by default.
    • In the default1 and user-defined accounting schemes, RADIUS accounting is performed by default.

  5. Run accounting-mode { hwtacacs | none | radius }

    An accounting mode is configured.

    The NetEngine 8000 F supports RADIUS accounting, HWTACACS accounting, and non-accounting.

    Only administrative users, not common BRAS users, support HWTACACS accounting.

  6. (Optional) Run accounting interim interval interval [ second ] [ traffic ] [ hash ]The interval for real-time accounting and conditions for sending real-time accounting packets are configured and real-time accounting packets are hashed for the accounting scheme.

    Real-time accounting indicates that the NetEngine 8000 F periodically generates accounting packets and send them to the remote accounting server when a user is online. Real-time accounting minimizes loss of accounting information when the communication between the NetEngine 8000 F and the remote server is interrupted.

    The interval for real-time accounting can be set to minutes or seconds.

  7. (Optional) Run accounting start-fail { offline | online [ keep-accounting ] }

    The policy for handling accounting start failures is configured.

    If the NetEngine 8000 F does not receive any response after sending an Accounting Start packet to the remote accounting server, the NetEngine 8000 F adopts the policy for handling accounting start failures. This policy may keep the user online or log the user out.

  8. (Optional) Run accounting interim-fail [ max-times times ] { offline | online }

    The policy for handling real-time accounting failures is configured.

    If the NetEngine 8000 F does not receive any response after re-sending the real-time accounting packets to the remote accounting server for certain times, the NetEngine 8000 F adopts the policy for the real-time accounting failure. This policy may keep the user online or log the user out.

    When RADIUS accounting or HWTACACS accounting is used, you are advised to set the maximum number of retransmissions for real-time accounting packets to be greater than the maximum number of retransmissions for .

  9. (Optional) Run accounting send-update

    The NetEngine 8000 F is configured to send a real-time accounting packet immediately after receiving an Accounting Start response.

    After receiving an Accounting Start response from the accounting server, the NetEngine 8000 F determines whether to immediately send real-time accounting packets according to the configuration.

  10. (Optional) Enable the NetEngine 8000 F to send Accounting Start packets about users after a specified delay.
    1. Run quit

      The AAA view is displayed.

    2. Run domain domain-name

      The domain view is displayed.

    3. Run accounting-start-delay delay-time online user-type { ppp | ipoe | l2tp | static } * or accounting-start-delay delay-time offline [ user-type { ppp | ipoe | l2tp | static } * ]

      The NetEngine 8000 F is configured to delay the sending of Accounting Start packets.

    4. (Optional) Run accounting-start-delay ipv4 start-accounting immediately

      The NetEngine 8000 F is configured to send Accounting Start packets immediately after a dual-stack user goes online from the IPv4 stack.

      In a scenario where delayed accounting is enabled for a dual-stack user, if the dual-stack user goes online from the IPv4 stack first, an Accounting Start packet carrying the IPv4 address of the user is immediately sent. If the dual-stack user goes online from the IPv6 stack first, the NetEngine 8000 F sends an Accounting Start packet after the dual-stack user also goes online from the IPv4 stack or the timeout period expires.

    5. (Optional) Run accounting-start-delay traffic-forward before-start-accounting .

      The NetEngine 8000 F is configured to allow a dual-stack user who goes online only from the IPv4 or IPv6 stack to access the network before accounting is started.

      If accounting delay is enabled for a dual-stack user and the user does not go online using the second stack, the IP protocol stack from which the user has gone online is allowed to access the network.

    6. (Optional) Run accounting-stop-packet include all-stack-ip user-type ipoe

      The NetEngine 8000 F is configured to collect statistics about user traffic before Accounting Start packets are sent and report the statistics to the accounting server in a scenario where delayed accounting is enabled.

      If accounting delay is enabled for a dual-stack user and the user goes online from the IPv4 or IPv6 stack, the NetEngine 8000 F can collect statistics about user traffic before Accounting Start packets are sent and report the statistics to the accounting server.

    7. Run commit

      The configuration is committed.

  11. (Optional) Run accounting-stop-packet include all-stack-ip user-type ipoe

    The NetEngine 8000 F is configured to add all the assigned IP addresses to an Accounting Stop packet to be sent to the RADIUS server for an IPoE user. This prevents accounting failures caused by incomplete IP information carried in an Accounting Stop packet when a dual-stack user goes offline only from the IPv4 or IPv6 stack.

  12. (Optional) Configure an accounting copy scheme.
    1. Run quit

      The AAA view is displayed.

    2. Run accounting-copy-group group-name

      An accounting copy group is created and the accounting copy group view is displayed.

    3. Run radius-server group name [ interval interval-val ]

      An accounting copy server group and the interval at which the accounting copy packet information is sent to the accounting copy server group are configured.

      You are advised to set interval interval-val to a value greater than or equal to 60.

    4. Run commit

      The configuration is committed.

    5. Run quit

      The AAA view is displayed.

    6. Run domain domain-name

      The domain view is displayed.

    7. Run accounting-copy-group group-name

      The accounting copy group is bound to the domain.

  13. Run commit

    The configuration is committed.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >