无线打印机装不了认证客户端怎么管准入?华为WAC配MAC认证哑终端免输密码上网

公司WiFi要收紧准入,最顺手的思路是上802.1X:一人一个账号,输对密码才能进内网。但真到现场就会发现一批"特殊员工"——无线打印机、无线IP电话、车间里的手持扫码枪,这些哑终端既装不了认证客户端,也没人替它们输密码,卡在准入这一关外面。最后往往被迫给它们单独开一个不设防的SSID,等于前面管了个寂寞。华为官方文档给了另一条路:MAC认证。终端的MAC地址直接作为用户名和密码送到RADIUS服务器认证,设备联网全程零输入;人用的电脑照常走自己的认证,哑终端静默上线,同一张无线网两种准入并存。本篇按官方示例原样走一遍,命令照抄就能落。

组网需求(官方原文转述)

DeviceA作为WAC直连AP,通过WLAN部署,提供名为 wlan-net 的无线网络方便员工接入;WAC同时作为DHCP服务器,为无线用户提供10.23.101.0/24网段的IP地址。由于无线网络开放性的特点,如果不采取适当的接入控制,企业信息就存在安全风险;对于无线网络打印机、无线网络电话等无法安装认证客户端的哑终端,使用MAC认证——终端设备的MAC地址将作为用户信息到RADIUS服务器进行认证,同时用户接入WLAN时,也不需要进行认证操作。本例中Interface1、Interface2分别代表10GE0/0/1、10GE0/0/2。

官方配置思路五步:配置WLAN基本业务,实现WAC与上下游网络互通和AP上线 → 配置RADIUS认证参数 → 配置MAC接入模板,管理MAC接入控制参数 → 配置认证模板,管理NAC认证的相关配置 → 配置WLAN业务参数,在VAP模板下绑定安全模板和认证模板,对访问WLAN网络的STA进行接入控制。

数据规划(官方原表转述)

配置项 数据
RADIUS认证参数 认证方案 scheme1;计费方案 scheme2;服务器模板 radius_huawei(IP 10.23.200.1,认证端口 1812,计费端口 1813,共享密钥 YsHsjx_202206mc@1)
MAC接入模板 名称 m1;MAC认证用户的用户名和密码格式:不带分隔符"-“的MAC地址
认证域 example.com,绑定RADIUS服务器模板 radius_huawei、认证方案 scheme1、计费方案 scheme2
认证模板 名称 p1,绑定MAC接入模板 m1、认证域 example.com
DHCP服务器 WAC作为DHCP服务器为STA和AP分配IP地址
AP的IP地址池 10.23.100.2~10.23.100.254/24
STA的IP地址池 10.23.101.2~10.23.101.254/24
AC的源接口IP地址 VLANIF100:10.23.100.1/24
AP组 ap-group1,绑定VAP模板 wlan-vap、域管理模板 domain1
域管理模板 domain1,国家码 CN
SSID模板 wlan-ssid,SSID名称 wlan-net
安全模板 wlan-security,安全策略:开放认证
VAP模板 wlan-vap,业务VLAN 101,绑定SSID模板 wlan-ssid、安全模板 wlan-security、认证模板 p1

第一步:打通WAC与上下游,配好DHCP(官方命令照抄)

连接AP的10GE0/0/1加入管理VLAN100,上行口10GE0/0/2加入业务VLAN101。官方提醒:业务数据转发方式采用直接转发时,建议在WAC连接AP的接口10GE0/0/1上配置端口隔离,如果不配置,可能会在VLAN内产生不必要的广播报文,或者导致不同AP间的WLAN用户二层互通的问题。

<HUAWEI> system-view
[HUAWEI] sysname DeviceA
[DeviceA] vlan batch 100 101
[DeviceA] interface 10ge 0/0/1
[DeviceA-10GE0/0/1] portswitch
[DeviceA-10GE0/0/1] port link-type trunk
[DeviceA-10GE0/0/1] port trunk pvid vlan 100
[DeviceA-10GE0/0/1] port trunk allow-pass vlan 100
[DeviceA-10GE0/0/1] quit
[DeviceA] interface 10ge 0/0/2
[DeviceA-10GE0/0/2] portswitch
[DeviceA-10GE0/0/2] port link-type trunk
[DeviceA-10GE0/0/2] port trunk allow-pass vlan 101
[DeviceA-10GE0/0/2] quit

WAC作DHCP服务器,VLANIF100给AP分地址、VLANIF101给无线终端分地址(DNS按实际需要配,接口地址池场景在VLANIF接口视图下配 dhcp server dns-list):

[DeviceA] dhcp enable
[DeviceA] interface vlanif 100
[DeviceA-Vlanif100] ip address 10.23.100.1 24
[DeviceA-Vlanif100] dhcp select interface
[DeviceA-Vlanif100] quit
[DeviceA] interface vlanif 101
[DeviceA-Vlanif101] ip address 10.23.101.1 24
[DeviceA-Vlanif101] dhcp select interface
[DeviceA-Vlanif101] quit

去RADIUS服务器网段配一条静态路由(官方示例假设与WAC相连的上游设备IP为10.23.101.2):

[DeviceA] ip route-static 10.23.200.0 255.255.255.0 10.23.101.2

第二步:让AP上线(官方命令照抄)

创建AP组、域管理模板(国家码CN)并在AP组引用:

[DeviceA] wlan
[DeviceA-wlan] ap-group name ap-group1
[DeviceA-wlan-ap-group-ap-group1] quit
[DeviceA-wlan] regulatory-domain-profile name domain1
[DeviceA-wlan-regulate-domain-domain1] country-code cn
[DeviceA-wlan-regulate-domain-domain1] quit
[DeviceA-wlan] ap-group name ap-group1
[DeviceA-wlan-ap-group-ap-group1] regulatory-domain-profile domain1
[DeviceA-wlan-ap-group-ap-group1] quit
[DeviceA-wlan] quit

配置WAC源接口。官方在示例里先执行了 capwap dtls no-auth enable(命令执行后设备会交互式要求设置DTLS PSK、FIT AP的用户名密码等,按提示输入即可),再指定源接口:

[DeviceA] capwap dtls no-auth enable
[DeviceA] capwap source interface vlanif 100

离线导入AP:按MAC认证接入并加入ap-group1,按部署位置命名(示例AP MAC为00e0-fc12-3456,部署在1号区域,命名area_1)。ap auth-mode命令缺省即MAC认证,未改过缺省配置可以不敲这条:

[DeviceA] wlan
[DeviceA-wlan] ap auth-mode mac-auth
[DeviceA-wlan] ap-id 0 ap-mac 00e0-fc12-3456
[DeviceA-wlan-ap-0] ap-name area_1
[DeviceA-wlan-ap-0] ap-group ap-group1
[DeviceA-wlan-ap-0] quit
[DeviceA-wlan] quit

AP正常上线后,及时关闭CAPWAP的DTLS不认证方式,避免未授权设备接入网络:

[DeviceA] undo capwap dtls no-auth enable

第三步:RADIUS认证参数与认证域(官方命令照抄)

这是MAC认证的"后端”。请确保RADIUS服务器地址、端口号、共享密钥配置正确,并且和RADIUS服务器保持一致。

[DeviceA] radius-server template radius_huawei
[DeviceA-radius-radius_huawei] radius-server authentication 10.23.200.1 1812
[DeviceA-radius-radius_huawei] radius-server accounting 10.23.200.1 1813
[DeviceA-radius-radius_huawei] radius-server shared-key cipher YsHsjx_202206mc@1
[DeviceA-radius-radius_huawei] quit
[DeviceA] aaa
[DeviceA-aaa] authentication-scheme scheme1
[DeviceA-aaa-authen-scheme1] authentication-mode radius
[DeviceA-aaa-authen-scheme1] quit
[DeviceA-aaa] accounting-scheme scheme2
[DeviceA-aaa-accounting-scheme2] accounting-mode radius
[DeviceA-aaa-accounting-scheme2] accounting realtime 15
[DeviceA-aaa-accounting-scheme2] quit

创建认证域并绑定三件套:

[DeviceA-aaa] domain example.com
[DeviceA-aaa-domain-example.com] authentication-scheme scheme1
[DeviceA-aaa-domain-example.com] accounting-scheme scheme2
[DeviceA-aaa-domain-example.com] radius-server radius_huawei
[DeviceA-aaa-domain-example.com] quit
[DeviceA-aaa] quit

第四步:MAC接入模板与认证模板(官方命令照抄)

MAC接入模板里,MAC认证用户的用户名和密码默认均为不带分隔符"-“的MAC地址,本例直接用缺省,创建即可:

[DeviceA] mac-access-profile name m1
[DeviceA-mac-access-profile-m1] quit

认证模板把MAC接入模板和认证域串起来,force表示强制使用该域:

[DeviceA] authentication-profile name p1
[DeviceA-authentication-profile-p1] mac-access-profile m1
[DeviceA-authentication-profile-p1] access-domain example.com force
[DeviceA-authentication-profile-p1] quit

第五步:WLAN业务参数(官方命令照抄)

安全模板(本例安全策略为开放认证,准入控制交给MAC认证层)、SSID模板、VAP模板依次建好,VAP里绑定认证模板p1:

[DeviceA] wlan
[DeviceA-wlan] security-profile name wlan-security
[DeviceA-wlan-sec-prof-wlan-security] security open
[DeviceA-wlan-sec-prof-wlan-security] quit
[DeviceA-wlan] ssid-profile name wlan-ssid
[DeviceA-wlan-ssid-prof-wlan-ssid] ssid wlan-net
[DeviceA-wlan-ssid-prof-wlan-ssid] quit
[DeviceA-wlan] vap-profile name wlan-vap
[DeviceA-wlan-vap-prof-wlan-vap] service-vlan vlan-id 101
[DeviceA-wlan-vap-prof-wlan-vap] security-profile wlan-security
[DeviceA-wlan-vap-prof-wlan-vap] ssid-profile wlan-ssid
[DeviceA-wlan-vap-prof-wlan-vap] authentication-profile p1
[DeviceA-wlan-vap-prof-wlan-vap] quit

AP组引用VAP模板,射频0和射频1都用这套配置:

[DeviceA-wlan] ap-group name ap-group1
[DeviceA-wlan-ap-group-ap-group1] vap-profile wlan-vap wlan 1 radio 0
[DeviceA-wlan-ap-group-ap-group1] vap-profile wlan-vap wlan 1 radio 1
[DeviceA-wlan-ap-group-ap-group1] quit

射频的信道和功率自动调优功能默认开启,不关闭会导致手动配置不生效;示例中信道功率仅为示例,实际请根据AP的国家码和网规结果配置:

[DeviceA-wlan] ap-id 0
[DeviceA-wlan-ap-0] radio 0
[DeviceA-wlan-ap-0-radio-0] calibrate auto-channel-select disable
[DeviceA-wlan-ap-0-radio-0] calibrate auto-txpower-select disable
[DeviceA-wlan-ap-0-radio-0] channel 20mhz 6
[DeviceA-wlan-ap-0-radio-0] eirp 127
[DeviceA-wlan-ap-0-radio-0] quit
[DeviceA-wlan-ap-0] radio 1
[DeviceA-wlan-ap-0-radio-1] calibrate auto-channel-select disable
[DeviceA-wlan-ap-0-radio-1] calibrate auto-txpower-select disable
[DeviceA-wlan-ap-0-radio-1] channel 80mhz 149
[DeviceA-wlan-ap-0-radio-1] eirp 127
[DeviceA-wlan-ap-0-radio-1] quit
[DeviceA-wlan-ap-0] quit
[DeviceA-wlan] quit

验证:哑终端零操作上线(官方检查结果原文)

  • 用户启动终端后,设备会自动获取用户终端的MAC地址作为用户名和密码进行认证。
  • 用户认证成功后即可访问网络。
  • 用户上线后,管理员可在设备上执行命令 display access-user access-type mac-authen 查看在线MAC认证用户信息。

判读要点:打印机、IP电话开机联网后不需要任何人操作,在 display access-user access-type mac-authen 的输出里能看到对应MAC的在线表项,就是认证通过的证据;终端反复上下线而表项稳定,说明RADIUS侧账号与格式对得上。

配完后设备上的配置文件(官方原文,供逐行核对)

#
sysname DeviceA
#
vlan batch 100 to 101
#
authentication-profile name p1
 mac-access-profile m1
 access-domain example.com force
#
mac-access-profile name m1
#
dhcp enable
#
radius-server template radius_huawei
 radius-server shared-key cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!Cd/`W03KjAwAqn64E<\TxGC_SOri<2BP\A+!!!!!2jp5!!!!!!B!!!!Oe2HMc->XMa#TLDZUaJBFJtm#XVj*E:S*|(N7`J1B:3QY!!!!!!!!!!!!!!!%+%#
 radius-server authentication 10.23.200.1 1812 weight 80
 radius-server accounting 10.23.200.1 1813 weight 80
#
aaa
 authentication-scheme scheme1
  authentication-mode radius
 accounting-scheme scheme2
  accounting-mode radius
  accounting realtime 15
 domain example.com
  authentication-scheme scheme1
  accounting-scheme scheme2
  radius-server radius_huawei
#
interface Vlanif100
 ip address 10.23.100.1 255.255.255.0
 dhcp select interface
#
interface Vlanif101
 ip address 10.23.101.1 255.255.255.0
 dhcp select interface
#
interface 10GE0/0/1
 portswitch
 port link-type trunk
 port trunk pvid vlan 100
 port trunk allow-pass vlan 100
#
interface 10GE0/0/2
 portswitch
 port link-type trunk
 port trunk allow-pass vlan 101
#
ip route-static 10.23.200.0 255.255.255.0 10.23.101.2
#  
capwap source interface vlanif 100
#
wlan
 security-profile name wlan-security
  security open
 ssid-profile name wlan-ssid
  ssid wlan-net
 vap-profile name wlan-vap
  service-vlan vlan-id 101
  ssid-profile wlan-ssid
  security-profile wlan-security
  authentication-profile p1
 regulatory-domain-profile name domain1
 ap-group name ap-group1
  regulatory-domain-profile domain1
  radio 0
   vap-profile wlan-vap wlan 1
  radio 1
   vap-profile wlan-vap wlan 1
 ap-id 0 type-id 1 ap-mac 00e0-fc12-3456 ap-sn 210235554710CB000042
  ap-name area_1
  ap-group ap-group1
  radio 0
   channel 20mhz 6
   eirp 127
   calibrate auto-channel-select disable
   calibrate auto-txpower-select disable
  radio 1
   channel 80mhz 149
   eirp 127
   calibrate auto-channel-select disable
   calibrate auto-txpower-select disable
#
return

注意配置文件里共享密钥显示为一串密文(%!%#…%+%#),这是 cipher 加密的正常呈现,核对时别拿明文去对。

注意事项(官方口径整理)

  • RADIUS服务器地址、端口号、共享密钥必须配置正确,并且和RADIUS服务器保持一致——密钥对不上,认证必然失败。
  • MAC接入模板里用户名和密码默认均为不带分隔符”-“的MAC地址,RADIUS服务器上登记哑终端账号时要用同一格式,多一个”-“都对不上。
  • 直接转发模式下,官方建议在WAC连接AP的接口上配置端口隔离,避免VLAN内多余广播和不同AP间用户二层互通。
  • capwap dtls no-auth enable 只为AP首次上线取安全凭证,AP正常上线后应及时 undo 关闭,避免未授权设备接入网络。
  • 射频信道功率自动调优默认开启,手动指定前必须先关,否则配置不生效。

哑终端台账怎么盘、账号在RADIUS上怎么批量建,这些前置工作比敲命令更容易翻车,拿不准的可以让诚鑫致达科技先到现场看看无线环境再定方案。各厂商设备的命令与默认参数存在差异,本文步骤与命令均出自华为官方文档,操作前请核对你的设备型号与软件版本。

源:华为官方文档 AR路由器5700-6700-8000/dc_cfg_nac_0068p_ar.md《举例:配置无线MAC认证(AAA采用RADIUS方式)》