Linux
dhcpd IP 할당 규칙
구차니
2023. 9. 1. 15:39
mac의 oui에 따라서 ip 대역을 다르게 할당하는 방법인.. 듯?
class "kvm" { match if binary-to-ascii(16,8,":",substring(hardware, 1, 2)) = "56:11"; } class "local" { match if binary-to-ascii(16,8,":",substring(hardware, 1, 2)) = "52:54"; } host meme { fixed-address 10.1.0.254; } host server247 { hardware ethernet 52:54:00:2f:ea:07; fixed-address 10.1.0.247; } subnet 10.1.0.224 netmask 255.255.255.224 { option routers 10.1.0.225; pool { allow members of "kvm"; range 10.1.0.226 10.1.0.235; } pool { allow members of "local"; range 10.1.0.236 10.1.0.240; } pool { # Don't use this pool. It is really just a range to reserve # for fixed addresses defined per host, above. allow known-clients; range 10.1.0.241 10.1.0.253; } } |
[링크 : https://serverfault.com/questions/79748/assign-dhcp-ips-for-specific-mac-prefixes]
예 14.3. DHCP를 사용하여 고정 IP 주소 host apex { option host-name "apex.example.com"; hardware ethernet 00:A0:78:8E:9E:AA; fixed-address 192.168.1.4; } |
예 14.6. “그룹 선언” 에서 시연한 대로 그룹 선언은 선언 그룹에 전역 매개 변수를 적용하는 데 사용됩니다. 예를 들어 공유 네트워크, 서브넷 및 호스트를 그룹화할 수 있습니다. 예 14.6. 그룹 선언 group { option routers 192.168.1.254; option subnet-mask 255.255.255.0; option domain-search "example.com"; option domain-name-servers 192.168.1.1; option time-offset -18000; # Eastern Standard Time host apex { option host-name "apex.example.com"; hardware ethernet 00:A0:78:8E:9E:AA; fixed-address 192.168.1.4; } host raleigh { option host-name "raleigh.example.com"; hardware ethernet 00:A1:DD:74:C3:F2; fixed-address 192.168.1.6; } } |