Need help in configuring DHCP sever

I have installed Rocky 8.5 and currently struggling to setup the DHCP server for multiply NIC’s.

My “server” is a plain vanilla desktop PC with 3 interface cards.

1 on the motherboard and the other two in expansion slots. This PC will be the head node for my Warewulf cluster.

Any help will be welcomed.

Assuming you are using the dhcp-server package, your subnet blocks will need interface designations. Otherwise what happens is dhcpd will listen on all ports.

subnet 10.100.0.0 netmask 255.255.255.0 {
        interface                  br1000; ## Right here
        option routers             10.100.0.1;
        option domain-name-servers 10.100.0.1, 10.100.0.231;
        option domain-name         "example.com";
        option subnet-mask         255.255.255.0;
        range                      10.100.0.110 10.100.0.199;
        ## EFI Client Catch
        class "pxeclients" {
                match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
                if option pxe-system-type = 00:02 {
                        filename "elilo.efi";
                } else if option pxe-system-type = 00:07 {
                        #filename "shim.efi";
                        filename "boot/grub2/x86_64-efi/core.efi";
                } else if option pxe-system-type = 00:08 {
                        #filename "shim.efi";
                        filename "boot/grub2/x86_64-efi/core.efi";
                } else if option pxe-system-type = 00:09 {
                        #filename "shim.efi";
                        filename "boot/grub2/x86_64-efi/core.efi";
                } else if option pxe-system-type = 00:0a {
                        filename "armv7.efi";
                } else if option pxe-system-type = 00:0b {
                        filename "grubaa64.efi";
                } else {
                        #filename "pxelinux.0";
                        filename "boot/grub2/i386-pc/core.0";
                }
        }
        default-lease-time 21600;
        max-lease-time     43200;
        next-server        10.100.0.1;
}

A bigger example using multiple interfaces (in my case, two bridges being served two different subnets):

ddns-update-style interim;

allow booting;
allow bootp;
authoritative;;
log-facility local6;

ignore client-updates;
set vendorclass = option vendor-class-identifier;

## Allowing EFI Clients
option pxe-system-type code 93 = unsigned integer 16;
option rfc3442-classless-static-routes code 121 = array of integer 8;
option ms-classless-static-routes code 249 = array of integer 8;

option space pxelinux;
option pxelinux.magic code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;
option architecture-type code 93 = unsigned integer 16;

option pxelinux.mtftp-ip    code 1 = ip-address;
option pxelinux.mtftp-cport code 2 = unsigned integer 16;
option pxelinux.mtftp-sport code 3 = unsigned integer 16;
option pxelinux.mtftp-tmout code 4 = unsigned integer 8;
option pxelinux.mtftp-delay code 5 = unsigned integer 8;

subnet 10.100.0.0 netmask 255.255.255.0 {
        interface                  br1000; ## Right here
        option routers             10.100.0.1;
        option domain-name-servers 10.100.0.1, 10.100.0.231;
        option domain-name         "example.com";
        option subnet-mask         255.255.255.0;
        range                      10.100.0.110 10.100.0.199;
        ## EFI Client Catch
        class "pxeclients" {
                match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
                if option pxe-system-type = 00:02 {
                        filename "elilo.efi";
                } else if option pxe-system-type = 00:07 {
                        #filename "shim.efi";
                        filename "boot/grub2/x86_64-efi/core.efi";
                } else if option pxe-system-type = 00:08 {
                        #filename "shim.efi";
                        filename "boot/grub2/x86_64-efi/core.efi";
                } else if option pxe-system-type = 00:09 {
                        #filename "shim.efi";
                        filename "boot/grub2/x86_64-efi/core.efi";
                } else if option pxe-system-type = 00:0a {
                        filename "armv7.efi";
                } else if option pxe-system-type = 00:0b {
                        filename "grubaa64.efi";
                } else {
                        #filename "pxelinux.0";
                        filename "boot/grub2/i386-pc/core.0";
                }
        }
        default-lease-time 21600;
        max-lease-time     43200;
        next-server        10.100.0.1;
}

subnet 10.100.1.0 netmask 255.255.255.0 {
        interface                  br1001;
        option routers             10.100.1.1;
        option domain-name-servers 10.100.0.1, 10.100.0.231;
        option domain-name         "example.com";
        option subnet-mask         255.255.255.0;
        range                      10.100.1.200 10.100.1.254;
        ## EFI Client Catch
        class "pxeclients" {
                match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
                if option pxe-system-type = 00:02 {
                        filename "elilo.efi";
                } else if option pxe-system-type = 00:07 {
                        #filename "shim.efi";
                        filename "boot/grub2/x86_64-efi/core.efi";
                } else if option pxe-system-type = 00:08 {
                        #filename "shim.efi";
                        filename "boot/grub2/x86_64-efi/core.efi";
                } else if option pxe-system-type = 00:09 {
                        #filename "shim.efi";
                        filename "boot/grub2/x86_64-efi/core.efi";
                } else if option pxe-system-type = 00:0a {
                        filename "armv7.efi";
                } else if option pxe-system-type = 00:0b {
                        filename "grubaa64.efi";
                } else {
                        #filename "pxelinux.0";
                        filename "boot/grub2/i386-pc/core.0";
                }
        }
        default-lease-time      21600;
        max-lease-time  43200;
        next-server     10.100.1.1;
}

The dhcp-server has many features, but for simple network dnsmasq is probably sufficient.

This is from config of dnsmasq. One can set multiple domain, interface, and listen-address.

# Ansible managed #
domain-needed
bogus-priv
expand-hosts
domain=admin,10.0.0.0/24,local
interface=admin
listen-address=10.0.0.1
addn-hosts=/etc/ourhosts

# DHCP pool setup
dhcp-range=set:admin,10.0.0.200,10.0.0.240,12h
dhcp-option=tag:admin,option:router,10.0.0.1

One can also set with dhcp-host options predictable (aka static) IP addresses for clients.

The best part is that dnsmasq is both DHCP and DNS server (and TFTP server), so integration of DHCP and DNS (the “ddns-update-style”) is seamless. (With TFTP server enabled one has PXEboot server for easier installs of cluster nodes).

Unfortunately neither option seem to work.

Here is the current error messages.

[root@localhost warewulf]# wwctl configure --all
Enabling and restarting the DHCP services
Job for dhcpd.service failed because the control process exited with error code.
See “systemctl status dhcpd.service” and “journalctl -xe” for details.
[ERROR] : failed to start: failed to run start cmd: exit status 1

root@localhost warewulf]# systemctl status dhcpd.service
● dhcpd.service - DHCPv4 Server Daemon
Loaded: loaded (/usr/lib/systemd/system/dhcpd.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2022-04-09 16:27:33 EDT; 4min 53s ago
Docs: man:dhcpd(8)
man:dhcpd.conf(5)
Process: 3345 ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid $DHCPDARGS (code=exited, status=1/FAILURE)
Main PID: 3345 (code=exited, status=1/FAILURE)

Apr 09 16:27:33 localhost.localdomain dhcpd[3345]: have been made to the base software release in order to make
Apr 09 16:27:33 localhost.localdomain dhcpd[3345]: it work better with this distribution.
Apr 09 16:27:33 localhost.localdomain dhcpd[3345]:
Apr 09 16:27:33 localhost.localdomain dhcpd[3345]: Please report issues with this software via:
Apr 09 16:27:33 localhost.localdomain dhcpd[3345]: https://bugs.rockylinux.org/
Apr 09 16:27:33 localhost.localdomain dhcpd[3345]:
Apr 09 16:27:33 localhost.localdomain systemd[1]: dhcpd.service: Main process exited, code=exited, status=1/FAILURE
Apr 09 16:27:33 localhost.localdomain dhcpd[3345]: exiting.
Apr 09 16:27:33 localhost.localdomain systemd[1]: dhcpd.service: Failed with result ‘exit-code’.
Apr 09 16:27:33 localhost.localdomain systemd[1]: Failed to start DHCPv4 Server Daemon.

Logs:

[root@localhost /]# wwctl server status
Warewulf server is running at PID: 1410
[root@localhost /]# tail /var/log/warewulfd.log
[Sat Apr 9 15:15:58 EDT 2022] Starting HTTPD REST service on port 9873
[Sat Apr 9 15:41:41 EDT 2022] Starting HTTPD REST service on port 9873
[Sat Apr 9 16:14:35 EDT 2022] Starting HTTPD REST service on port 9873
[Sat Apr 9 16:25:20 EDT 2022] Starting HTTPD REST service on port 9873
[root@localhost /]# wwctl server status
Warewulf server is running at PID: 1410

I have the DHCP server up and running. Thanks

Okay, Back to the beginning.

My head node computer , Rocky 8 and Warewulf installed, has the following NIC cards.

  1. enp4S0 - on motherboard - Internet connection 192.168.4.10
  2. enp3so - slot - 10.0.1.0
  3. enp2s0 - slot - 10.0.2.0

I have the DHPCD.conf configured as below.

DHCP Server Configuration file.

see /usr/share/doc/dhcp-server/dhcpd.conf.example

see dhcpd.conf(5) man page

create new

specify domain name

DHCPDARGS-enp2s0;

option domain-name “localhost.localdomain”;

specify DNS server’s hostname or IP address

option domain-name-servers 1.1.1.1, 8.8.8.8;

default lease time

default-lease-time 600;

max lease time

max-lease-time 7200;

this DHCP server to be declared valid

authoritative;

specify network address and subnetmask

subnet 10.0.1.0 netmask 255.255.255.0 {
# specify the range of lease IP address
range dynamic-bootp 10.0.1.40 10.0.1.120;
# specify broadcast address
option broadcast-address 10.0.1.255;
# specify gateway
option routers 10.0.1.1;
filename “pxelinux.0”;

}

With this setting, I can boot the first node, connecting to it 's motherboard nic, and it will find an IPadress. However I receive the following TFTP warnings

  1. PXE-T01
  2. PXE-E3B
  3. PXE -M0F

If I modify the DHCPD.cond file as below I have an IP conflict and my internet connection goes down.

DHCP Server Configuration file.

see /usr/share/doc/dhcp-server/dhcpd.conf.example

see dhcpd.conf(5) man page

create new

specify domain name

DHCPDARGS-enp2s0, enp3s0;

option domain-name “localhost.localdomain”;

specify DNS server’s hostname or IP address

option domain-name-servers 1.1.1.1, 8.8.8.8;

default lease time

default-lease-time 600;

max lease time

max-lease-time 7200;

this DHCP server to be declared valid

authoritative;

specify network address and subnetmask

subnet 10.0.1.0 netmask 255.255.255.0 {
# specify the range of lease IP address
range dynamic-bootp 10.0.1.40 10.0.1.120;
# specify broadcast address
option broadcast-address 10.0.1.255;
# specify gateway
option routers 10.0.1.1;
filename “pxelinux.0”;

subnet 10.0.2.0 netmask 255.255.255.0 {
# specify the range of lease IP address
range dynamic-bootp 10.0.2.40 10.0.2.120;
# specify broadcast address
option broadcast-address 10.0.2.255;
# specify gateway
option routers 10.0.2.1;
filename “pxelinux.0”;
}

When I query for node status it respondes.

[root@localhost warewulf]# wwctl node status
[ERROR] : Could not connect to Warewulf server: Get “http://192.168.200.1:9873/status”: dial tcp 192.168.200.1:9873: i/o timeout

Where is the 192.168.200.1 adddress coming from?

[root@localhost warewulf]# wwctl node list
NODE NAME PROFILES NETWORK

n0000.cluster default default:10.0.1.40
n0001.cluster default default:–
[root@localhost warewulf]#

[root@localhost warewulf]# wwctl node list -a
################################################################################
NODE FIELD PROFILE VALUE
n0000.cluster Id – n0000.cluster
n0000.cluster Comment default This profile is automatically included for each node
n0000.cluster Cluster – (cluster)
n0000.cluster Profiles – default
n0000.cluster Discoverable – true
n0000.cluster Container default rocky-8
n0000.cluster KernelOverride default 4.18.0-348.20.1.el8_5.x86_64
n0000.cluster KernelArgs – (quiet crashkernel=no vga=791)
n0000.cluster SystemOverlay – (wwinit)
n0000.cluster RuntimeOverlay – (generic)
n0000.cluster Ipxe – (default)
n0000.cluster Init – (/sbin/init)
n0000.cluster Root – (initramfs)
n0000.cluster AssetKey – –
n0000.cluster IpmiIpaddr – –
n0000.cluster IpmiNetmask – –
n0000.cluster IpmiPort – –
n0000.cluster IpmiGateway – –
n0000.cluster IpmiUserName – –
n0000.cluster IpmiInterface – –
n0000.cluster default:DEVICE – enp2s0
n0000.cluster default:HWADDR – 00:e0:53:17:8a:2d
n0000.cluster default:IPADDR – 10.0.1.40
n0000.cluster default:IPADDR6 – –
n0000.cluster default:NETMASK SUPERSEDED 255.255.255.0
n0000.cluster default:GATEWAY default 10.0.1.0
n0000.cluster default:TYPE – –
n0000.cluster default:ONBOOT – true
n0000.cluster default:DEFAULT – true
################################################################################
NODE FIELD PROFILE VALUE
n0001.cluster Id – n0001.cluster
n0001.cluster Comment default This profile is automatically included for each node
n0001.cluster Cluster – (cluster)
n0001.cluster Profiles – default
n0001.cluster Discoverable – false
n0001.cluster Container default rocky-8
n0001.cluster KernelOverride default 4.18.0-348.20.1.el8_5.x86_64
n0001.cluster KernelArgs – (quiet crashkernel=no vga=791)
n0001.cluster SystemOverlay – (wwinit)
n0001.cluster RuntimeOverlay – (generic)
n0001.cluster Ipxe – (default)
n0001.cluster Init – (/sbin/init)
n0001.cluster Root – (initramfs)
n0001.cluster AssetKey – –
n0001.cluster IpmiIpaddr – –
n0001.cluster IpmiNetmask – –
n0001.cluster IpmiPort – –
n0001.cluster IpmiGateway – –
n0001.cluster IpmiUserName – –
n0001.cluster IpmiInterface – –
n0001.cluster default:DEVICE – –
n0001.cluster default:HWADDR – –
n0001.cluster default:IPADDR – –
n0001.cluster default:IPADDR6 – –
n0001.cluster default:NETMASK default 255.255.255.0
n0001.cluster default:GATEWAY default 10.0.1.0
n0001.cluster default:TYPE – –
n0001.cluster default:ONBOOT – false
n0001.cluster default:DEFAULT – false

Any help would be appreciated

This isn’t an answer to your entire problem here, but I have to ask related to this:

“Where is the 192.168.200.1 address coming from?”

Is there another DHCP server on the network?

It is the ‘wwctl node status’ command that attempts to use that address. Perhaps the ww config says: “a node will have address 192.168.200.1”? The command obviously fails, as no machine has such address.

The only other DHCP server would be the router between my ISP and head node mother board. 192.168.4.x

It’s not in the warewulf.conf file.

WW_INTERNAL: 43
ipaddr: 10.0.1.10
netmask: 255.255.255.0
network: 10.0.1.0
warewulf:
  port: 9873
  secure: true
  update interval: 60
  autobuild overlays: true
  host overlay: false
  syslog: false
  datastore: ""
dhcp:
  enabled: true
  template: default
  range start: 10.0.1.20
  range end: 10.0.1.99
template: default
  systemd name: dhcpd
tftp:
  enabled: true
  tftproot: /var/lib/tftpboot
  systemd name: tftp
nfs:
  enabled: true
  exports:
	- /home
        - /var/warewulf
  systemd name: nfs-server

I’ve been running a dual NIC dhcp/dns server for years on my home network. I just recently updated it to Rocky 8.5. Here’s the crux of my dhpcd.conf file:

#
# /etc/dhcp/dhcpd.conf
#


# Turn on Dynamic DNS
#ddns-domainname "litterbox.net";
#ddns-update-style interim;
#ddns-updates on;

# Don't allow clients to update DNS, make server do it
# based on the hostname passed by the DHCP client:
#DENY client-updates;
#allow unknown-clients; 

default-lease-time 172800;
max-lease-time 345600;

subnet 192.168.221.0 netmask 255.255.255.0 {
	option routers 192.168.221.1;   
	range 192.168.221.100 192.168.221.150;	
   	option broadcast-address 192.168.221.255;
	option domain-name-servers 192.168.221.11, 208.67.220.220;
        option domain-name "litterbox.net";
	option ip-forwarding off;
}

subnet 192.168.168.0 netmask 255.255.255.0 {
	option routers 192.168.168.1;   
	range 192.168.168.100 192.168.168.150;	
   	option broadcast-address 192.168.168.255;
	option domain-name-servers 192.168.168.11, 208.67.220.220;
	option domain-name "litterscooped.net";
	option ip-forwarding off;
}

# Host reservations
#
#host  {
#hardware ethernet ;
#fixed-address 192.168.x.x;
#}

<.....>

Hope this is of help to you…

Thanks for the information. I reconfigured my dhcp early and it is working. It is similar to yours.

The nodes receive ipaddress on both NICs. Progress!!”

So I think it is working. Now I’m researching TFTP / PXE error codes.

As you can tell, I’m not a network guy. It has been a steep learning curve.

Thanks again.

Jgalt, congratulations! You’re learning…