Configuring Foreman DHCP server for PXE boot to only respond to certain statically configure MAC address

Problem:
I want the DHCP Server on Foreman to only respond to the servers who’s MAC have been configured and not to respond to anything else on the L2 network.

Expected outcome:
I’d like to be able to configure a list of MAC addresses in Foreman that would have it respond to the servers who’s MAC have been configured and nothing else on the L2 network.

Foreman and Proxy versions:
Forman 2.4

Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:

I could be wrong here, so please correct me.

So, if you configure dhcpd with the network without defining an IP pool, then it won’t allocate any IPs (won’t respond) since it has no available IPs. However, if it has a lease in the file (added by foreman on host creation/host network update), which includes the MAC of the host, then for that MAC it will respond. Essentially, allowing you to run multiple DHCP servers as long as their allocation do not overlap. Be careful if you have dhcp-managed enabled setting in foreman as that may cause problems during upgrades.

1 Like

Yes, I can confirm and I have done that in the past, however, sometimes multiple DHCP servers can cause issues and hiccups to some DHCP clients. If you can avoid it, I would rather not do it in productions.

Thanks guys, this sounds promising, only concern would be the DHCP client hiccups that Izap mentioned about having multiple DHCP servers. I’ll try to find out more about this. In My particular scenario pxe-less wouldn’t really be an option as loading the discovery image by USB might not be possible in alot of cases

This post bellow states:

“There’s a external iPXE server (10.10.1.217) already configured that successfully installs the Discovery Image to network booted clients.”

Seems like he is somehow doing a network boot and loading the Discovery with and iPXE without DHCP? I’ll searched online not sure how that is possible. but if it is, that would possibly solve my problem.

Thanks

You can use discovery without DHCP in PXE-less mode when it asks for network information (or you can provide it via kernel command line), then instead rebooting into OS installer it performs kexec. This has proven to be quite unreliable tho, I only recommend it for VMs.

Other than that, you cannot boot from network without actually configuring the network credentials either via DHCP or statically. With iPXE you can actually create a boot script that will ask you for network and then iPXE can load Discovery - that is possible yeah. But you would need to provide kernel command line options again.

If you are really looking to provision servers without network, I suggest you take a look on Bootdisk plugin, I suggest Full Host Bootdisk.

https://docs.theforeman.org/nightly/Provisioning_Guide/index-foreman-el.html#Creating_Hosts_with_PXE_less_Provisioning_provisioning

1 Like