Added more documentation for dynamic clients
[freeradius.git] / raddb / sites-available / dynamic-clients
index 385a3e7..b3acb41 100644 (file)
@@ -42,7 +42,7 @@ client dynamic {
        netmask = 16
 
        #
-       #  Any other configuration normall found in a "client"
+       #  Any other configuration normally found in a "client"
        #  entry can be used here.
 
        #
@@ -54,13 +54,24 @@ client dynamic {
        dynamic_clients = dynamic_client_server
 
        #
+       #  The directory where client definitions are stored.  This
+       #  needs to be used ONLY if the client definitions are stored
+       #  in flat-text files.  Each file in that directory should be
+       #  ONE and only one client definition.  The name of the file
+       #  should be the IP address of the client.
+       #
+       #  If you are storing clients in SQL, this entry should not
+       #  be used.
+#      directory = ${confdir}/dynamic-clients/
+
+       #
        #  Define the lifetime (in seconds) for dynamic clients.
        #  They will be cached for this lifetime, and deleted afterwards.
        #
        #  If the lifetime is "0", then the dynamic client is never
        #  deleted.  The only way to delete the client is to re-start
        #  the server.
-       lifetime = 86400
+       lifetime = 3600
 }
 
 #
@@ -125,7 +136,7 @@ server dynamic_client_server {
                #  Or, look the client up in SQL.
                #
                #  This requires the SQL module to be configured, of course.
-               if ("%{sql: SELECT nasname FROM nas WHERE nasname = %{Packet-Src-IP-Address}}") {
+               if ("%{sql: SELECT nasname FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}") {
                        update control {
                                #
                                #  Echo the IP.
@@ -134,11 +145,13 @@ server dynamic_client_server {
                                #
                                #  Do multiple SELECT statements to grab
                                #  the various definitions.
-                               FreeRADIUS-Client-Shortname = "%{sql: SELECT shortname FROM nas WHERE nasname = %{Packet-Src-IP-Address}}"
+                               FreeRADIUS-Client-Shortname = "%{sql: SELECT shortname FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"
+
+                               FreeRADIUS-Client-Secret = "%{sql: SELECT secret FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"
 
-                               FreeRADIUS-Client-Secret = "%{sql: SELECT secret FROM nas WHERE nasname = %{Packet-Src-IP-Address}}"
+                               FreeRADIUS-Client-NAS-Type = "%{sql: SELECT type FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"
 
-                               FreeRADIUS-Client-NAS-Type = "%{sql: SELECT type FROM nas WHERE nasname = %{Packet-Src-IP-Address}}"
+                               FreeRADIUS-Client-Virtual-Server = "%{sql: SELECT server FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"
                        }
 
                }