Setting up DHCPD

dhcpd --version
ifconfig | grep inet

slackware

ls -l /var/log/packages/dhcp-*
ls -lF /etc/dhcpd.conf.example
mv -i /etc/dhcpd.conf /etc/dhcpd.conf.dist
vi /etc/dhcpd.conf

netbsd

mv -i /etc/dhcpd.conf /etc/dhcpd.conf.dist
vi /etc/dhcpd.conf

ubuntu

ls -lF /usr/share/doc/isc-dhcp-server/examples/dhcpd.conf.example
mv -i /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.dist
vi /etc/dhcp/dhcpd.conf

ignore client-identifiers (since v4.2.0) breaks the specification, but prevents sysrescuecd from changing IPs

authoritative;
allow bootp;
allow booting;
ddns-update-style none;
allow unknown-clients;
ignore-client-uids on;

subnet 172.17.0.0 netmask 255.255.0.0 {
}

subnet x.x.x.0 netmask 255.255.255.0 {
        range x.x.x.100 x.x.x.199;

        next-server x.x.x.253;
        if substring (option vendor-class-identifier, 15, 5) = "00007" { #EFI BC (EFI Byte Code)
                filename   "efi64/syslinux.efi";
        } elsif substring (option vendor-class-identifier, 15, 5) = "00009" { #EFI x86-64
                filename   "efi64/syslinux.efi";
        } else {
                filename "bios/pxelinux.0";
                #filename "pxeboot_ia32.bin";
                #filename "pxeboot.bin";
        }

        #option root-path "x.x.x.x:/tftpboot";
        option root-path "/tftpboot";

        #TFTP instead of NFS
        if substring (option vendor-class-identifier, 0, 17) = "NetBSD:i386:libsa" {
                if filename = "netbsd" {
                        filename "tftp:netbsd9/amd64/binary/kernel/netbsd-INSTALL.gz";
                }
        }
}

#allow booting;
#option option-128 code 128 = string;
#option option-129 code 129 = text;

#dhcpd -t -cf /etc/dhcp/dhcpd.conf
dhcpd -t -cf /etc/dhcpd.conf

in case you want your network to get access to the internet,

option routers x.x.x.254;
option domain-name-servers x.x.x.253;
#option domain-name-servers 208.67.222.222, 208.67.222.220;
#option domain-name example.local;
#option domain-search "example.local", "example.net";

enable at boot time on slackware

vi /etc/rc.local

echo -n DHCPD...
dhcpd -q eth0 && echo done
pgrep -a dhcpd

on NetBSD

vi /etc/rc.conf

dhcpd=yes                dhcpd_flags="-q"

POOLS

slackpkg install uthash #slackonly

git clone git://git.code.sf.net/p/dhcpd-pools/code dhcpd-pools
cd dhcpd-pools/
./bootstrap 
./configure
grep ^proc /proc/cpuinfo
make -j4
make install

OPERATIONS

tail -n0 -F /var/log/* /var/log/*/*

START & ENABLE

dhcpd -q NETIF1 NETIF2

STATUS

pgrep -a dhcpd
#grep ^lease /var/state/dhcp/dhcpd.leases | sort -V
dhcpd-pools --config=/etc/dhcpd.conf --leases=/var/state/dhcp/dhcpd.leases --color=always --format=text

crontab -e

0 19 * * * /usr/local/bin/dhcpd-pools --config=/etc/dhcpd.conf --leases=/var/state/dhcp/dhcpd.leases --color=never --format=text

STOP

pkill dhcpd

ACCEPTANCE

from some node on the network

dhclient -v NIC

ADDITIONAL NOTES

#server-name "DHCPserver";
#server-identifier 10.1.1.253;
#max-lease-time 7200;
#default-lease-time 120;
#max-lease-time 120;

#option subnet-mask 255.255.255.0;

TROUBLES

wireshark filter

!arp && !dns && !tcp && !icmp && !ntp

RESOURCES

dhcpd: any way to check dhcp pool status? https://unix.stackexchange.com/questions/39431/dhcpd-any-way-to-check-dhcp-pool-status

Command to list assigned dhcp addresses https://unix.stackexchange.com/questions/91799/command-to-list-assigned-dhcp-addresses/247514#247514

How do I show active dhcp leases https://askubuntu.com/questions/219609/how-do-i-show-active-dhcp-leases

ISC dhcpd lease analysis and reporting http://dhcpd-pools.sourceforge.net/

How do you have dhcpd reload its configuration file? https://kb.isc.org/docs/aa-00335

ISC dhcpd lease analysis and reporting http://dhcpd-pools.sourceforge.net/

options

dhcp-options - Dynamic Host Configuration Protocol options https://netbsd.gw.com/cgi-bin/man-cgi?dhcp-options+5

Options https://wiki.syslinux.org/wiki/index.php?title=PXELINUX#Options

client-identifier

ISC DHCP 4.1 Manual Pages - dhcpd.conf https://kb.isc.org/docs/isc-dhcp-41-manual-pages-dhcpdconf

ISC DHCP 4.1 Manual Pages - dhcpd.leases https://kb.isc.org/docs/isc-dhcp-41-manual-pages-dhcpdleases

Dhcp with known and unknown hosts http://www.macfreek.nl/memory/Dhcp_with_known_and_unknown_hosts

How to reserve dhcp for mac address in another file? https://askubuntu.com/questions/1015658/how-to-reserve-dhcp-for-mac-address-in-another-file

dhcpd.conf - dhcpd configuration file https://manpages.debian.org/unstable/isc-dhcp-server/dhcpd.conf.5.en.html

How do i keep ISC-DHCPD from offering different IPs when there is two requests from the same MAC https://serverfault.com/questions/694351/how-do-i-keep-isc-dhcpd-from-offering-different-ips-when-there-is-two-requests-f

syslinux

DHCP options https://wiki.syslinux.org/wiki/index.php?title=PXELINUX#DHCP_options

efi64

PXELINUX-Multi-Arch https://wiki.syslinux.org/wiki/index.php?title=PXELINUX-Multi-Arch

BIOS and UEFI Co-Existence https://wiki.fogproject.org/wiki/index.php/BIOS_and_UEFI_Co-Existence

[syslinux] RE: DHCP option 93 for UEFI https://www.syslinux.org/archives/2014-October/022683.html

Dynamic Host Configuration Protocol (DHCP) Options for the Intel Preboot eXecution Environment (PXE https://tools.ietf.org/html/rfc4578

DHCP boot options https://community.meraki.com/t5/Security-SD-WAN/DHCP-boot-options/td-p/44536

UEFI Mode PXE Booting Doesn’t Work https://superuser.com/questions/1182862/uefi-mode-pxe-booting-doesnt-work


Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml