Configuring RADIUS schemes
A RADIUS scheme specifies the RADIUS servers that the device can work with and defines a set of parameters. The device uses the parameters to exchange information with the RADIUS servers, including the server IP addresses, UDP port numbers, shared keys, and server types.
Configuration task list
Configuring a test profile for RADIUS server status detection
Use a test profile to detect whether a RADIUS authentication server is reachable at a detection interval. To detect the RADIUS server status, you must configure the RADIUS server to use this test profile in a RADIUS scheme.
With the test profile specified, the device sends a detection packet to the RADIUS server within each detection interval. The detection packet is a simulated authentication request that includes the specified user name in the test profile.
If the device receives a response from the server within the interval, it sets the server to the active state.
If the device does not receive any response from the server within the interval, it sets the server to the blocked state.
The device refreshes the RADIUS server status at each detection interval according to the detection result.
The device stops detecting the status of the RADIUS server when one of the following operations is performed:
The RADIUS server is removed from the RADIUS scheme.
The test profile configuration is removed for the RADIUS server in RADIUS scheme view.
The test profile is deleted.
The RADIUS server is manually set to the blocked state.
The RADIUS scheme is deleted.
To configure a test profile for RADIUS server status detection:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Configure a test profile for detecting the status of RADIUS authentication servers. | radius-server test-profile profile-name username name [ interval interval ] | By default, no test profiles exist. You can configure multiple test profiles in the system. |
Creating a RADIUS scheme
Create a RADIUS scheme before performing any other RADIUS configurations. You can configure a maximum of 16 RADIUS schemes. A RADIUS scheme can be used by multiple ISP domains.
To create a RADIUS scheme:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Create a RADIUS scheme and enter RADIUS scheme view. | radius scheme radius-scheme-name | By default, no RADIUS schemes exist. |
Specifying the RADIUS authentication servers
A RADIUS authentication server completes authentication and authorization together, because authorization information is piggybacked in authentication responses sent to RADIUS clients.
You can specify one primary authentication server and a maximum of 16 secondary authentication servers for a RADIUS scheme. When the primary server is not available, the device searches for the secondary servers in the order they are configured. The first secondary server in active state is used for communication.
If redundancy is not required, specify only the primary server. A RADIUS authentication server can function as the primary authentication server for one scheme and a secondary authentication server for another scheme at the same time.
To specify RADIUS authentication servers for a RADIUS scheme:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Specify RADIUS authentication servers. |
| By default, no authentication servers are specified. To support server status detection, specify an existing test profile for the RADIUS authentication server. If the test profile does not exist, the device cannot detect the server status. Two authentication servers in a scheme, primary or secondary, cannot have the same combination of IP address, port number, and VPN instance. |
Specifying the RADIUS accounting servers and the relevant parameters
You can specify one primary accounting server and a maximum of 16 secondary accounting servers for a RADIUS scheme. When the primary server is not available, the device searches for the secondary servers in the order they are configured. The first secondary server in active state is used for communication.
If redundancy is not required, specify only the primary server. A RADIUS accounting server can function as the primary accounting server for one scheme and a secondary accounting server for another scheme at the same time.
The device sends a stop-accounting request to the accounting server in the following situations:
The device receives a connection teardown request from a host.
The device receives a connection teardown command from an administrator.
When the maximum number of real-time accounting attempts is reached, the device disconnects users who have no accounting responses.
RADIUS does not support accounting for FTP, SFTP, and SCP users.
To specify RADIUS accounting servers and the relevant parameters for a RADIUS scheme:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Specify RADIUS accounting servers. |
| By default, no accounting servers are specified. Two accounting servers in a scheme, primary or secondary, cannot have the same combination of IP address, port number, and VPN instance. |
4. (Optional.) Set the maximum number of real-time accounting attempts. | retry realtime-accounting retries | The default setting is 5. |
Specifying the shared keys for secure RADIUS communication
The RADIUS client and server use the MD5 algorithm and shared keys to generate the Authenticator value for packet authentication and user password encryption. The client and server must use the same key for each type of communication.
A key configured in this task is for all servers of the same type (accounting or authentication) in the scheme. The key has a lower priority than a key configured individually for a RADIUS server.
To specify a shared key for secure RADIUS communication:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Specify a shared key for secure RADIUS communication. | key { accounting | authentication } { cipher | simple } string | By default, no shared key is specified for secure RADIUS communication. The shared key configured on the device must be the same as the shared key configured on the RADIUS server. |
Specifying an MPLS L3VPN instance for the scheme
The VPN instance specified for a RADIUS scheme applies to all authentication and accounting servers in that scheme. If a VPN instance is also configured for an individual RADIUS server, the VPN instance specified for the RADIUS scheme does not take effect on that server.
To specify a VPN instance for a scheme:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Specify a VPN instance for the RADIUS scheme. | vpn-instance vpn-instance-name | By default, a RADIUS scheme belongs to the public network. |
Setting the username format and traffic statistics units
A username is in the userid@isp-name format, where the isp-name argument represents the user's ISP domain name. By default, the ISP domain name is included in a username. However, older RADIUS servers might not recognize usernames that contain the ISP domain names. In this case, you can configure the device to remove the domain name of each username to be sent.
If two or more ISP domains use the same RADIUS scheme, configure the RADIUS scheme to keep the ISP domain name in usernames for domain identification.
The device reports online user traffic statistics in accounting packets. The traffic measurement units are configurable, but they must be the same as the traffic measurement units configured on the RADIUS accounting servers.
To set the username format and the traffic statistics units for a RADIUS scheme:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Set the format for usernames sent to the RADIUS servers. | user-name-format { keep-original | with-domain | without-domain } | By default, the ISP domain name is included in a username. |
4. (Optional.) Set the data flow and packet measurement units for traffic statistics. | data-flow-format { data { byte | giga-byte | kilo-byte | mega-byte } | packet { giga-packet | kilo-packet | mega-packet | one-packet } }* | By default, traffic is counted in bytes and packets. |
Setting the maximum number of RADIUS request transmission attempts
RADIUS uses UDP packets to transfer data. Because UDP communication is not reliable, RADIUS uses a retransmission mechanism to improve reliability. A RADIUS request is retransmitted if the NAS does not receive a server response for the request within the response timeout timer. For more information about the RADIUS server response timeout timer, see "Setting RADIUS timers."
You can set the maximum number for the NAS to retransmit a RADIUS request to the same server. When the maximum number is reached, the NAS tries to communicate with other RADIUS servers in active state. If no other servers are in active state at the time, the NAS considers the authentication or accounting attempt a failure.
To set the maximum number of RADIUS request transmission attempts:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Set the maximum number of RADIUS request transmission attempts. | retry retries | The default setting is 3. |
Setting the status of RADIUS servers
To control the RADIUS servers with which the device communicates when the current servers are no longer available, set the status of RADIUS servers to blocked or active. You can specify one primary RADIUS server and multiple secondary RADIUS servers. The secondary servers function as the backup of the primary server. The device chooses servers based on the following rules:
When the primary server is in active state, the device communicates with the primary server.
If the primary server fails, the device performs the following operations:
Changes the server status to blocked.
Starts a quiet timer for the server.
Tries to communicate with a secondary server in active state that has the highest priority.
If the secondary server is unreachable, the device performs the following operations:
Changes the server status to blocked.
Starts a quiet timer for the server.
Tries to communicate with the next secondary server in active state that has the highest priority.
The search process continues until the device finds an available secondary server or has checked all secondary servers in active state. If no server is available, the device considers the authentication or accounting attempt a failure.
When the quiet timer of a server expires or you manually set the server to the active state, the status of the server changes back to active. The device does not check the server again during the authentication or accounting process.
When you remove a server in use, communication with the server times out. The device looks for a server in active state by first checking the primary server, and then checking secondary servers in the order they are configured.
When all servers are in blocked state, the device only tries to communicate with the primary server.
When one or more servers are in active state, the device tries to communicate with these active servers only, even if the servers are unavailable.
When a RADIUS server's status changes automatically, the device changes this server's status accordingly in all RADIUS schemes in which this server is specified.
When a RADIUS server is manually set to blocked, server detection is disabled for the server, regardless of whether a test profile has been specified for the server. When the RADIUS server is set to active state, server detection is enabled for the server on which an existing test profile is specified.
By default, the device sets the status of all RADIUS servers to active. However, in some situations, you must change the status of a server. For example, if a server fails, you can change the status of the server to blocked to avoid communication attempts to the server.
To set the status of RADIUS servers:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Set the RADIUS server status. |
| By default, a RADIUS server is in active state. The configured server status cannot be saved to any configuration file, and can only be viewed by using the display radius scheme command. After the device restarts, all servers are restored to the active state. |
Specifying the source IP address for outgoing RADIUS packets
The source IP address of RADIUS packets that a NAS sends must match the IP address of the NAS configured on the RADIUS server. A RADIUS server identifies a NAS by its IP address. Upon receiving a RADIUS packet, a RADIUS server checks whether the source IP address of the packet is the IP address of a managed NAS.
If it is the IP address of a managed NAS, the server processes the packet.
If it is not the IP address of a managed NAS, the server drops the packet.
The source address of outgoing RADIUS packets is typically the IP address of an egress interface on the NAS to communicate with the RADIUS server. However, in some situations, you must change the source IP address. For example, when VRRP is configured for stateful failover, configure the virtual IP of the uplink VRRP group as the source address.
You can specify a source IP address for outgoing RADIUS packets in RADIUS scheme view or in system view.
The IP address specified in RADIUS scheme view applies only to one RADIUS scheme.
The IP address specified in system view applies to all RADIUS schemes whose servers are in a VPN or the public network.
Before sending a RADIUS packet, the NAS selects a source IP address in the following order:
The source IP address specified for the RADIUS scheme.
The source IP address specified in system view for the VPN or public network, depending on where the RADIUS server resides.
The IP address of the outbound interface specified by the route.
To specify a source IP address for all RADIUS schemes in a VPN or the public network:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Specify a source IP address for outgoing RADIUS packets. | radius nas-ip { ipv4-address | ipv6 ipv6-address } [ vpn-instance vpn-instance-name ] | By default, the IP address of the RADIUS packet outbound interface is used as the source IP address. |
To specify a source IP address for a RADIUS scheme:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Specify a source IP address for outgoing RADIUS packets. | nas-ip { ipv4-address | ipv6 ipv6-address } | By default, the source IP address specified by the radius nas-ip command in system view is used. If the source IP address is not specified, the IP address of the outbound interface is used. |
Setting RADIUS timers
The device uses the following types of timers to control communication with a RADIUS server:
Server response timeout timer (response-timeout)—Defines the RADIUS request retransmission interval. The timer starts immediately after a RADIUS request is sent. If the device does not receive a response from the RADIUS server before the timer expires, it resends the request.
Server quiet timer (quiet)—Defines the duration to keep an unreachable server in blocked state. If one server is not reachable, the device changes the server status to blocked, starts this timer for the server, and tries to communicate with another server in active state. After the server quiet timer expires, the device changes the status of the server back to active.
Real-time accounting timer (realtime-accounting)—Defines the interval at which the device sends real-time accounting packets to the RADIUS accounting server for online users.
When you set RADIUS timers, follow these guidelines:
When you configure the maximum number of RADIUS packet transmission attempts and the RADIUS server response timeout timer, consider the number of secondary servers. If the retransmission process takes too much time, the client connection in the access module (for example, Telnet) might time out during the process.
For client connections with a short timeout period, the initial authentication or accounting might fail, even if small packet transmission attempt limit and server response timeout period are configured. However, the next authentication or accounting attempt can succeed, because the device has set the unreachable servers to blocked, which shortens the amount of time for finding a reachable server.
Make sure the server quiet timer is set correctly. A timer that is too short might result in frequent authentication or accounting failures. This is because the device will continue to attempt to communicate with an unreachable server that is in active state. A timer that is too long might temporarily block a reachable server that has recovered from a failure. This is because the server will remain in blocked state until the timer expires.
A short real-time accounting interval helps improve accounting precision but requires many system resources. When there are 1000 or more users, set the interval to 15 minutes or longer.
To set RADIUS timers:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Set the RADIUS server response timeout timer. | timer response-timeout seconds | The default setting is 3 seconds. |
4. Set the quiet timer for the servers. | timer quiet minutes | The default setting is 5 minutes. |
5. Set the real-time accounting timer. | timer realtime-accounting interval [ second ] | The default setting is 12 minutes. |
Configuring the accounting-on feature
When the accounting-on feature is enabled, the device automatically sends an accounting-on packet to the RADIUS server after a reboot. Upon receiving the accounting-on packet, the RADIUS server logs out all online users so they can log in again through the device. Without this feature, users cannot log in again after the reboot, because the RADIUS server considers them to come online.
You can configure the interval for which the device waits to resend the accounting-on packet and the maximum number of retries.
The RADIUS server must run on IMC to correctly log out users when a card reboots on the distributed device to which the users connect.
The extended accounting-on feature enhances the accounting-on feature by applying to the scenario that an SPU reboots but the device does not reboot. For the extended accounting-on feature to take effect, you must enable the accounting-on feature.
When the extended accounting-on feature is enabled, the device automatically sends an accounting-on packet to the RADIUS server after an SPU reboot. The packet contains both the device and SPU identifiers. Upon receiving the accounting-on packet, the RADIUS server logs out all online users who access the device through the SPU.
The extended accounting-on feature is applicable to IPoE, LAN, and PPP (L2TP LAC-side) users. Data of these users is saved to the SPUs through which the users access the device.
To configure the accounting-on feature for a RADIUS scheme:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Enable accounting-on. | accounting-on enable [ interval interval | send send-times ] * | By default, the accounting-on feature is disabled. |
4. (Optional.) Enable extended accounting-on. | accounting-on extended | By default, extended accounting-on is disabled. |
Interpreting the RADIUS class attribute as CAR parameters
A RADIUS server may deliver CAR parameters for user-based traffic monitoring and control by using the RADIUS class attribute (attribute 25) in RADIUS packets. You can configure the device to interpret the class attribute to CAR parameters.
To configure the device to interpret the RADIUS class attribute as CAR parameters:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Interpret the RADIUS class attribute as CAR parameters. | attribute 25 car | By default, the RADIUS class attribute is not interpreted as CAR parameters. |
Configuring the Login-Service attribute check method for SSH, FTP, and terminal users
The device supports the following check methods for the Login-Service attribute (RADIUS attribute 15) of SSH, FTP, and terminal users:
Strict—Matches Login-Service attribute values 50, 51, and 52 for SSH, FTP, and terminal services, respectively.
Loose—Matches the standard Login-Service attribute value 0 for SSH, FTP, and terminal services.
An Access-Accept packet received for a user must contain the matching attribute value. Otherwise, the user cannot log in to the device.
Use the loose check method only when the server does not issue Login-Service attribute values 50, 51, and 52 for SSH, FTP, and terminal users.
To configure the Login-Service attribute check method for SSH, FTP, and terminal users:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Configure the Login-Service attribute check method for SSH, FTP, and terminal users. | attribute 15 check-mode { loose | strict } | The default check method is strict. |
Setting the data measurement unit for the Remanent_Volume attribute
The RADIUS server uses Remanent_Volume attribute in authentication or real-time accounting responses to notify the device of the current amount of data available for online users.
Perform this task to set the data measurement unit for the Remanent_Volume attribute. Make sure the configured measurement unit is the same as the user data measurement unit on the RADIUS server.
To set the data measurement unit for the Remanent_Volume attribute:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter RADIUS scheme view. | radius scheme radius-scheme-name | N/A |
3. Set the data measurement unit for the Remanent_Volume attribute. | attribute remanent-volume unit { byte | giga-byte | kilo-byte | mega-byte } | By default, the data measurement unit is kilobyte. |
Enabling SNMP notifications for RADIUS
When SNMP notifications are enabled for RADIUS, the SNMP agent supports the following notifications generated by RADIUS:
RADIUS server unreachable notification—The RADIUS server cannot be reached. RADIUS generates this notification if it does not receive a response to an accounting or authentication request within the specified number of RADIUS request transmission attempts.
RADIUS server reachable notification—The RADIUS server can be reached. RADIUS generates this notification for a previously blocked RADIUS server after the quiet timer expires.
Excessive authentication failures notification—The number of authentication failures compared to the total number of authentication attempts exceeds the specified threshold.
For RADIUS SNMP notifications to be sent correctly, you must also configure SNMP on the device. For more information about SNMP configuration, see the network management and monitoring configuration guide for the device.
To enable SNMP notifications for RADIUS:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enable SNMP notifications for RADIUS. | snmp-agent trap enable radius [ accounting-server-down | accounting-server-up | authentication-error-threshold | authentication-server-down | authentication-server-up ] * | By default, all SNMP notifications are disabled for RADIUS. |
Displaying and maintaining RADIUS
Execute display commands in any view and reset commands in user view.
Task | Command |
---|---|
Display the RADIUS scheme configuration. | display radius scheme [ radius-scheme-name ] |
Display RADIUS packet statistics. | display radius statistics |
Clear RADIUS statistics. | reset radius statistics |