sqlippool additional information

Nathan Ward lists+freeradius at daork.net
Thu Dec 6 02:24:47 CET 2018


I’m doing some testing of sqlippool in a fairly large scale environment, where we have lots of different IPv4 prefixes to select addresses from.

We have many prefixes in each pool, and direct customers to pools based on some details.

Depending on the prefix the customer gets assigned an address from we want to return different information in RADIUS - such as setting attributes to pass DHCP options like prefix length, router, DNS server, etc.
In my testing, I’ve been setting these manually, but in production these can change, and I don’t want to be reconfiguring and reloading the RADIUS server each time we move things about.
Customers could get addresses from any prefix, so we can’t provide these values from our user database unfortunately.

sqlippool returns only a single value. As does sql xlat.

Is there a good way to pull these from a DB? We’ve got both LDAP and SQL at our disposal.

We’re running Postgres, so can easily do a longest prefix match to find the prefix that an address is in - but this means one query per attribute value we want, which I figure means about 4 or 5 extra queries per auth request so isn’t really ideal.
Before I go down that road, I figured I’d reach out and see if anyone else has an elegant solution I haven’t considered, as it seems like it’d be a fairly common problem.

Nathan Ward

More information about the Freeradius-Users mailing list