
Portal认证(Web认证) 是一种常见的无线用户身份验证方式。用户在接入无线网络后,必须访问门户网站并完成认证,认证成功后方可访问网络资源。
本案例采用 AC + AP 二层组网,通过 RADIUS 验证用户身份,并使用 AC 作为 DHCP 服务器分配地址。
图 1:无线 Portal 认证(二层组网)

模式 | 报文路径说明 |
|---|---|
隧道转发 | AP → CAPWAP → AC → 上层网络 |
直接转发 | AP → 上层网络(不经过 AC) |
配置项 | 数据/说明 |
|---|---|
DHCP服务器 | AC 作为 DHCP,为 STA 和 AP 分配 IP |
AP IP 池 | 10.23.1.2 - 10.23.1.254/24 |
STA IP 池 | 10.23.2.2 - 10.23.2.254/24 |
AC 源接口 IP | VLANIF100:10.23.1.1/24 |
RADIUS服务器 | IP:10.23.2.30,端口:1812,共享密钥: |
AAA域 | huawei.com |
Portal服务器 | IP:10.23.2.30,端口:50200,密钥: |
免认证资源 | DNS:10.23.3.1 |
SSID | wlan-net,开放认证 |
业务VLAN | VLAN101,隧道转发 |
# SwitchA - 接口加入管理 VLAN
[SwitchA] vlan batch 100
[SwitchA] int g0/0/1
port link-type trunk
port trunk pvid vlan 100
port trunk allow-pass vlan 100
undo port trunk allow-pass vlan 1
stp edged-port enable
port-isolate enable
quit
[SwitchA] int g0/0/2
port link-type trunk
port trunk allow-pass vlan 100
undo port trunk allow-pass vlan 1
quit
# AC - 配置 VLAN
[AC] vlan batch 100 101
[AC] int g1/0/1
port link-type trunk
port trunk allow-pass vlan 100
undo port trunk allow-pass vlan 1
quit
# 上行接口 - 透传业务 VLAN
[AC] int g1/0/2
port link-type trunk
port trunk allow-pass vlan 101
undo port trunk allow-pass vlan 1
quit[AC] dhcp enable
[AC] int vlanif 100
ip address 10.23.1.1 24
dhcp select interface
quit
[AC] int vlanif 101
ip address 10.23.2.1 24
dhcp select interface
quit[AC] wlan
ap-group name ap-group1
quit
regulatory-domain-profile name domain1
country-code cn
quit
ap-group name ap-group1
regulatory-domain-profile domain1
quit
capwap source interface vlanif 100
# 导入 AP
[AC] wlan
ap auth-mode mac-auth
ap-id 0 ap-mac 00e0-fc12-e360
ap-name area_1
ap-group ap-group1
quit
# 查看 AP 状态
[AC] display ap all[AC] radius-server template rd1
radius-server authentication 10.23.2.30 1812
radius-server shared-key cipher YsHsjx_202206
quit
[AC] aaa
authentication-scheme abc
authentication-mode radius
quit
domain huawei.com
authentication-scheme abc
radius-server rd1
quit
# 测试认证
[AC] test-aaa test YsHsjx_202206 radius-template rd1# Portal服务器
[AC] web-auth-server abc
server-ip 10.23.2.30
port 50200
url http://10.23.2.30:8080/webagent
shared-key cipher YsHsjx_202206
quit
# Portal接入模板
[AC] portal-access-profile name web1
web-auth-server abc direct
quit
# 免认证规则
[AC] free-rule-template name default_free_rule
free-rule 1 destination ip 10.23.3.1 mask 32
quit
# 认证模板
[AC] authentication-profile name p1
portal-access-profile web1
free-rule-template default_free_rule
access-domain huawei.com force
authentication mode multi-authen max-user 100
quit# SSID模板
[AC] wlan
ssid-profile name wlan-ssid
ssid wlan-net
quit
# 安全模板(开放认证)
security-profile name wlan-security
security-policy open
quit
# VAP模板
vap-profile name wlan-vap
forward-mode tunnel
service-vlan vlan-id 101
ssid-profile wlan-ssid
security-profile wlan-security
authentication-profile p1
quit
# 绑定到AP组
ap-group name ap-group1
vap-profile wlan-vap wlan 1 radio 0
vap-profile wlan-vap wlan 1 radio 1
quitdisplay ap all 状态为 nor✅ RADIUS超时优化:提高认证效率
✅ VLAN隔离:避免广播风暴与跨AP互通
✅ 免认证资源:确保 DNS 可访问,否则无法解析 Portal
✅ 多用户单独认证模式:提升安全性
✅ 模板化配置:Portal、VAP、SSID、安全策略分离管理
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。