I known in dhcpd.conf
, I can use following config to assigned a fixed ipv4 address to a client.
host h1{
hardware ethernet 11:22:33:44:55:66;
fixed-address 192.0.2.2;
}
range 192.0.2.100 192.0.2.199;
But what should I do if I just want to block the host 11:22:33:44:55:66
(send DHCPDECLINE to host).
My situation is: In my datacenter, I use iLO (shared NIC with OS, aka NCSI) for server management. And I only know iLO MAC address where server is delivered.
I need use fixed IPv6 address (assigned by DHCPv6) on iLO and dynamic IPv4 address on OS. Because of lack of IPv4 address, iLO shouldn't get an IPv4 address. So I need send DHCPDECLINE to iLO.
Turn off DHCP on the client.
Add the fixed address as you've shown above.
Firewall rule to block UDP port 68 from the client
If the client address is in your DHCP scope range, I recommend you do the first two suggestions - turn off DHCP on the client AND also add a fixed address in case it gets turned on again. It prevents other clients in the range from getting that address as well.