X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=raddb%2Fpolicy.conf;h=7a64ac8e1e36b2f6c6afe749505b2846d9d11e02;hb=fecb5af1ce82eb3ce0cf53cdeabae182c73b348f;hp=3955429e046bd13befefee2b97fb84ab2c37432a;hpb=bf28ac77e2b2d8a44e3180fdf87dc4911d710875;p=freeradius.git diff --git a/raddb/policy.conf b/raddb/policy.conf index 3955429..7a64ac8 100644 --- a/raddb/policy.conf +++ b/raddb/policy.conf @@ -333,4 +333,29 @@ policy { noop } } + + # Assign compatibility data to request for sqlippool + dhcp_sqlippool.postauth { + + + # Do some minor hacks to the request so that it looks + # like a RADIUS request to the SQL IP Pool module. + update request { + User-Name = "DHCP-%{DHCP-Client-Hardware-Address}" + Calling-Station-Id = "%{DHCP-Client-Hardware-Address}" + NAS-IP-Address = %{%{DHCP-Gateway-IP-Address}:-127.0.0.1} + Acct-Status-Type = Start + } + + # Call the actual module + dhcp_sqlippool + + # Convert Framed-IP-Address to DHCP, but only if we + # actually allocated an address. + if (ok) { + update reply { + DHCP-Your-IP-Address = "%{reply:Framed-IP-Address}" + } + } + } }