Portál AbcLinuxu, 9. listopadu 2025 06:18
host somename {
hardware ethernet xx:xx:xx:xx:xx:xx;
fixed-address somename;
}
Zaznam sice musite zapsat rucne do DNS, ale staci zapsat ho pouze tam, takze nemusite psat totez na dve mista a udrzovat to synchronizovane.
class "privileged_ips" {
...
}
subnet 10.0.0.0 netmask 255.0.0.0 {
# neprivilegovani
pool {
allow unknown-clients;
# asi neni treba - ale neuskodi
deny known-clients;
deny members of "privileged_ips";
range 10.1.0.1 10.1.0.254;
}
# privilegovani
pool {
allow members of "privileged_ips";
# asi neni treba - ale neuskodi
deny known-clients;
range 10.2.0.1 10.2.0.254;
}
}
Pointa je v tom, ze obema skupinam prideluje IP adresy dhcp server a zaridi taky zmenu v DNS. Vy mu pouze reknete, aby pro nektere klienty pouzil jiny rozsah.class {} zaridite, aby do ni spadly pouze pozadovane IP adresy.class { match if hardware = 01:xx:xx:xx:xx:xx:xx; }class {
match if
(hardware = 01:xx:xx:xx:xx:xx:xx)
or ( hardware = ...)
or ( hardware = ...) ;
}, ale to jsem nezkousel.subclassclass "allocation-class-1" {
match pick-first-value (option dhcp-client-identifier, hardware);
}
subclass "allocation-class-1" 1:8:0:2b:4c:39:ad;
subclass "allocation-class-1" 1:0:0:c4:aa:29:44;
Nepochopil jsem moc tu logiku, ale pointa je v tom, ze je-li client clenem subclass pak je i clenem class.
substring(hardware,1,6) nebo tak nejak (viz man dhcpd.conf nebo man dhcp-eval).
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.