How to use rewrite.called_station_id IN dynamic clients authorize section

James Wood james.wood at purplewifi.com
Thu Mar 26 19:15:43 CET 2015


Hi Ben

Our routers are not an issue, we already vpn traffic back. Thats for our small customers and it works great.

I'm talking about the enterprise market where we can't get a VPN or tunnel as much as we would like.

We are revisiting our approach and solution but at this time we have what we have. I know it's not great.

Dynamic clients file:

client dymamic {
       ...
}

server dynamic_client_server {
        authorize {
                #Test to see if our required raw attribute exists
                if("%{raw:Called-Station-Id}"){
                        rewrite.called_station_id
                        #Test to see if it is in the DB
                        if ("%{sql: select count(*) from nas where community=REPLACE(SUBSTRING(\"%{Called-Station-Id}\",1,17),\":\",\"-\")}" == 1) {
                                update control {
                                               ...
                                }
                                ok
                        }
                }
        }
}

NAS client example below from our DB.

Columns
---------------
nasname
shortname
type
ports
secret
server
community
description
router_type

Values
-----------------
00-18-0A-33-0C-5E
other
NULL
xxxxxxxxxxx
NULL
00-18-0A-33-0C-5E
RADIUS Client
Meraki AP

Thanks again,

James




More information about the Freeradius-Users mailing list