华为采用机器翻译与人工审校相结合的方式将此文档翻译成不同语言,希望能帮助您更容易理解此文档的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 华为对于翻译的准确性不承担任何责任,并建议您参考英文文档(已提供链接)。
配置通过802.1X+MAC认证控制企业用户访问网络示例(AP不认证)
配置通过802.1X+MAC认证控制企业用户访问网络示例(AP不认证)
组网需求
企业中有线用户通过交换机接入,无线用户通过交换机下接的AP接入,用户需要经过认证才能访问网络,由于认证服务器上不会存储AP的信息,配置AP不需要认证。
图2-74 组网图![]()
操作步骤
- 汇聚交换机侧配置。
- 创建并配置RADIUS服务器模板、AAA认证方案以及认证域。
# 创建并配置RADIUS服务器模板“rd1”。
[SwitchA] radius-server template rd1
[SwitchA-radius-rd1] radius-server authentication 192.168.100.100 1812
[SwitchA-radius-rd1] radius-server accounting 192.168.100.100 1813
[SwitchA-radius-rd1] radius-server shared-key cipher Example@2014
[SwitchA-radius-rd1] quit
# 创建AAA认证方案“abc”并配置认证方式为RADIUS。
[SwitchA] aaa
[SwitchA-aaa] authentication-scheme abc
[SwitchA-aaa-authen-abc] authentication-mode radius
[SwitchA-aaa-authen-abc] quit
# 配置计费方案“acco1”。为了方便RADIUS服务器维护帐号的状态信息,例如上下线信息,强制帐号下线,计费模式必须配置为radius。
[SwitchA-aaa] accounting-scheme acco1
[SwitchA-aaa-accounting-acco1] accounting-mode radius
[SwitchA-aaa-accounting-acco1] accounting realtime 15 //配置实时计费周期为15分钟
[SwitchA-aaa-accounting-acco1] quit
# 创建认证域“isp”,并在其上绑定AAA认证方案“abc”、计费方案acco1与RADIUS服务器模板“rd1”。
[SwitchA-aaa] domain isp
[SwitchA-aaa-domain-isp] authentication-scheme abc
[SwitchA-aaa-domain-isp] accounting-scheme acco1
[SwitchA-aaa-domain-isp] radius-server rd1
[SwitchA-aaa-domain-isp] quit
[SwitchA-aaa] quit
# 配置全局默认域为“isp”。用户进行接入认证时,以格式“user@isp”输入用户名即可在isp域下进行aaa认证。如果用户名中不携带域名或携带的域名不存在,用户将会在默认域中进行认证。
[SwitchA] domain isp
- 配置AP不认证。
# 创建AAA认证方案“noauthen”并配置认证方式为none。
[SwitchA] aaa
[SwitchA-aaa] authentication-scheme noauthen
[SwitchA-aaa-authen-noauthen] authentication-mode none
[SwitchA-aaa-authen-noauthen] quit
# 创建AP的认证域。
[SwitchA-aaa] domain ap_noauthen
[SwitchA-aaa-domain-ap_noauthen] authentication-scheme noauthen
[SwitchA-aaa-domain-ap_noauthen] quit
[SwitchA-aaa] quit
# 配置AP不认证方式有2种,用户可以选择配置。推荐使用方式一。
- 方式一:根据MAC前缀,指定AP认证域。
[SwitchA] domain ap_noauthen mac-authen force mac-address 00e0-fc74-9640 mask ffff-ffff-ff00
- 方式二:配置用户上下文识别功能。
[SwitchA] access-context profile enable //开启用户上下文识别功能
[SwitchA] access-context profile name ap_access //创建用户上下文模板
[SwitchA-access-context-ap_access] if-match vlan-id 100 //配置基于VLAN的识别策略,其中VLAN为AP的管理VLAN
[SwitchA-access-context-ap_access] quit
[SwitchA] access-author policy name ap_noauthen //创建用户认证事件授权策略
[SwitchA-access-author-ap_noauthen] match access-context-profile ap_access action access-domain ap_noauthen //配置匹配用户上下文模板的接入用户的认证域
[SwitchA-access-author-ap_noauthen] quit
[SwitchA] access-author policy ap_noauthen global //应用用户认证事件授权策略
- 使能802.1X认证和MAC认证。
# 将NAC配置模式切换成统一模式。
[SwitchA] authentication unified-mode
设备默认为统一模式。传统模式与统一模式相互切换后,设备会自动重启。
# 配置MAC接入模板。
[SwitchA] mac-access-profile name m1
[SwitchA-mac-access-profile-m1] quit
# 配置802.1X接入模板。
802.1X接入模板默认采用EAP认证方式。请确保RADIUS服务器支持EAP协议,否则无法处理802.1X认证请求。
[SwitchA] dot1x-access-profile name d1
[SwitchA-dot1x-access-profile-d1] quit
# 配置认证模板。
[SwitchA] authentication-profile name p1
[SwitchA-authen-profile-p1] mac-access-profile m1 //绑定MAC接入模板
[SwitchA-authen-profile-p1] dot1x-access-profile d1 //绑定802.1X接入模板
[SwitchA-authen-profile-p1] quit
# 在接口GE
0/0/1绑定认证模板。
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-Gigabitethernet0/0/1] authentication-profile p1 //绑定认证模板,使能802.1X和MAC的混合认证
[SwitchA-Gigabitethernet0/0/1] quit