苹果依靠 CNA(Captive Network Assistant) 主动访问 http://captive.apple.com 探测外网,AC 必须放行该探测报文、模拟苹果服务器返回Success、开启 iOS 专属弹窗优化;安卓弹窗逻辑宽松,因此安卓正常、苹果不行。
WX3540H 为 V7 版本 AC,下面整套可直接粘贴部署。
一、核心必配命令(Portal Web 视图内,你的 portal web-server 名称自行替换)
h3c
system-view
# 进入你的portal服务(举例名称portal-server,改成你实际的名字)
portal web-server portal-server
# 开启iOS captive弹窗优化(接入WiFi自动弹出认证页,切桌面不会断WiFi)
captive-bypass ios optimize enable
# 强制捕获苹果探测地址,触发弹窗
if-match original-url http://captive.apple.com/hotspot-detect.html redirect-url http://captive.apple.com/hotspot-detect.html
if-match original-url http://www.apple.com/library/test/success.html redirect-url http://www.apple.com/library/test/success.html
# 优化重定向方式,DNS重定向对iOS兼容性更强(推荐替换默认url重定向)
redirect dns
quit
二、放行免认证规则(认证前放行苹果探测、DNS,必不可少)
h3c
# 放行DNS 53端口,iOS必须解析域名才能发起探测
portal free-rule 1 destination ip any udp 53
portal free-rule 2 destination ip any tcp 53
# 放行苹果探测地址、iOS推送端口
portal free-rule 3 destination ip 17.0.0.0 8 udp 5223
portal free-rule 4 destination host captive.apple.com
portal free-rule 5 destination host www.apple.com
三、安全智能重定向优化(识别苹果 UA 强制跳转 Portal)
h3c
portal safe-redirect enable
portal safe-redirect method get post
# 匹配苹果、微信、浏览器UA,全部触发认证跳转
portal safe-redirect user-agent iPhone
portal safe-redirect user-agent iPad
portal safe-redirect user-agent CaptiveNetworkSupport
portal safe-redirect user-agent MicroMessenger
portal safe-redirect user-agent Mozilla
portal safe-redirect user-agent WeChat
四、配套无线 & DHCP 优化(极易忽略的关键点)
SSID 禁用 WPA3,只用 WPA2-PSK
iOS 新版系统 WPA3 模式容易阻断 CNA 探测,导致不弹窗:
h3c
wlan service-template 无线模板名
encryption method wpa2
security-ie wpa2
DHCP 下发正确 DNS(必须分配公网 DNS:223.5.5.5 / 114.114.114.114)
苹果拿不到 DNS 无法解析captive.apple.com,永远不会弹窗。
h3c
dhcp server ip-pool wifi-pool
dns-list 223.5.5.5 114.114.114.114
关闭 IPv6(临时根治 iOS 优先 IPv6 探测失败问题)
内网无 IPv6 业务时直接关闭 VLANIF、VLAN 接口 IPv6:
h3c
interface Vlan-interface XX
undo ipv6 enable
五、可选进阶优化(解决 iOS15 + 开启「iCloud 专用中继」不弹窗)
苹果开启 iCloud 私有中继后 DNS 被加密,AC 无法劫持探测报文,解决方案二选一:
告知用户连接 WiFi 时关闭「iCloud 私有中继 / 专用代理」;
AC 上开启自适应探测:
h3c
portal captive-adaptive enable
六、排查验证步骤
配置完成后保存 save force,重新连接苹果 WiFi;
苹果手机抓包,查看是否产生访问 captive.apple.com 的 HTTP 报文;
若依旧不弹窗:
Portal 页面不要使用纯 HTTPS(iOS 拦截未授信证书的 HTTPS 重定向),优先 HTTP 认证页;
给 Portal 域名部署正规 CA 证书,彻底解决证书拦截问题;
苹果设置→无线局域网→忽略此网络,重新接入测试。
七、完整最简版本(直接复制替换即可)
h3c
system-view
portal free-rule 1 destination ip any udp 53
portal free-rule 2 destination ip any tcp 53
portal free-rule 3 destination ip 17.0.0.0 8 udp 5223
portal web-server portal-server
captive-bypass ios optimize enable
redirect dns
if-match original-url http://captive.apple.com/hotspot-detect.html redirect-url http://captive.apple.com/hotspot-detect.html
safe-redirect enable
safe-redirect method get post
safe-redirect user-agent iPhone
safe-redirect user-agent CaptiveNetworkSupport
quit
save force
补充说明
captive-bypass ios optimize enable 是核心命令:既自动弹窗,又避免用户切桌面 WiFi 断开;
不要全局配置 captive-bypass enable,全局开启反而会禁止自动弹窗;
绝大多数苹果不弹窗场景,做完上面 4 组配置即可 100% 恢复自动弹出认证页面。
暂无评论
暂无评论
针对苹果手机在 Portal 认证时不主动弹出认证界面的问题,可以在 AC 上尝试以下优化配置。
在系统视图下,进入 Portal Web 服务器视图,执行:
在系统视图下执行:
苹果终端连接 Wi-Fi 后,会向 captive.apple.com 等苹果服务器发送探测报文来判断网络连通性。如果终端无法获取 DNS 或无法解析这些域名,将直接影响弹窗。
部分网络需要将苹果的探测域名加入免认证名单,否则探测报文被拦截,系统会认为网络不通,从而不弹窗。
可将以下域名加入 Portal 免认证规则或 DNS 白名单:
captive.apple.com
www.apple.com
***.***
www.airport.us
***.***
***.***
www.thinkdifferent.us
苹果手机的弹窗机制由 iOS 系统自身控制,设备侧无法强制。可以向用户提供以下建议:
正确操作弹窗:首次连接弹出“是否使用互联网连接”时,选择 “使用” 以触发 Portal 页面。若误点“取消”,可手动打开浏览器访问任意 HTTP 网址触发重定向。
手动触发:始终无法弹窗时,可在 Safari 中输入 http://captive.apple.com 手动触发。
如果上述优化无效,可进一步排查:
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论