help need with mysql statement in freeradius

Ivan Kalik tnt at
Fri May 16 12:00:53 CEST 2008

Ugh, even if your script was working user still can't make it.

>rad_recv: Access-Request packet from host 202.xx.xx.xx:52743, id=81,
>        NAS-Identifier = ""
>        NAS-Port = 12
>        NAS-Port-Type = Ethernet
>        Service-Type = Framed-User
>        Framed-Protocol = PPP
>        Calling-Station-Id = "001a4daf4ead"
>        Called-Station-Id = "WIFITEST"
>        User-Name = "mobile"
>        CHAP-Password = 0x0102e814e5d756effb7319a534e354dcd2
>        CHAP-Challenge =

But you have hacked configuration to make sure that user can't connect:

>authorize {
>      checkval
>        dailycounter
>        monthlycounter
>        noresetcounter
>        perl

How are you going to do chap if you remove chap module from the
configuration? Don't make changes to default configuration unless you
know what you are doing. Default configuration *works*. Add perl but
dont remove things that might turn out to be essential.

>        my $sql = $dbh->prepare( "SELECT Usemac FROM radcheck WHERE
>UserName='$username' AND Attribute='Expiration' ");

This is wrong. I have told you to use $query and print it out to see what
is your query string. Perhaps then you will notice the difference
between variable name and variable value. Your string will have
$username in it and not the value of User-Name attribute from the
request (ie. mobile). Same applies to $sql3. Also I would use == instead
of += as the operator there.

You had pointers about using authoruze function from others.

Ivan Kalik
Kalik Informatika ISP

More information about the Freeradius-Users mailing list