Created
December 4, 2024 03:25
-
-
Save noslin005/8e44d25c126f81424407b3037ef10df2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
authoritative; | |
allow bootp; | |
default-lease-time 600; | |
max-lease-time 7200; | |
log-facility local0; | |
ddns-update-style none; | |
# Parent class for all test | |
class "test" { | |
match concat( | |
suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 1, 1))), 2), ":", | |
suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 2, 1))), 2), ":", | |
suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 3, 1))), 2), ":", | |
suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 4, 1))), 2), ":", | |
suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 5, 1))), 2), ":", | |
suffix(concat("0", binary-to-ascii(16, 8, "", substring(hardware, 6, 1))), 2) | |
); | |
log(debug, "Class for test found"); | |
} | |
# Subclass for specific MAC addresses | |
subclass "test" "52:54:00:7b:5c:08" { | |
log(debug, "Subclass matched for VM1"); | |
option host-name "vm1"; | |
} | |
subclass "test" "52:54:00:1a:2b:3c" { | |
log(debug, "Subclass matched for VM2"); | |
option host-name "vm2"; | |
} | |
shared-network "lab" { | |
subnet 10.12.0.0 netmask 255.255.0.0 { | |
option routers 10.12.0.1; | |
pool { | |
allow members of "test"; | |
range 10.12.16.10 10.12.16.10; | |
filename "pxelinux.0" | |
} | |
} | |
subnet 192.168.1.0 netmask 255.255.255.0 { | |
option routers 192.168.1.1; | |
pool { | |
deny members of "test"; | |
range 192.168.1.10 192.168.1.100; | |
filename "pxelinux.0" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment