WiFi & Mac address authentication

brainstorm braincode at gmail.com
Fri Mar 24 00:22:47 CET 2006


I've tried your recommendations but it does not work as expected:
using "Reject" as rlm_passwd's "authtype" (as you suggested), the user
is always rejected, even when the MAC is in the file and is actually
found:

modcall[authorize]: module "MAC-IP" returns ok for request 0

Furthermore, if I change rlm_passwrd's authtype to "Accept", the
supplicant auth fails and the following warning is shown:

rad_check_password:  Found Auth-Type Accept
rad_check_password:  Found Auth-Type EAP
Warning:  Found 2 auth-types on request for user 'bob'

However, if I comment rlm_passwd sections (MAC-IP in modules and
authorize), all works flawlessly.

The users file has entries like these:

bob NT-Password == 0xa3d411301d637a38f4d22d484f256a04
joe  NT-Password == 0xa3d411301d637a38f4d22d484f256a04
(...)

Which are matched correctly in all scenarios I've tested:

modcall[authorize]: module "eap" returns updated for request 0
    users: Matched entry bob at line 1

According to radius documentation (aaa.txt), it is not correct to
place Auth-Type on check nor reply lists on the users file:

"A quite common mistake is to place the attributes in the wrong lists,
for example placing Auth-Type, Password, NT-Password etc in the check
list, or in the reply list.  When run in debugging mode, the server
will normally issue 'WARNING' messages saying that the attributes are
in the wrong list"

So I conclude that users file is correct as it is now. What I'm doing
wrong and what should I  do to avoid those warning messages ? If you
want the radiusd -X logs, I can attach them if you wish.

Thanks in advance.
-------------------------------

    passwd MAC-IP {
               filename = ${raddbdir}/MAC-IP
               format = "*Calling-Station-Id:"
               delimiter = ":"
               authtype = Reject    <---- Also tried with "Accept"
        }

(...)

authorize {
    preprocess
    MAC-IP {
        notfound = reject
    }
    files
    eap
}


authenticate {
    Auth-Type MS-CHAP {
        mschap
    }
    eap
}



On 3/13/06, Phil Mayers <p.mayers at imperial.ac.uk> wrote:
> brainstorm wrote:
> > I'm trying to implement a similar scenario: I am using PEAP, and I
> > want to check if a given mac is in my database. In my case, the MACs
> > file looks like this:
> >
> > 0030.0996.CF52:192.168.12.1
> >
> > I would like to match the first field (MAC) with the NAS
> > "Calling-Station-Id" attribute, if this check fails, I would like to
> > reject that user. Is it doable with rlm_password ? I've tried, but I
> > cannot figure out which is the right "format" for my case:
> >
> > I've tried the following in radiusd.conf:
> >
> > modules {
> > (...)
> > passwd mac-ip {
> >                 filename = /etc/raddb/MAC-IP
> >                 format = "mac-address:Calling-Station-Id"
> >                 delimiter = ":"
> >         }
> > }
>
> Please read the docs. This comments right above the "passwd" module in
> the default config are VERY SPECIFIC. The format is:
>
> format = "*Key-Value:~Request-Value:=Reply-Value:Configure-Value"
>
> That is, the radius attribute "Key-Value" is the first field.
> Request-Value (prefix ~) will be added to the request, Reply-Value
> (prefix =) to the reply, and Configure-Value (no prefix) to the
> configure items.
>
> So you're wrong several ways:
>
>   1. "mac-address" is not a radius attribute
>   2. None of your attributes have * for key
>   3. In any case, for WAPs, Calling-Station-Id is normally the MAC, not IP
>   3. By itself you can't negate the sense and reject-if-no-match
>
> Try something like this:
>
> passwd mac-ip {
>                  filename = /etc/raddb/MAC-IP
>                  format = "*Calling-Station-Id:Class"
>                  delimiter = ":"
>                  authtype = Reject
>          }
> always fail {
>    rcode = fail
> }
>
> authorize {
>    mac-ip {
>      notfound = reject
>    }
>    # others
> }
>
> ...and note that many/most APs send the MAC as "00-11-22-33-44-55" so
> the file should look like this:
>
> 00-11-22-33-44-55:KnownUser
>
> This is all in the docs.
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>




More information about the Freeradius-Users mailing list