Special WIFI Router MAC check for the user’s first connection.
Special WIFI Router MAC check for the user’s first connection. I’m using free radius server 2.1.11 on Linux Enterprise Server 6.1. OS: Linux Enterprise Server 6.1 Radius: free radius server 2.1.11 Database: Mysql WIFI AP: Use WPA/WPA2 There’re about 100 WIFI APs in the network. All these APs use this free radius server. The whole thing is working fine. Now I got a requirement, this requirement need to check the WIFI AP MAC address for user’s first login. For example, WIFI AP 26, has the MAC address MAC26. I need ensure one WIFI user, say user 58, must connect to WIFI AP 26 for the first time. After the first connection, user 58 can connect to any WIFI AP in the network. Can someone give some advice on how to do it? Thanks! Tom
On 31/08/11 12:38, 2394263740 wrote:
For example, WIFI AP 26, has the MAC address MAC26. I need ensure one WIFI user, say user 58, must connect to WIFI AP 26 for the first time. After the first connection, user 58 can connect to any WIFI AP in the network. Can someone give some advice on how to do it?
1. Create a whitelist of users who can authenticate to any AP using files, rlm_passwd or ideally SQL - see the FreeRADIUS wiki 2. If they are *not* found in the whitelist, check the "Called-Station-Id" attribute, which usually contains the MAC address of the AP. If your equipment uses a different attribute, check that. 3. If the AP MAC is the correct one, add the user to the whitelist, else reject For example: authorize { ... update control { Tmp-String-0 := "%{sql:select 1 from whitelist where username='%{User-Name}'}" } if (control:Tmp-String-0 == 1) { # user is in whitelist } elsif (Called-Station-Id == "aa-bb-cc-dd-ee-ff") { # user is connecting to the "whitelist" AP update control { Tmp-String-0 = "%{sql:insert into whitelist (username) values ('%{User-Name}')}" } } else { reject } ... }
participants (2)
-
2394263740 -
Phil Mayers