RADIUS (Remote Authentication in Dial-In User Service) es un protocolo de red para la implementación de autenticación, autorización y recopilación de información sobre los recursos utilizados. Está diseñado para transferir información entre la plataforma central y los clientes/dispositivos de la red. Su servidor de acceso remoto (RADIUS) puede comunicarse con un servidor/servicio central (por ejemplo, un controlador de dominio de Active Directory) para autenticar a los clientes de marcación remota y autorizarlos a acceder a algunos servicios o recursos de la red. Gracias a esto, puede utilizar un único sistema de autenticación centralizado en su dominio.
En este artículo, mostraremos cómo configurar el servidor RADIUS centralizado basado en el sistema operativo Windows Server 2016 y cómo configurar la autenticación RADIUS en dispositivos Cisco mediante el servicio Network Policy Server (NPS). En este ejemplo, el RADIUS usará el AD para autenticar a los usuarios remotos y autorizarlos a acceder a la interfaz de línea de comandos de los conmutadores y enrutadores de Cisco (que actúan como clientes de RADIUS).
Instalación de la función Radius Server (NPS) en Windows Server 2016
Al principio, cree un nuevo grupo de seguridad en el dominio de Active Directory (por ejemplo, RemoteCiscoUsers) en el que deberá agregar todos los usuarios que podrán autenticarse en los enrutadores y conmutadores de Cisco (¿cómo agregar un usuario al grupo de Active Directory? ).
A partir de Windows Server 2008 R2, la funcionalidad del servidor RADIUS se implementó con la función Servicios de directivas de red (NPS). Con la función NPS, puede autenticar clientes remotos en Active Directory mediante el protocolo Radius.
Por lo tanto, debe instalar la función del servidor RADIUS en su Windows Server 2016. Abra el Administrador del servidor consola y ejecutar el Agregar funciones y funciones mago. El protocolo RADIUS (Remote Authentication Dial In User Service) de Windows Server 2016 forma parte de la función del servidor de directivas de redes. En el asistente que aparece, seleccione el Política de red y servicios de acceso rol en el paso de selección de rol.
Nota. Además, puede instalar funciones de NPS y herramientas de administración desde una consola de PowerShell elevada:
Install-WindowsFeature NPAS -IncludeManagementTools
Una vez completada la instalación del rol, abra el Servidor de directivas de red (nps.msc) en el menú Herramientas.
Para usar el servidor NPS en el dominio, debe registrarlo en Active Directory. En el complemento NPS, haga clic con el botón derecho en una raíz y seleccione Registrar servidor en Active Directory.
Confirme el registro del servidor en Active Directory.
Además, puede registrar su servidor NPS en Active Directory con un comando:
netsh ras add registeredserver
En este caso, el servidor tendrá autoridad para leer las propiedades de las cuentas de usuario de Active Directory para autenticar a los usuarios. El servidor se agregará al grupo de dominio integrado. Servidores RAS e IAS.
Ahora puede agregar el cliente Radius. Radius client es el dispositivo desde el cual su servidor recibirá solicitudes de autenticación. En este ejemplo, podría ser un enrutador Cisco, un conmutador, un punto de acceso Wi-Fi, etc.
Para agregar el nuevo cliente Radius, expanda el Clientes y servidores RADIUS en el árbol de la consola de NPS y seleccione Nuevo sobre el Clientes RADIUS ít.
En la pestaña Configuración, complete los campos Nombre amigablecliente Habla a (puede especificar la dirección IP o el nombre DNS), y Secreto compartido + Confirmar compartido contraseña (utilizará esta contraseña en la configuración del conmutador/enrutador Cisco).
Nota. La contraseña secreta compartida rara vez se usa en grandes redes corporativas debido a los problemas con la distribución de claves compartidas. En lugar de contraseñas compartidas, se recomienda utilizar certificados. Si tiene una autoridad de certificación corporativa implementada para implementar la infraestructura PKI, puede solicitar e importar un certificado *.p12 para el servidor Radius/NPS. Simplemente agregue el certificado al almacén de certificación personal en la máquina local.
En la pestaña Avanzado, seleccione Nombre del proveedor: Cisco.
Puede usar el comando PowerShell en lugar de la GUI de NPS para agregar un nuevo cliente RADIUS. En este caso, puede usar el cmdlet de PowerShell New-NpsRadiusClient.
New-NpsRadiusClient –Dirección "192.168.31.1" –Nombre "cisco2960" –SharedSecret "Zb+kp^JUy]vePb-hQ*d=weya2AY?hn+npRRp[/J7d"
Configuring NPS Policies on the RADIUS Server
NPS policies allow you to authenticate remote users and grant them access permissions configured in the NPS role. Using NPS access policies, you can make a link to the RADIUS client records and the domain security group that determines the level of access to CISCO devices.
There are two types of policies on a RADIUS server:
- Connection request policies — these policies define a set of conditions that determines which RADIUS servers should authenticate and authorize connection requests received from RADIUS clients;
- Network policies — a set of conditions and settings that allow you to specify who is authorized to connect to your network and a list of assigned access permissions. These policies are processed sequentially from the top to down;
In our case, we will use only the NPS Network policies. Expand the Policies > Network Policies branch and select New:
Specify the Policy name, the type of network access server should remain unchanged (Unspecified).
In the next step Specify conditions, you need to add the conditions under which this RADIUS policy will be applied. Let’s add two conditions — the authorized user must be a member of a specific domain security group, and the device you want to access has a certain name. Use the Add to create a new condition by selecting the Windows Group type (add the RemoteCiscoUsers group) and specify the Client Friendly Name (Cisco_*).
Note. The Client Friendly Name field may differ from the DNS name of your device. We will need it in the future to identify a specific network device when creating access policies — Remote Access Policy. Using this name, you can specify, for example, a mask by which several different RADIUS clients will be processed by a single access policy.
On the next screen, select Access Granted.
Because our Cisco switch supports only the Unencrypted authentication method (PAP, SPAP), we’ll uncheck all other options.
Skip the next configuration Constraints step.
In the Configure Settings section, go to the RADIUS Attributes > Standard section. Delete the existing attributes there and click the Add button.
Select Access type > All, then Service-Type > Add. Specify Others = Login.
Now add a new attribute in the RADIUS Attributes > Vendor Specific section. Under Vendor, select Cisco, and click Add. Here you need to add information about the attribute. Click Add and specify the following value:
shell: priv-lvl = 15
This value means that the user authorized by this policy will be granted a maximum (15) administrative access permission on the Cisco device.
The last screen displays all selected NPS policy settings. Click Finish.
Hint. You can backup the current NPS server configuration to the XML file using the command:
Export-NpsConfiguration -Path c:psbackup_nps.xmlIf you need to restore NPS configuration from a previously created backup file, run:
Import-NpsConfiguration -Path c:psbackup_nps.xml
When creating and planning RADIUS policies, pay attention to what matters their order. Policies are processed from the top to down, and when it turns out that all the conditions in the next policy are met, their further processing is terminated. You can change the priorities of policies in the NPS console using the Processing Order value.
To enable the user account to be used for Radius authentication, open the Active Directory Users and Computers console (dsa.msc), find the user, open its properties, go to the Dial-In tab and select the Control access through NPS Network Policy option in the Network Access Permission section.
Also, you can check the current option value using PowerShell:
Get-ADUser richard.doe -Properties msNPAllowDialin -Server dc1.theitbros.com
If the above command did not return any result (empty), this means that the default value “Control access through NPS Network Policy” is used.
If you want to reset this user attribute to the default state, use the command:
Set-ADUser richard.doe -Clear msNPAllowDialin -Server dc1.theitbros.com
Or you can reset this attribute for all users in the specific Organizational Unit (OU) using the LDAP filter:
Get-ADUser -SearchBase "ou=Users,ou=Paris,dc=theitbros,dc=com" -LDAPFilter "(msNPAllowDialin=*)" | % {Set-ADUser $_ -Clear msNPAllowDialin}
Configuring RADIUS Setting on Cisco Devices
After creating the policy, you can proceed to configure your Cisco routers or switches for authentication on the newly installed Radius NPS server.
Because we use domain accounts for authorization, the user credentials must be transmitted over the network in an encrypted form. To do this, disable the telnet protocol on the switch and enable SSHv2 on Cisco using the following commands in configuration mode:
configure terminal crypto key generate rsa modulus 1024 ip ssh version 2
AAA works in such a way: if the response from the server is not received, the client assumes unsuccessful authentication. Be sure to create a local user in case the RADIUS server is unavailable for any reason.
You can create a local user with the following command:
username cisco_local password [email protected]
In order to make the use of SSH mandatory and disable remote access using Telnet, execute the following commands:
line vty 5 15 transport input ssh
Below is an example of the configuration for authorizing a Radius server for the Cisco Catalyst Switch:
aaa new-model aaa authentication login default group radius local aaa authorization exec default group radius if-authenticated radius-server host 192.168.1.16 key Sfs34e#sf #Specify your RADIUS server IP address and key for encryption (the shared secret that we specified on the RADIUS server) service password-encryption # Enable password encryption If you have several Radius servers, add them to the group: aaa group server radius radius_srv_group server 192.168.1.16 server 192.168.101.16
This completes the minimum switch configuration and you can try to check Radius authentication on your Cisco device.
How to Check the NPS/RADIUS Logs on Windows?
In order to enable NPS Server Radius Authentication logging, you need to enable the Network Policy Server audit policy. You can enable this policy via the local Group Policy Editor or with the following commands:
auditpol /get /subcategory:"Network Policy Server" auditpol /set /subcategory:"Network Policy Server" /success:enable /failure:enable
Now you can open the Event Viewer console (eventvwr.msc), go to the Windows Logs > Security, and filter the event by the Event ID 6272.
Network Policy Server granted access to a user.
If you need to find all NPS authorizations event for the specific user (Richard.Doe in this example), use the next PowerShell script:
$Query = @" <QueryList> <Query Id="0" Path="Security"> <Select Path="Security"> *[EventData[Data[@Name="SubjectUserName"] y (Datos=theitbrosrichard.doe')]]y *[System[(EventID='6272')]] "@ $events = Get-WinEvent -FilterXML $Query $ipaddr = @{ label="IP"; Expression={$_.properties[9].valor} } $eventos | seleccione $ipaddr | grupo "PI" | format-table Recuento, Nombre -autosize
Recomendado para ti
- Amazon Prime Video (Video on Demand)
- Joseph Gordon-Levitt, Shailene Woodley, Melissa Leo (Actors)
- Oliver Stone (Director)
- Amazon Prime Video (Video on Demand)
- Cristián Paredes, José Juan Rodríguez, María Isabel Díaz (Actors)
- Globomedia The Mediapro Studio (Director)
- Amazon Prime Video (Video on Demand)
- Christoffer Nordenrot, Jesper Barkselius, Lisa Henni (Actors)
- Victor Danell (Director)