strongSwan + FreeRadius DHCP pool

Matthew Newton mcn4 at leicester.ac.uk
Mon Apr 18 00:25:39 CEST 2016


On Sun, Apr 17, 2016 at 03:10:45PM -0700, Laurens Vets wrote:
> So there's no way to set Pool-Name in the clients.conf file?

Not directly. But you can make up variables there and then access
them from unlang.

> From what I can see in the unlang manual, I have to do:
> update control {
>     &Pool-Name := "1_pool"
> }

Add the pool name to your clients.conf, e.g.

client client_1 {
  ...
  mypoolname = pool_1
  ...
}

Then pull this out into the Pool-Name attribute with unlang in
sites-enabled/default in the post-auth{} or authorize{} section:

  update control {
    Pool-Name := "%{client:mypoolname}"
  }


> update control {
>     if(Called-Station-Id eq 1.1.1.1) {
>         pool-name = "1_pool"
>     }
>     elseif(Called-Station-Id eq 2.2.2.2) {
>         pool-name = "2_pool"
>     }
> }

That's not correct syntax. You need the update control{} around
each assignment. You can't just put the whole thing inside an
update.

If you want to look up the pool name from Called-Station-Id,
rather than the client that is connecting, then you could
configure an instance of the files module to look up
Called-Station-Id in a file and set the Pool-Name. Or sql. Or many
other ways, depending on where you have the data.

> I'm struggling with the 'somewhere' part :)

Either authorize{} or post-auth{}. Probbaly the latter, before you
do your IP assignment.

Matthew


-- 
Matthew Newton, Ph.D. <mcn4 at le.ac.uk>

Systems Specialist, Infrastructure Services,
I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom

For IT help contact helpdesk extn. 2253, <ithelp at le.ac.uk>


More information about the Freeradius-Users mailing list