| 1 |
== Configure access restrictions for pools |
| 2 |
|
| 3 |
We can combine what we have learned in the preceeding sections to provide pools |
| 4 |
whose access is restricted in some way, for example to a particular class. |
| 5 |
|
| 6 |
Consider the ISC DHCP configuration snippet: |
| 7 |
|
| 8 |
[source,iscdhcp] |
| 9 |
---- |
| 10 |
subnet 10.99.99.0 netmask 255.255.255.0 { |
| 11 |
pool { |
| 12 |
range 10.99.99.200 10.99.99.250; |
| 13 |
allow members of "printers"; |
| 14 |
} |
| 15 |
option routers 10.99.99.1; |
| 16 |
} |
| 17 |
---- |
| 18 |
|
| 19 |
Or the equivalent Kea configuration: |
| 20 |
|
| 21 |
[source,isckea] |
| 22 |
---- |
| 23 |
"Dhcp4": { |
| 24 |
"subnet4": [{ |
| 25 |
"subnet": "10.99.99.0/24", |
| 26 |
"pools": [ |
| 27 |
{ |
| 28 |
"pool": "10.99.99.200 - 10.99.99.250", |
| 29 |
"client-class": "printers" |
| 30 |
} |
| 31 |
], |
| 32 |
"option-data": [ |
| 33 |
{ "name": "routers", "data": "10.10.0.1" } |
| 34 |
] |
| 35 |
}], |
| 36 |
... |
| 37 |
} |
| 38 |
---- |
| 39 |
|
| 40 |
These define a subnet containing a single pool that is restricted to members of |
| 41 |
the "printers" class. (The definition for this class is omitted.) |
| 42 |
|
| 43 |
In FreeRADIUS, to filter access to this pool entries such as the following |
| 44 |
should included in the `<raddb>/mods-config/files/dhcp` configuration file: |
| 45 |
|
| 46 |
[source,config] |
| 47 |
---- |
| 48 |
network DHCP-Network-Subnet < 10.99.99.0/24, \ |
| 49 |
DHCP-Group-Name == "printers", Pool-Name := "printers-pool" |
| 50 |
DHCP-Router-Address := 10.99.99.1 |
| 51 |
---- |
| 52 |
|
| 53 |
Note that any number of additional filters can be added to the initial "check" |
| 54 |
line to restrict matches to the network block. |