配置无线转有线场景MAC优先的Portal认证示例
组网需求
如图2-68,AC和AP是第三方的无线接入控制设备。手机用户关联Wi-Fi后进行Portal认证,认证成功后可以访问互联网。具体要求如下:
- 为方便用户使用,实现用户首次Portal认证成功后下线,在一定的时间内(如:60分钟)再次上线时,不需要输入帐号密码就能够重新接入网络,可以启用MAC优先的Portal认证。
- 由于AC和AP非华为设备,需在SwitchA配置MAC优先的Portal认证,无线侧报文通过AC发送到SwitchA,转换为有线场景,进行认证。由于RADIUS服务器上不会存储AP的信息,配置AP不需要认证。
配置注意事项
- 不建议使用该方案将认证点部署在交换机上,因为认证点设备无法感知终端的漫游和上下线,影响无线认证体验。建议将认证点部署AC上。
- 用户在不同VLAN间进行无线漫游时,需执行命令authentication mac-move enable使能MAC迁移功能,否则会导致用户掉线,需重新进行Portal认证。
RADIUS服务器上配置的RADIUS认证和计费密钥需与设备上配置的RADIUS服务器的共享密钥一致。
- Portal服务器上配置的Portal密钥、端口号需与设备上配置的共享密钥、设备侦听Portal协议报文的端口号一致。
- 设备默认出接口的IP地址作为向Portal服务器发送Portal报文时使用的源IP地址,该IP地址需与Portal服务器上配置的设备IP地址一致。用户可以通过命令source-interface或source-ip修改该IP地址。
- 举例中的RADIUS/Portal服务器以华为公司的Agile Controller-Campus为例,Agile Controller-Campus的支持版本为V100R003C60。
配置思路
- 在Switch上配置网络互连互通。
- 在SwitchA上配置AAA,为用户进行RADIUS认证、授权、计费,并对AP不认证。
- 在SwitchA上配置MAC优先的Portal认证,对用户进行接入认证。
- 配置AC上WLAN基本业务,用户采用open方式接入网络。
- 配置Agile Controller-Campus,实现对用户进行认证、授权、计费。
操作步骤
- 配置网络互连互通。
# 配置SwitchA连接SwitchB的接口GE0/0/1加入VLAN100和VLAN101。这里AC采用直接转发模式,如果AC采用隧道转发模式,该接口不需要加入VLAN101。
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 20 100 101 [SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] port link-type trunk [SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 101 [SwitchA-GigabitEthernet0/0/1] quit
# 配置SwitchA连接AC的接口GE0/0/2加入VLAN100和VLAN101。
[SwitchA] interface gigabitethernet 0/0/2 [SwitchA-GigabitEthernet0/0/2] port link-type trunk [SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 100 101 [SwitchA-GigabitEthernet0/0/2] quit
# 配置SwitchA连接服务器的接口GE0/0/3加入VLAN20。
[SwitchA] interface gigabitethernet 0/0/3 [SwitchA-GigabitEthernet0/0/3] port link-type trunk [SwitchA-GigabitEthernet0/0/3] port trunk allow-pass vlan 20 [SwitchA-GigabitEthernet0/0/3] quit
# 配置SwitchB的接口加入VLAN100和VLAN101。这里AC采用直接转发模式,如果AC采用隧道转发模式,该接口不需要加入VLAN101。
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] vlan batch 100 101 [SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] port link-type trunk [SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 101 [SwitchB-GigabitEthernet0/0/1] quit [SwitchB] interface gigabitethernet 0/0/2 [SwitchB-GigabitEthernet0/0/2] port link-type trunk [SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 100 101 [SwitchB-GigabitEthernet0/0/2] port trunk pvid vlan 100 [SwitchB-GigabitEthernet0/0/2] quit
# 配置SwitchA上VLANIF接口地址和到服务器的路由(假设下一跳10.4.1.2)。
[SwitchA] interface vlanif 20 [SwitchA-Vlanif20] ip address 10.4.1.1 24 [SwitchA-Vlanif20] quit [SwitchA] interface vlanif 101 [SwitchA-Vlanif101] ip address 10.3.1.2 24 [SwitchA-Vlanif101] quit [SwitchA] ip route-static 10.5.1.0 255.255.255.0 10.4.1.2
- 在SwitchA上配置AAA。
创建并配置RADIUS服务器模板、AAA认证方案以及认证域。
# 创建并配置RADIUS服务器模板“rd1”。[SwitchA] radius-server template rd1 [SwitchA-radius-rd1] radius-server authentication 10.5.1.3 1812 [SwitchA-radius-rd1] radius-server accounting 10.5.1.3 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”。[SwitchA-aaa] accounting-scheme acco1 [SwitchA-aaa-accounting-acco1] accounting-mode radius [SwitchA-aaa-accounting-acco1] accounting realtime 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
- 配置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 [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 force [SwitchA-access-author-ap_noauthen] quit [SwitchA] access-author policy ap_noauthen global
强制域、用户自带域和默认域在不同视图下的优先级从高到低依次是:认证模板下指定认证方式的强制域>认证模板下的强制域>基于用户上下文模板指定认证方式的强制域>基于用户上下文模板的强制域>用户自带认证域>认证模板下指定认证方式的默认域>认证模板下的默认域>基于用户上下文模板指定认证方式的默认域>基于用户上下文模板的默认域>全局默认域。
- 根据MAC前缀,指定AP认证域。
- 在SwitchA上配置MAC优先的Portal认证。# 将NAC配置模式切换成统一模式。
[SwitchA] authentication unified-mode
设备默认为统一模式。传统模式与统一模式相互切换后,设备会自动重启。
# 配置Portal服务器模板“abc”。[SwitchA] web-auth-server abc [SwitchA-web-auth-server-abc] server-ip 10.5.1.3 [SwitchA-web-auth-server-abc] port 50200 [SwitchA-web-auth-server-abc] url http://10.5.1.3:8445/portal [SwitchA-web-auth-server-abc] shared-key cipher Example@123 [SwitchA-web-auth-server-abc] quit
# 配置Portal接入模板“web1”。
[SwitchA] portal-access-profile name web1 [SwitchA-portal-acces-profile-web1] web-auth-server abc direct [SwitchA-portal-acces-profile-web1] quit
# 配置MAC接入模板。[SwitchA] mac-access-profile name m1 [SwitchA-mac-access-profile-m1] quit
# 在认证模板“p1”下绑定MAC接入模板和Portal接入模板。[SwitchA] authentication-profile name p1 [SwitchA-authen-profile-p1] mac-access-profile m1 [SwitchA-authen-profile-p1] portal-access-profile web1 [SwitchA-authen-profile-p1] access-domain isp [SwitchA-authen-profile-p1] quit
# 在接口下绑定认证模板。[SwitchA] interface gigabitethernet 0/0/1 [SwitchA-GigabitEthernet0/0/1] authentication-profile p1 [SwitchA-GigabitEthernet0/0/1] quit
- 配置AC。
- 配置AC接口IP地址和到RADIUS服务器的路由。
- 配置AC作为DHCP服务器,为STA和AP分配IP地址。
- 配置无线业务,用户使用open方式接入网络。
- 配置Agile Controller-Campus。
- 登录Agile Controller-Campus。
- 选择“资源 > 用户管理”,点击 按钮,创建普通账号。
- 选择“资源 > 设备 > 设备管理”,单击 ,设置SwitchA的参数,包括SwitchA的IP地址、RADIUS认证和计费相关参数。
- 选择“系统 > 终端参数配置 > 全局参数”,在MAC优先的Portal认证页签下,启用MAC优先的Portal认证,设置并配置MAC地址有效时间为60分钟。
- 验证配置结果
- 无线用户启动终端后,关联信号正常,MAC认证失败后用户在重定向出的页面中输入用户名密码进行Portal认证。认证成功后,可以访问Internet。
- 在SwitchA上执行命令display access-user ip-address查看终端用户信息。