· 用户主机与接入设备Device直接相连,采用直接方式的Portal认证。用户通过手工配置或DHCP获取的一个公网IP地址进行认证,在通过Portal认证前,只能访问Portal Web服务器;在通过Portal认证后,可以使用此IP地址访问非受限的互联网资源。
· Device同时承担Portal Web服务器和Portal认证服务器的职责。
· 采用RADIUS服务器作为认证/计费服务器。
· 配置本地Portal Web服务使用HTTP协议,且HTTP服务侦听的TCP端口号为2331。
图1-25 使用本地Portal Web服务的直接Portal认证配置组网图
按照自定义认证页面文件编辑规范,完成认证页面的编辑。并上传到设备存储介质的根目录下。
(1) 配置RADIUS服务器,保证用户的认证/计费功能正常运行,具体配置步骤略。
(2) 配置接口IP地址。
# 根据组网图中规划的信息,配置各接口的IP地址,具体配置步骤如下。
<Device> system-view
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] ip address 192.168.0.100 255.255.255.0
[Device-GigabitEthernet1/0/1] quit
[Device-GigabitEthernet1/0/2] quit
请参考以上步骤配置其他接口的IP地址,具体配置步骤略。
(3) 配置接口加入安全域。
# 请根据组网图中规划的信息,将接口加入对应的安全域,具体配置步骤如下。
[Device] security-zone name dmz
[Device-security-zone-DMZ] import interface gigabitethernet 1/0/1
[Device-security-zone-DMZ] quit
[Device] security-zone name trust
[Device-security-zone-Trust] import interface gigabitethernet 1/0/2
[Device-security-zone-Trust] quit
(4) 配置安全策略
a. 配置安全策略放行DMZ与Local安全域之间的流量,用于设备Device与RADIUS服务器之间的报文交互。
# 配置名称为portallocalout的安全策规则,使Device可以向RADIUS服务器发送报文,具体配置步骤如下。
[Device-security-policy-ip] rule name portallocalout
[Device-security-policy-ip-2-portallocalout] source-zone local
[Device-security-policy-ip-2-portallocalout] destination-zone dmz
[Device-security-policy-ip-2-portallocalout] destination-ip-host 192.168.0.112
[Device-security-policy-ip-2-portallocalout] action pass
[Device-security-policy-ip-2-portallocalout] quit
# 配置名称为portallocalin1的安全策略规则,使Device可以接收和处理来自RADIUS服务器的报文,具体配置步骤如下。
[Device-security-policy-ip] rule name portallocalin1
[Device-security-policy-ip-3-portallocalin1] source-zone dmz
[Device-security-policy-ip-3-portallocalin1] destination-zone local
[Device-security-policy-ip-3-portallocalin1] source-ip-host 192.168.0.112
[Device-security-policy-ip-3-portallocalin1] action pass
[Device-security-policy-ip-3-portallocalin1] quit
b. 配置安全策略放行Trust与Local安全域之间的流量。
# 配置名称为portallocalin2的安全策规则,使用户Host可以向设备本地的Portal服务器发送报文,具体配置步骤如下。
[Device-security-policy-ip] rule name portallocalin2
[Device-security-policy-ip-4-portallocalin2] source-zone trust
[Device-security-policy-ip-4-portallocalin2] source-ip-host 2.2.2.2
[Device-security-policy-ip-4-portallocalin2] destination-zone local
[Device-security-policy-ip-4-portallocalin2] action pass
[Device-security-policy-ip-4-portallocalin2] quit
[Device-security-policy-ip] quit
(5) 配置RADIUS方案
# 建名称为rs1的RADIUS方案,配置发送给RADIUS服务器的用户名不携带ISP域名,开启RADIUS session control功能。
[Device] radius scheme rs1
[Device-radius-rs1] primary authentication 192.168.0.112
[Device-radius-rs1] primary accounting 192.168.0.112
[Device-radius-rs1] key authentication simple radius
[Device-radius-rs1] key accounting simple radius
[Device-radius-rs1] user-name-format without-domain
[Device-radius-rs1] quit
[Device] radius session-control enable
(6) 配置认证域
# 创建名称为dm1的ISP域,配置dm1的ISP域使用的RADIUS方案为rs1,系统缺省的ISP域为dm1。
[Device] domain dm1
[Device-isp-dm1] authentication portal radius-scheme rs1
[Device-isp-dm1] authorization portal radius-scheme rs1
[Device-isp-dm1] accounting portal radius-scheme rs1
[Device-isp-dm1] quit
[Device] domain default enable dm1
(7) 配置Portal认证
# 配置Portal web服务器newpt的URL,在接口GigabitEthernet1/0/2开启直接方式的Portal认证,并引用Portal web 服务器。
[Device] portal web-server newpt
[Device-portal-websvr-newpt] url http://2.2.2.1:2331/portal
[Device-portal-websvr-newpt] quit
[Device] interface gigabitethernet 1/0/2
[Device–GigabitEthernet1/0/2] portal enable method direct
[Device–GigabitEthernet1/0/2] portal apply web-server newpt
[Device–GigabitEthernet1/0/2] quit
# 开启本地Portal web服务,配置本地Portal Web服务提供的缺省认证页面文件(设备的存储介质的根目录下必须已存在该认证页面文件,否则功能不生效),指定本地Portal Web服务的HTTP服务侦听的TCP端口号。
[Device] portal local-web-server http
[Device–portal-local-websvr-http] default-logon-page abc.zip
[Device–portal-local-webserver-http] tcp-port 2331
[Device–portal-local-webserver-http] quit
# 以上配置完成后,通过执行以下显示命令可查看Portal配置是否生效。
[Device] display portal interface gigabitethernet 1/0/2
Portal information of GigabitEthernet1/0/2
NAS-ID profile: Not configured
Authorization : Strict checking
ACL : Disabled
User profile : Disabled
Dual stack : Disabled
Dual IP : Disabled
Advertisement-push : Disabled
Embedded advertisement :Disabled
IPv4:
Portal status: Enabled
Portal authentication method: Direct
Portal Web server: newpt(active)
Secondary portal Web server: Not configured
Portal mac-trigger-server: Not configured
Authentication domain: Not configured
Pre-auth domain: Not configured
Extend-auth domain: Not configured
User-dhcp-only: Disabled
Pre-auth IP pool: Not configured
Max portal users: Not configured
Bas-ip: Not configured
User detection: Not configured
Portal temp-pass: Disabled
Action for server detection:
Server type Server name Action
-- -- --
Layer3 source network:
IP address Mask
Destination authenticate subnet:
IP address Mask
Advertisement push: Not configured
IPv6:
Portal status: Disabled
Portal authentication method: Disabled
Portal Web server: Not configured
Secondary portal Web server: Not configured
Portal mac-trigger-server: Not configured
Authentication domain: Not configured
Pre-auth domain: Not configured
Extend-auth domain: Not configured
User-dhcp-only: Disabled
Pre-auth IP pool: Not configured
Max portal users: Not configured
Bas-ipv6: Not configured
User detection: Not configured
Portal temp-pass: Disabled
Action for server detection:
Server type Server name Action
-- -- --
Layer3 source network:
IP address Prefix length
Destination authenticate subnet:
IP address Prefix length
Advertisement push: Not configured
# 使用本地Portal Web服务进行Portal认证的组网环境中,只支持通过网页方式进行Portal认证。用户在通过认证前,只能访问认证页面http://2.2.2.1:2331/portal,且发起的Web访问均被重定向到该认证页面,在通过认证后,可访问非受限的互联网资源。
# Portal用户认证通过后,可通过执行以下显示命令查看Device上生成的Portal在线用户信息。
[Device] display portal user interface gigabitethernet 1/0/2
Total portal users: 1
Username: abc
Portal server: N/A
State: Online
VPN instance: N/A
MAC IP VLAN Interface
0015-e9a6-7cfe 2.2.2.2 -- GigabitEthernet1/0/2
Authorization information:
DHCP IP pool: N/A
ACL number/name: N/A
Inbound CAR: N/A
Outbound CAR: N/A
Web URL: N/A
暂无评论
要实现无线认证和“一人一设备”的限制,有个前提必须先确认:F100-M-G5 是一款防火墙,它本身不具备管理 AP(无线接入点)的功能,无线认证的配置需要在实际管理 AP 的无线控制器(AC)上完成。
鉴于管理 AP 的设备大概率是 H3C 的 AC(比如 WX 系列),以下方案均基于在 H3C AC 上完成配置。实现“一人一设备”最直接的方式是通过本地 Portal 认证,并设置账号的最大同时在线数。
这种方案不需要部署额外的服务器,直接在 AC 上就能完成所有认证和限制功能。
核心思路:AC 作为无线网络的网关,同时也作为 Portal 认证服务器和 RADIUS 服务器,对连接上的用户弹出入力认证页面。通过在本地用户账号上设置 access-limit 限制,确保一个账号只能在一台设备上使用。
关键配置要点:
创建认证域:进入 system-view 后,创建认证域(例如 domain portal),并指定认证、授权、计费方式均为 local。
配置 Portal Web 服务器:使用 portal web-server <name> 创建 Portal 服务器,并用 url 指定认证页面的地址。
创建本地用户并限制登录数:最关键的一步。使用 local-user <用户名> class network 创建网络接入用户,配置密码和 service-type portal,并使用 access-limit 1 命令,强制该账号的最大同时在线数为 1。
配置免认证规则(关键):为了让用户在认证前能访问到认证页面和解析 DNS,需要放通到 Portal Web 服务器和 DNS 服务器的流量。
关联无线服务模板:在无线服务模板(WLAN Service Template)视图下,应用 Portal Web 服务器和认证域。
如果希望实现更严格的“一人一机”绑定,在方案一的基础上,可以将账号和设备的 MAC 地址进行强绑定。
操作方法:在创建本地用户后,使用 bind-attribute mac <终端的MAC地址> 命令。这样,即使账号密码泄露,该账号也只能在指定 MAC 地址的设备上登录。
如果 AC 支持上云,也可以选择使用 H3C 的云简平台(Oasis)进行认证,通过云平台创建固定账号,可以省去本地复杂的命令行配置。
参考:具体可以参考官网的配置案例。
暂无评论
你这个需求就是:F100-M-G5 做无线 Portal / 账号认证,并且做到 “一个账号同一时间只能一台设备在线”。下面给你完整可直接套用的配置(本地 Portal + 本地用户,单账号单终端)。
一、核心思路
用 Portal 认证(支持短信 / 微信 / 账号密码等)。
开启单账号最大在线终端数 = 1。
开启强制踢下线:第二个设备登录时,自动把第一个踢掉。
二、完整配置(CLI,直接复制)
1. 全局开启单账号限制(所有账号默认 1 台)
bash
运行
system-view
# 全局:一个账号最多1台设备在线
user-limit single-account max-count 1
2. 配置本地用户(账号密码方式举例)
bash
运行
# 新建用户(示例账号:user01,密码:Admin@123)
local-user user01 class network
password simple Admin@123
service-type portal
# 单用户最大在线数=1(和全局叠加,更保险)
access-limit max-user 1
quit
3. 配置 Portal 认证(无线接口 / 认证域)
bash
运行
# 1)创建ISP域(认证域)
isp domain wifi-isp
# 开启Portal强踢:新设备认证时,踢掉旧设备
portal force-logout re-authenticate
quit
# 2)全局启用本地Portal Web服务
portal local-web-server http
default-logon-page default.zip # 系统默认页面,无需额外文件
tcp-port 8080
quit
# 3)在无线服务模板/接口下绑定Portal和域
# 假设你的无线服务模板是 wlan service-template 1
wlan service-template 1 crypto
ssid MyWiFi
authentication-method wpa2-psk
wpa2-psk simple WiFi@123
# 绑定认证域
client-security authentication-domain wifi-isp
# 开启Portal
portal enable
portal apply web-server local
quit
4. 关键验证
bash
运行
# 查看用户在线限制
display user-limit single-account
# 查看在线用户
display portal user
三、支持的认证方式(任选其一,都能配合 “一人一台”)
账号密码认证(上面配置)
短信认证:配置短信网关,用户输手机号收验证码→上网。
微信认证:用户扫码关注公众号→自动上网。
一键认证:点 “同意上网” 即可(适合访客)。
以上任意一种,只要配合 user-limit + access-limit + portal force-logout,就能实现:
同账号只能一台设备在线
第二台设备登录→第一台自动掉线
四、常见问题
为什么还能多台登录?
没配 user-limit single-account max-count 1
没在用户下配 access-limit max-user 1
没开 portal force-logout re-authenticate
旧设备离线很久还占着名额?
配置 portal timeout idle 300(5 分钟无流量踢下线)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论