Suppose I have a bunch of hosts set up like this:
host host2 { hardware ethernet 10:bf:48:xx:xx:xx; fixed-address 192.168.1.2; }
host host3 { hardware ethernet 10:bf:48:xx:xx:xx; fixed-address 192.168.1.3; }
# etc ...
subnet 192.168.1.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 8.8.8.8, 8.8.4.4;
# Unknown test clients get this pool.
pool {
max-lease-time 1800; # 30 minutes
range 192.168.1.100 192.168.1.250;
allow unknown-clients;
}
# MyHosts nodes get this pool
pool {
max-lease-time 1800;
range 192.168.1.1 192.168.1.20;
allow members of MyHosts;
deny unknown-clients;
}
}
I want to put these into a class and assign them to a pool so that I can ensure that only those hosts are allowed on that pool.
I tried defining them as:
class "MyHosts" {
host host2 { hardware ethernet 10:bf:48:xx:xx:xx; fixed-address 192.168.1.2; }
host host3 { hardware ethernet 10:bf:48:xx:xx:xx; fixed-address 192.168.1.3; }
}
But this gave an error "host declarations not allowed here".
How do I do it?