背景介绍
上次有网友在packetfence的文章下留言我们是否有做无线认证,刚好最近测试PacketFence 7.4,结合公司使用的华为无线做了个类似portal认证的测试。至于为什么是类似portal认证了,后面自然会介绍说明,话说实现的方式还真。。。
测试条件
项次 | 版本号 |
PacketFence | 7.4 |
华为AC6605 | AC6605 V200R007C10SPC300 |
华为AP | AP6050DN V200R007C10SPC800 |
测试步骤
1.新建用户认证通过后的role,configuration->policies and access control ->Roles ->add role
2.在PacketFence中添加AC6605交换机组
a.新建configuration->policies and access control ->network devices->switch groups
勾选 role by VLAN ID,修改对应的vlan号
填写radius密码
填写snmp读、写字段
b.在switchs下添加AC6605至刚才新建的组
3.AC6605上相应配置
authentication-profile name pf #配置mac认证
mac-access-profile pf
authentication-scheme pf
accounting-scheme pf
radius-server pf
radius-server template pf
radius-server shared-key cipher XXX
radius-server authentication 10.101.26.205 1812 weight 80
radius-server accounting 10.101.26.205 1813 weight 80
aaa #配置authentication、accounting模板
authentication-scheme pf
authentication-mode radius local
accounting-scheme pf
accounting-mode radius
accounting start-fail online
wlan #开放无线新号pf-test
security-profile name pf
ssid-profile name pf
ssid pf-test
vap-profile name pf
ssid-profile pf
security-profile pf
authentication-profile pf
radius-server authorization 10.101.26.205 shared-key cipher XXX #配置authorization服务器
4.配置认证源,configuration->policies and access control ->authentication sources ->add source,可选择多种认证源,这里使用LDAP
4.新建connection profile来定义web页面,configuration->policies and access control ->connection profiles ->add profile,在souces处选择刚才新建的test-ldap
测试客户端
1.首先客户端连接测试ssid:pf-test,连接上会直接获取registration vlan上的IP(22.22.22.0/24),在auditing页面上能看到认证通过的记录
打开该条记录,可发现packetfence给AC6650回应vlan 2002
2.打开任意网页,客户端会强制重定向packetfence portal页面上
输入上面创建的LDAP用户名和密码
认证成功后,浏览器会直接跳转至用户要打开的页面。
我们可以看到客户端IP变成normal vlan的IP(10.101.124.0/23),同时产生一条认证通过的记录,node status也变成reg状态
打开该条认证日志详情,可以看到packetfence给AC6650回应了vlan 1106
认证原理
1.华为portal认证原理:无线客户端首先通过开放网络连接获取IP地址,客户端重定向特定的portal页面或特定IP,一般是通过ACL的方式实现的,认证过后用户就能正常访问了。
2.与华为自身的准入产品agile controller的portal认证不同,packetfence实现web认证的原理是这样的:
a.无线客户端首次接入无线,packetfence对其进行mac认证,将客户端返回到registration vlan中,如下图过程1
b.客户端获得registration vlan的ip地址,将重定向只packetfence的capital portal认证页面,认证通过后,packetfence通过CoA(动态授权变更)返回正常的用户vlan。