简介
本文档介绍如何在不使用无线客户端的情况下,使用思科 WLC 上的 test aaa radius 命令来识别 RADIUS 服务器连接问题和客户端身份验证问题。
先决条件
要求
思科建议您了解无线LAN控制器(WLC)代码8.2及更高版本。
使用的组件
本文档不限于特定的软件和硬件版本。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
背景信息
无线客户端身份验证问题是无线网络工程师所面临的最困难问题之一。要进行故障排除,通常需要找到有问题的客户端,与对无线网络一无所知的最终用户合作,并收集调试和捕获信息。在日益重要的无线网络中,这类问题可能会导致大量停机。
到目前为止,还没有一种简单的方法可以确定身份验证失败到底是由拒绝客户端的 RADIUS 服务器引起的,还是只是由可访问性问题引起的。test aaa radius 命令可以帮助您找到答案。现在,您可以远程验证 WLC 和 RADIUS 服务器之间的通信是否失败,或者客户端的凭证是否通过了身份验证。
功能工作方式
下图显示了使用命令 test aaa radius 时的基本工作流程。

步骤 1: WLC 向 RADIUS 服务器发送访问请求消息以及 test aaa radius 命令中提到的参数。
例如:test aaa radius username admin password cisco123 wlan-id 1 apgroup default-group server-index 2
步骤 2: RADIUS 服务器验证所提供的凭证,并提供身份验证请求的结果。
命令语法
执行该命令需要提供以下参数:
(思科控制器)> test aaa radius username <user name> password <password> wlan-id <wlan-id> apgroup <apgroup-name> server-index <server-index>
<username> ---> Username that you are testing.
<password> ---> Password that you are testing
<wlan-id> ---> WLAN ID of the SSID that you are testing.
<apgroup-name> (optional) ---> AP group name. This will be default-group if there is no AP group configured.
<server-index> (optional) ---> The server index configured for the radius server that you are trying to test. This can be found under Security > Authentication tab.
场景 1. 通过身份验证尝试
让我们看一看命令如何工作,当test aaa radius命令导致通过身份验证时会显示输出。执行该命令时,WLC 会显示与访问请求一起发送的参数:
(Cisco Controller) >test aaa radius username admin password cisco123 wlan-id 1 apgroup default-group server-index 2
Radius Test Request
Wlan-id........................................ 1
ApGroup Name................................... default-group
Attributes Values
---------- ------
User-Name admin
Called-Station-Id 00:00:00:00:00:00:WLC5508
Calling-Station-Id 00:11:22:33:44:55
Nas-Port 0x0000000d (13)
Nas-Ip-Address 10.20.227.39
NAS-Identifier WLC_5508
Airespace / WLAN-Identifier 0x00000001 (1)
User-Password cisco123
Service-Type 0x00000008 (8)
Framed-MTU 0x00000514 (1300)
Nas-Port-Type 0x00000013 (19)
Tunnel-Type 0x0000000d (13)
Tunnel-Medium-Type 0x00000006 (6)
Tunnel-Group-Id 0x00000051 (81)
Cisco / Audit-Session-Id ad14e327000000c466191e23
Acct-Session-Id 56131b33/00:11:22:33:44:55/210
test radius auth request successfully sent. Execute 'test aaa show radius' for response
要查看身份验证请求的结果,您需要执行命令 test aaa show radius。如果 RADIUS 服务器无法访问,且 WLC 需要重试或回退到其他 RADIUS 服务器,则该命令可能需要一些时间才能显示输出。
(Cisco Controller) >test aaa show radius
Radius Test Request
Wlan-id........................................ 1
ApGroup Name................................... default-group
Server Index................................... 2
Radius Test Response
Radius Server Retry Status
------------- ----- ------
10.20.227.52 1 Success
Authentication Response:
Result Code: Success
Attributes Values
---------- ------
User-Name admin
Class CACS:rs-acs5-6-0-22/230677882/20313
Session-Timeout 0x0000001e (30)
Termination-Action 0x00000000 (0)
Tunnel-Type 0x0000000d (13)
Tunnel-Medium-Type 0x00000006 (6)
Tunnel-Group-Id 0x00000051 (81)
该命令非常有用的一个方面是,它会显示 RADIUS 服务器返回的属性。这可以是重定向 URL 和访问控制列表 (ACL)。 例如,对于集中式 Web 身份验证 (CWA) 或使用 VLAN 覆盖时的 VLAN 信息。
警告:访问请求中的用户名/密码以明文形式发送到 RADIUS 服务器,因此,如果流量通过不安全的网络传输,则需谨慎使用此功能。
方案 2:未通过身份验证尝试
让我们看看当用户名/密码输入导致身份验证失败时如何显示输出。
(Cisco Controller) >test aaa show radius
Radius Test Request
Wlan-id........................................ 1
ApGroup Name................................... default-group
Server Index................................... 2
Radius Test Response
Radius Server Retry Status
------------- ----- ------
10.20.227.52 1 Success
Authentication Response:
Result Code: Authentication failed ------>This indicates that the user authentication will fail.
No AVPs in Response
在本例中,您可以看到连接测试的结果是“成功”,但 RADIUS 服务器针对所使用的用户名/密码组合发送了 access-reject。
情形 3:WLC 和 RADIUS 服务器之间的通信失败
(Cisco Controller) >test aaa show radius
previous test command still not completed, try after some time
您需要等待WLC完成重试才能显示输出。所需时间可能因配置的重试阈值而异。
(Cisco Controller) >test aaa show radius
Radius Test Request
Wlan-id........................................ 1
ApGroup Name................................... default-group
Server Index................................... 3
Radius Test Response
Radius Server Retry Status
------------- ----- ------
10.20.227.72 6 No response received from server
Authentication Response:
Result Code: No response received from server
No AVPs in Response
在此输出中,您可以看到WLC尝试联系radius服务器6次,当没有响应时,它将radius服务器标记为不可达。
场景 4:RADIUS 回退
当您在服务集标识符 (SSID) 下配置了多个 RADIUS 服务器且主 RADIUS 服务器不响应时,WLC 会尝试联系所配置的辅助 RADIUS 服务器。这在输出中显示得非常清楚:第一个 RADIUS 服务器没有响应,然后 WLC 尝试联系第二个 RADIUS 服务器,并获得立即响应。
(Cisco Controller) >test aaa show radius
Radius Test Request
Wlan-id........................................ 1
ApGroup Name................................... default-group
Radius Test Response
Radius Server Retry Status
------------- ----- ------
10.20.227.62 6 No response received from server
10.20.227.52 1 Success
Authentication Response:
Result Code: Success
Attributes Values
---------- ------
User-Name admin
注意事项
- 当前不提供 GUI 支持。该命令只能从 WLC 执行。
- 验证仅适用于 RADIUS。不能将其用于 TACACS 身份验证。
- 不能使用该方法测试 Flexconnect 本地身份验证。