DHCP

From Indie IT Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Fix Duplicate UID Lease Error

Error...

dhcpd: uid lease 192.168.0.88 for client 40:83:de:b9:7e:3f is duplicate on 192.168.0.0/24

Fix...

Check to make sure that you do not have matching MAC address in your configuration file AND the leases files...

grep -c '40:83:de:b9:7e:3f' /etc/dhcp/dhcpd.conf /var/lib/dhcp/dhcpd.leases*

Stop the DHCP server...

service isc-dhcp-server stop

Clear the leases files...

cd /var/lib/dhcp
rm dhcpd.leases*

Start the DHCP server...

service isc-dhcp-server start

(Optional - fix the directory and file permissions and ownership for isc-dhcpd-4.2.4)

chmod g+w /var/lib/dhcp && chown -R dhcpd:dhcpd /var/lib/dhcp

Fix Big Leases File

https://www.reddit.com/r/networking/comments/5h1bej/isc_dhcp_lease_file_too_big/

https://bugs.launchpad.net/ubuntu/+source/isc-dhcp/+bug/1186662

https://help.ubuntu.com/community/isc-dhcp-server

Find DHCP Server On Network

IPV4

sudo nmap --script broadcast-dhcp-discover -e <network-interface>

IPV6

sudo nmap --script broadcast-dhcp6-discover -e <network-interface>

Thanks to Superuser.

sudo nmap -sU -p 67 --open 192.168.1.0/24

https://www.unix.com/ip-networking/171195-dhcp-server-discover.html

Monitor DHCP Traffic From Command Line

sudo tcpdump -i <network-interface> port 67 or port 68 -e -n

http://ask.xmodulo.com/monitor-dhcp-traffic-command-line-linux.html

Monitor Logs

sudo journalctl -u dhcpd.service -f

https://www.shellhacks.com/journalctl-tail-service-logs-systemd-journal/

HOWTO: VLANS

https://www.ossramblings.com/using-multiple-vlan-with-dhcp-ubuntu

https://community.spiceworks.com/topic/1331562-isc-dhcp-server-for-multiple-vlans

HOWTO: FIX: DNSMasq DHCP Server With UFW

 sudo ufw allow from any port 68 to any port 67 proto udp

HOWTO: List Leases On The Command Line

egrep "lease|hostname|hardware|\}" /var/lib/dhcp/dhcpd.leases

or

egrep "lease|hostname|hardware|\}" /var/lib/dhcpd/dhcpd.leases

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

LTSP and Vendor Classes

set vendor-string = option vendor-class-identifier;

http://chrisjrob.com/2009/04/14/determine-vendor-class-identifier/#comment-3962986253