~ubuntu-branches/ubuntu/jaunty/freeradius/jaunty-proposed

« back to all changes in this revision

Viewing changes to raddb/sites-available/dynamic-clients

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2008-09-22 08:42:02 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20080922084202-eyjprg3z55481ha5
Tags: 2.1.0+dfsg-0ubuntu1
* New upstream release.
* Fixes FTBFS issue with new libtool.
* Fixes listen on random port. (LP: #261809)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- text -*-
 
2
######################################################################
 
3
#
 
4
#       Sample configuration file for dynamically updating the list
 
5
#       of RADIUS clients at run time.
 
6
#
 
7
#       Everything is keyed off of a client "network".  (e.g. 192.168/16)
 
8
#       This configuration lets the server know that clients within
 
9
#       that network are defined dynamically.
 
10
#
 
11
#       When the server receives a packet from an unknown IP address
 
12
#       within that network, it tries to find a dynamic definition
 
13
#       for that client.  If the definition is found, the IP address
 
14
#       (and other configuration) is added to the server's internal
 
15
#       cache of "known clients", with a configurable lifetime.
 
16
#
 
17
#       Further packets from that IP address result in the client
 
18
#       definition being found in the cache.  Once the lifetime is
 
19
#       reached, the client definition is deleted, and any new requests
 
20
#       from that client are looked up as above.
 
21
#
 
22
#       If the dynamic definition is not found, then the request is
 
23
#       treated as if it came from an unknown client.  i.e. It is
 
24
#       silently discarded.
 
25
#
 
26
#       As part of protection from Denial of Service (DoS) attacks,
 
27
#       the server will add only one new client per second.  This CANNOT
 
28
#       be changed, and is NOT configurable.
 
29
#
 
30
#       $Id$
 
31
#
 
32
######################################################################
 
33
 
 
34
#
 
35
#  Define a network where clients may be dynamically defined.
 
36
client dynamic {
 
37
        ipaddr = 192.168.0.0
 
38
 
 
39
        #
 
40
        #  You MUST specify a netmask!
 
41
        #  IPv4 /32 or IPv6 /128 are NOT allowed!
 
42
        netmask = 16
 
43
 
 
44
        #
 
45
        #  Any other configuration normally found in a "client"
 
46
        #  entry can be used here.
 
47
 
 
48
        #
 
49
        #  A shared secret does NOT have to be defined.  It can
 
50
        #  be left out.
 
51
 
 
52
        #
 
53
        #  Define the virtual server used to discover dynamic clients.
 
54
        dynamic_clients = dynamic_client_server
 
55
 
 
56
        #
 
57
        #  Define the lifetime (in seconds) for dynamic clients.
 
58
        #  They will be cached for this lifetime, and deleted afterwards.
 
59
        #
 
60
        #  If the lifetime is "0", then the dynamic client is never
 
61
        #  deleted.  The only way to delete the client is to re-start
 
62
        #  the server.
 
63
        lifetime = 86400
 
64
}
 
65
 
 
66
#
 
67
#  This is the virtual server referenced above by "dynamic_clients".
 
68
server dynamic_client_server {
 
69
 
 
70
        #
 
71
        #  The only contents of the virtual server is the "authorize" section.
 
72
        authorize {
 
73
 
 
74
                #
 
75
                #  Put any modules you want here.  SQL, LDAP, "exec",
 
76
                #  Perl, etc.  The only requirements is that the
 
77
                #  attributes MUST go into the control item list.
 
78
                #
 
79
                #  The request that is processed through this section
 
80
                #  is EMPTY.  There are NO attributes.  The request is fake,
 
81
                #  and is NOT the packet that triggered the lookup of
 
82
                #  the dynamic client.
 
83
                #
 
84
                #  The ONLY piece of useful information is either
 
85
                #
 
86
                #       Packet-Src-IP-Address (IPv4 clients)
 
87
                #       Packet-Src-IPv6-Address (IPv6 clients)
 
88
                #
 
89
                #  The attributes used to define a dynamic client mirror
 
90
                #  the configuration items in the "client" structure.
 
91
                #
 
92
                update control {
 
93
 
 
94
                        #
 
95
                        #  Echo the IP address of the client.
 
96
                        FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}"
 
97
 
 
98
                        # require_message_authenticator
 
99
                        FreeRADIUS-Client-Require-MA = no
 
100
 
 
101
                        # secret
 
102
                        FreeRADIUS-Client-Secret = "testing123"
 
103
 
 
104
                        # shortname
 
105
                        FreeRADIUS-Client-Shortname = "%{Packet-Src-IP-Address}"
 
106
 
 
107
                        # nastype
 
108
                        FreeRADIUS-Client-NAS-Type = "other"
 
109
 
 
110
                        # virtual_server
 
111
                        #
 
112
                        #  This can ONLY be used if the network client
 
113
                        #  definition (e.g. "client dynamic" above) has
 
114
                        #  NO virtual_server defined.
 
115
                        #
 
116
                        #  If the network client definition does have a
 
117
                        #  virtual_server defined, then that is used,
 
118
                        #  and there is no need to define this attribute.
 
119
                        #  
 
120
                        FreeRADIUS-Client-Virtual-Server = "something"
 
121
 
 
122
                }
 
123
 
 
124
                #
 
125
                #  Or, look the client up in SQL.
 
126
                #
 
127
                #  This requires the SQL module to be configured, of course.
 
128
                if ("%{sql: SELECT nasname FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}") {
 
129
                        update control {
 
130
                                #
 
131
                                #  Echo the IP.
 
132
                                FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}"
 
133
 
 
134
                                #
 
135
                                #  Do multiple SELECT statements to grab
 
136
                                #  the various definitions.
 
137
                                FreeRADIUS-Client-Shortname = "%{sql: SELECT shortname FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"
 
138
 
 
139
                                FreeRADIUS-Client-Secret = "%{sql: SELECT secret FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"
 
140
 
 
141
                                FreeRADIUS-Client-NAS-Type = "%{sql: SELECT type FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}"
 
142
                        }
 
143
 
 
144
                }
 
145
 
 
146
                #
 
147
                #  Tell the caller that the client was defined properly.
 
148
                #
 
149
                #  If the authorize section does NOT return "ok", then
 
150
                #  the new client is ignored.
 
151
                ok
 
152
        }
 
153
}