简介
本文档介绍如何使用设备分类器动态XML支持功能更新Catalyst 9800 WLC上的设备分类器。
先决条件
要求
Cisco 9800 WLC基础知识和设备分类。
使用的组件
本文档中的信息基于以下软件和硬件版本:
- C9800-CL v17.12.4、v17.15.4ES和v17.18.2ES
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
配置
配置
默认情况下,在WLC上的dc_profile_dir文件夹下可以找到.xml文件的示例:
C9800#dir bootflash:dc_profile_dir
Directory of bootflash:/dc_profile_dir/
393224 -rw- 443023 Dec 23 2025 07:14:35 +00:00 dc_embedded_profiles.txt.bkp
393233 -rw- 303835 Dec 23 2025 07:14:35 +00:00 dc_default_profiles.txt
393222 -rw- 443023 Dec 23 2025 07:14:35 +00:00 dc_embedded_profiles.txt
393223 -rw- 1367 Dec 23 2025 07:14:35 +00:00 dc_user_profiles.xml
393221 -rw- 303835 Dec 18 2025 07:13:57 +00:00 dc_default_profiles.txt.bkp
例如,在进行任何更改之前,客户端详细信息如下:
C9800#show wireless client mac-address 74da.38eb.c01f detail
Client MAC Address : 74da.38eb.c01f
Client MAC Type : Universally Administered Address
Client DUID: NA
Client IPv4 Address : 10.14.42.101
...
Device Classification Information:
Device Type : Microsoft-Workstation
Device Name : DESKTOP-R2CH8G5
Protocol Map : 0x000009 (OUI, DHCP)
Device Vendor : MSFT 5.0
Device Protocol : DHCP
Type : 12 19
Data : 13
00000000 00 0c 00 0f 44 45 53 4b 54 4f 50 2d 52 32 43 48 |....DESKTOP-R2CH|
00000010 38 47 35 |8G5 |
Type : 60 12
Data : 0c
00000000 00 3c 00 08 4d 53 46 54 20 35 2e 30 |.<..MSFT 5.0 |
Type : 55 18
Data : 12
00000000 00 37 00 0e 01 03 06 0f 1f 21 2b 2c 2e 2f 77 79 |.7.......!+,./wy|
00000010 f9 fc |.. |
...
C9800#show device classifier mac-address 74da.38eb.c01f detail
Client Mac: 74da.38eb.c01f
Device Type: Microsoft-Workstation
Confidence Level: 10
Device Name: DESKTOP-R2CH8G5
Device Vendor: MSFT 5.0
可以根据不同的协议对客户端进行分类。
根据DHCP对客户端进行分类
编辑.xml文件,在此示例中,应用以下规则:
<?xml version="1.0" encoding="UTF-8"?>
<DeviceList>
<CopyRight>版权所有(c)2021-2022 Cisco Systems, Inc.保留所有权利。</CopyRight>
<Version>1.0</Version>
<Device>
<DeviceType>Sample_Profile_2</DeviceType>
<RuleName>Sample_Rule_1</RuleName>
<RuleOperator>或</RuleOperator>
<RuleCertaintyMetric>20</RuleCertaintyMetric>
<Check>
<Protocol>DHCP</Protocol>
<TLV-Type>60</TLV-Type>
<TLV-Value-Type>字符串</TLV-Value-Type>
<TLV-Value>MSFT</TLV-Value>
</Check>
</Device>
</DeviceList>
此处使用的值与之前的show wireless client mac-address [mac] detail输出中的值相同。
选择粗体部分是为了避免使用空格,因为它们可能会导致解析错误。但它可能是输出的开始、中间或最后部分。
对于度量:选择20为其提供更高的度量,因此它优先。度量越高,首选项就越高。
将文件直接复制到bootflash。
从CLI:
copy {ftp: | tftp:} {flash:}
或者从GUI:
管理>管理>文件管理器
bootflash:
上传
之后,文件必须在WLC上可用:
C9800#more bootflash:dc_user_profiles.xml
<?xml version="1.0" encoding="UTF-8"?>
<DeviceList>
<CopyRight>Copyright (c) 2021-2022 by Cisco Systems, Inc. All rights reserved.</CopyRight>
<Version>1.0</Version>
<Device>
<DeviceType>Sample_Profile_2</DeviceType>
<RuleName>Sample_Rule_1</RuleName>
<RuleOperator>OR</RuleOperator>
<RuleCertaintyMetric>20</RuleCertaintyMetric>
<Check>
<Protocol>DHCP</Protocol>
<TLV-Type>60</TLV-Type>
<TLV-Value-Type>String</TLV-Value-Type>
<TLV-Value>MSFT</TLV-Value>
</Check>
</Device>
</DeviceList>
启用设备分类器:
C9800#config t
C9800(config)#device classifier
现在,创建的配置文件将显示在此输出下:
C9800#show device classifier profile type custom
Valid Type Profile Name mCon ID
----------------------------------------------------------------------------
Valid Custom Sample_Profile_2 1 0
之后,客户分类必须更改:
如果客户端已连接,请断开连接,然后重新连接客户端。
C9800#clear wireless client device cache
!--- To clear any classification cache
C9800#show wireless client mac-address 74da.38eb.c01f detail
Client MAC Address : 74da.38eb.c01f
Client MAC Type : Universally Administered Address
Client DUID: NA
Client IPv4 Address : 10.14.42.101
...
Device Classification Information:
Device Type : Sample_Profile_2
Device Name : DESKTOP-R2CH8G5
Protocol Map : 0x000009 (OUI, DHCP)
Device Vendor : MSFT 5.0
Device Protocol : DHCP
Type : 12 19
Data : 13
00000000 00 0c 00 0f 44 45 53 4b 54 4f 50 2d 52 32 43 48 |....DESKTOP-R2CH|
00000010 38 47 35 |8G5 |
Type : 60 12
Data : 0c
00000000 00 3c 00 08 4d 53 46 54 20 35 2e 30 |.<..MSFT 5.0 |
Type : 55 18
Data : 12
00000000 00 37 00 0e 01 03 06 0f 1f 21 2b 2c 2e 2f 77 79 |.7.......!+,./wy|
00000010 f9 fc |.. |
...
C9800#show device classifier mac-address 74da.38eb.c01f detail
Client Mac: 74da.38eb.c01f
Device Type: Sample_Profile_2
Confidence Level: 20
Device Name: DESKTOP-R2CH8G5
Device Vendor: MSFT 5.0
根据17.18之前的OUI对客户端进行分类
警告:Cisco Bug ID CSCws(Cisco Bug ID为CSCws)中当前正在修复此问题66837
.跟踪Bug以进行修复。
编辑.xml文件,在此示例中,应用以下规则:
<?xml version="1.0" encoding="UTF-8"?>
<DeviceList>
<CopyRight>版权所有(c)2021-2022 Cisco Systems, Inc.保留所有权利。</CopyRight>
<Version>4.3</Version>
<Device>
<DeviceType>Test-3</DeviceType>
<RuleName>Cisco-Rule</RuleName>
<RuleOperator>AND</RuleOperator>
<RuleCertaintyMetric>20</RuleCertaintyMetric>
<Check>
<Protocol>MAC</Protocol>
<TLV-Value-Type>字符串</TLV-Value-Type>
<TLV-Value>Edimax</TLV-Value>
</Check>
</Device>
</DeviceList>
此处的字符串是基于MAC地址的前缀选择的。这可以从IEEE定义的标准OUI中进行检查。
将文件直接复制到bootflash。
从CLI:
copy {ftp: | tftp:} {flash:}
或者从GUI:
管理>管理>文件管理器
bootflash:
上传
之后,文件必须在WLC上可用:
C9800#more bootflash:dc_user_profiles.xml
<?xml version="1.0" encoding="UTF-8"?>
<DeviceList>
<CopyRight>Copyright (c) 2021-2022 by Cisco Systems, Inc. All rights reserved.</CopyRight>
<Version>4.3</Version>
<Device>
<DeviceType>Test-3</DeviceType>
<RuleName>Cisco-Rule</RuleName>
<RuleOperator>AND</RuleOperator>
<RuleCertaintyMetric>20</RuleCertaintyMetric>
<Check>
<Protocol>MAC</Protocol>
<TLV-Value-Type>String</TLV-Value-Type>
<TLV-Value>Edimax</TLV-Value>
</Check>
</Device>
</DeviceList>
启用设备分类器:
C9800#config t
C9800(config)#device classifier
现在,创建的配置文件将显示在此输出下:
C9800#show device classifier profile type custom
Valid Type Profile Name mCon ID
----------------------------------------------------------------------------
Valid Custom Test-3 1 0
之后,客户分类必须更改:
如果客户端已连接,请断开连接,然后重新连接客户端。
C9800#clear wireless client device cache
!--- To clear any classification cach
C9800#show wireless client mac-address 74da.38eb.c01f detail
Client MAC Address : 74da.38eb.c01f
Client MAC Type : Universally Administered Address
Client DUID: NA
Client IPv4 Address : 10.14.42.101
...
Device Classification Information:
Device Type : Test-3
Device Name : EDIMAX TECHNOLOGY CO. LTD.
Protocol Map : 0x000001 (OUI)
Day Zero Classification : EDIMAX TECHNOLOGY CO. LTD.
...
C9800#show device classifier mac-address 74da.38eb.c01f detail
Client Mac: 74da.38eb.c01f
Device Type: Sample_Profile_2
Confidence Level: 20
Device Name: DESKTOP-R2CH8G5
Device Vendor: MSFT 5.0
根据OUI对客户端进行分类(从17.18开始)
编辑.xml文件,在此示例中,应用以下规则:
<?xml version="1.0" encoding="UTF-8"?>
<DeviceList>
<CopyRight>版权所有(c)2021-2022 Cisco Systems, Inc.保留所有权利。</CopyRight>
<Version>4.3</Version>
<Device>
<DeviceType>Test-1</DeviceType>
<RuleName>Cisco-Rule</RuleName>
<RuleOperator>AND</RuleOperator>
<RuleCertaintyMetric>20</RuleCertaintyMetric>
<Check>
<Protocol>MAC</Protocol>
<TLV-Value-Type>正则表达式</TLV-Value-Type>
<TLV-Value>74da.38*</TLV-Value>
</Check>
</Device>
</DeviceList>
从17.18开始,您可以使用MAC地址的前缀进行分类。
此处的星号(*符号)表示本示例中以74da.38开头的所有MAC地址都将根据此规则进行分类。
另一个选项:完整的MAC地址可放在此处,这样便有机会单独对MAC地址进行分类。
将文件直接复制到bootflash。
从CLI:
copy {ftp: | tftp:} {flash:}
或者从GUI:
管理>管理>文件管理器
bootflash:
上传
之后,文件必须在WLC上可用:
C9800#more bootflash:dc_user_profiles.xml
<?xml version="1.0" encoding="UTF-8"?>
<DeviceList>
<CopyRight>Copyright (c) 2021-2022 by Cisco Systems, Inc. All rights reserved.</CopyRight>
<Version>4.3</Version>
<Device>
<DeviceType>Test-1</DeviceType>
<RuleName>Cisco-Rule</RuleName>
<RuleOperator>AND</RuleOperator>
<RuleCertaintyMetric>20</RuleCertaintyMetric>
<Check>
<Protocol>MAC</Protocol>
<TLV-Value-Type>Regex</TLV-Value-Type>
<TLV-Value>74da.38*</TLV-Value>
</Check>
</Device>
</DeviceList>
启用设备分类器:
C9800#config t
C9800(config)#device classifier
现在,创建的配置文件将显示在此输出下:
C9800#show device classifier profile type custom
Valid Type Profile Name mCon ID
----------------------------------------------------------------------------
Valid Custom Test-1 1 0
之后,客户分类必须更改:
如果客户端已连接,请断开连接,然后重新连接客户端。
C9800#clear wireless client device cache
!--- To clear any classification cache
C9800#show wireless client mac-address 74da.38eb.c01f detail
Client MAC Address : 74da.38eb.c01f
Client MAC Type : Universally Administered Address
Client DUID: NA
Client IPv4 Address : 10.14.42.101
...
Device Classification Information:
Device Type : Test-1
Device Name : EDIMAX TECHNOLOGY CO. LTD.
Protocol Map : 0x000001 (OUI)
Day Zero Classification : EDIMAX TECHNOLOGY CO. LTD.
...
C9800#show device classifier mac-address 74da.38eb.c01f detail
Client Mac: 74da.38eb.c01f
Device Type: Test-1
Confidence Level: 20
Day Zero Classification: EDIMAX TECHNOLOGY CO. LTD.
Device Name: EDIMAX TECHNOLOGY CO. LTD.
验证
从 CLI:
more bootflash:dc_user_profiles.xml
show device classifier profile type custom
show wireless client mac-address [mac] detail
show device classifier mac-address [mac] detail
从 GUI:
1.导航到监控>无线>客户端。
2. Device Type可视为列。
“监控”(Monitoring)页面下的设备类型
单击客户端,并且Client 360 View下也显示Device Type。
客户端360下的设备类型
故障排除
确保客户端正在发送您用于分类客户端的协议。
对于DHCP分类,客户端必须发送一个唯一的TLV,WLC可将其用作字符串来区分客户端类型。
在OUI分类方面,请记住MAC随机化。
在客户端启动第一个连接时收集其放射性跟踪。
https://www.cisco.com/c/en/us/support/docs/wireless/catalyst-9800-series-wireless-controllers/213949-wireless-debugging-and-log-collection-on.html#toc-hId-2010809796
为了进一步调查,可以收集以下跟踪:
request platform soft trace rotate all
delete /force bootflash:tracelogs/*
set platform software trace smd chassis active R0 dc-profile noise
set platform software trace smd chassis active R0 dc-sub noise
set platform software trace smd chassis active R0 dc-sm noise
set platform software trace smd chassis active R0 dc-mem noise
set platform software trace smd chassis active R0 dc noise
重现问题,然后使用以下命令收集输出:
show logging process smd internal start last 20 minutes to-file flash:cls_logging.log
注意:如果已在使用此功能,并且.xml自定义文件已存在于bootflash下,但您想要对其进行编辑,则无论何时编辑该文件,在配置文件未更新时,请应用以下步骤:
1)从闪存中删除现有的dc_user_profiles.xml
2)禁用设备分类器(无设备分类器)
3)再次启用设备分类器(设备分类器)
4)将新的dc_user_profiles.xml文件复制到闪存
参考
https://www.cisco.com/c/en/us/td/docs/wireless/controller/9800/17-18/config-guide/b_wl_17_18_cg/m_device_classifier_dynamic_xml_support.html