如何在freeRADIUS中按用户使用Calling-Station-Id?

我试图通过直接在users文件中包含适当的信息来限制每个用户在RADIUS中的一小组Mac-ID。 即使每个用户只限于一个mac也是可以接受的。 服务器从Ubuntu 13.10版本库运行FreeRADIUS版本2.1.12。 使用的身份validation是PEAP和MSCHAPv2。

当物理客户端(Nexus 5)尝试通过接入点(Netgear WG-102)连接时,FreeRADIUS似乎在访问请求中标识Mac-id,但不在检查中使用它。 在我当前的testing设置中,networking上的唯一设备是radius服务器,接入点和testing客户端。 users文件中的条目设置如下:

 testuser NT-Password := "<hash>", Calling-Station-Id == "a1b2c3d4e5f6" 

policy.conf文件有一个rewrite.calling_station_id函数,用于将Mac ID标准化为上述格式,并在preprocess后在available-sites/default调用。 正确格式化的mac-id显示在运行freeradius -X的日志中。 但是,这些请求被拒绝。 即使支票被Calling-Station-Id =* "a1b2c3d4e5f6"取代,只要该属性存在就应该通过,这些请求被拒绝。 但是,如果它被Calling-Station-Id !* "a1b2c3d4e5f6"取代,只有在请求中存在该属性的情况下才会通过该请求,这些请求将被接受。

相反,如果我使用radclient ,则会观察到预期的行为。 configuration文件和相关日志链接如下。 整个/etc/freeradius文件夹已链接,并且还包含以下四种情况的日志。 请注意,数字2是唯一出乎意料的行为:

  1. nexus-without-mac-successusers文件没有mac检查,authentication成功
  2. nexus-with-mac-failusers文件具有正确的MAC地址,authentication失败
  3. radclient-with-mac-expected-behaviour-fail-with-wrong :radclient以错误的mac地址运行并被拒绝: echo "User-Name=testuser,User-Password=test,Calling-Station-Id=8c:3a:e3:19:70:0e" | radclient localhost auth testing123 echo "User-Name=testuser,User-Password=test,Calling-Station-Id=8c:3a:e3:19:70:0e" | radclient localhost auth testing123
  4. radclient-with-mac-expected-behaviour-success-with-correct :radclient以正确的MAC地址运行并被接受: echo "User-Name=testuser,User-Password=test,Calling-Station-Id=8c:3a:e3:19:70:0f" | radclient localhost auth testing123 echo "User-Name=testuser,User-Password=test,Calling-Station-Id=8c:3a:e3:19:70:0f" | radclient localhost auth testing123

以这种方式使用Calling-Station-Id是不可能的? 与http://wiki.freeradius.org/guide/Mac-Auth相反,我希望Mac-Id在每个用户的基础上有所限制,所以如果您有另一种方法来做到这一点,那也是受欢迎的。

http://portmasters.com/tech/docs/radius/userinfo.html#1004825似乎是说这是这样做的正确方法,虽然它是在1999年写的。

http://www.cmi.ac.in/~ronno/freeradius-test包含以下内容:

  • freeradius/etc/freeradius
  • logs – 上述四个日志
  • wg102.cfg – 接入点configuration
  • snapshot.tar.gz – 包含所有上述的tarball

您还没有将外部请求中的属性反馈给内部服务器。

eap{peap{}}设置copy_tunnel_request = yes (在eap.conf或mods-available / eap中)。

https://github.com/FreeRADIUS/freeradius-server/blob/master/raddb/mods-available/eap#L594

内部服务器中的文件调用无法访问外部请求中的Calling-Station-ID属性,不匹配任何条目,因此不设置NT-Password控制属性。