1

In a network with multiple DHCP servers, how should we configure the dhcpcd.conf file for an interface to accept offers from a specific DHCP server and ignore all others? I tried blacklisting one DHCP server, and it did not worked. Is it possible to do it with user server identifiers?

Warlock
  • 11
  • 3
  • 1
    A DHCP server does not send a request. The client sends a request, the DHCP returns an offer. Why do you have multiple DHCPs in the first place? This is a recipe for headaches. – Panki Jun 18 '21 at 09:44
  • My mistake, DHCP offers. Why 2 DHCPs, well, I know it is not tidy but we have a network (internal) and testbed. The testbed nodes are connected via mesh network and one of the nodes in the testbed is handling IPs for all the testbed nodes. Somehow the testbed nodes are getting DHCP offers (for their request) from the main DHCP server, not onyl from the dhcpd running in a node. The request is forwarded by the node to the main DHCP server. Eventually, the nodes are getting offers from both. Again, why, i don't know. My previous colleagues set it up. The internal network is bit complicated. – Warlock Jun 18 '21 at 13:37
  • 1
    I'm not sure about this, but it sounds like you should block DHCP on the router interface to the testbed network – Panki Jun 18 '21 at 13:51
  • Or at the very least, firewall off the undesired DHCP server on the testbed host(s). But blocking at the router is a more elegant solution. – Jim L. Sep 13 '21 at 20:38

1 Answers1

0

I was having the same issue. I have an embedded Linux device on the network with its own DHCP server. It is a static IP of 192.168.168.1 and it would always offer a IP address in addition to the WiFi router on my network.

So in order to always ignore the offered 192.168.168.x IP, I found the blacklist option in both man dhcpcd and the config file man dhcpcd.conf.

By simply adding blacklist 192.168.168.1 to my dhcpcd.conf then I always get the IP offered by my WiFi router (which is really what I want to get on the internet).

Brad Grissom
  • 121
  • 2