Testing a DHCP server with dhcpperf

dhcpperf is a DHCP load testing tool.

Let’s copy the link to dhcpperf on the official website https://www.ncad.co.jp/~prodhcp/download.html
For example, I will download dhcpperf for CentOS8 and install:

wget https://www.ncad.co.jp/~prodhcp/dhcpperf/dhcpperf-0.3.6.el8.x86_64.rpm
rpm -ivh dhcpperf-0.3.6.el8.x86_64.rpm

You can also download from here:

wget https://files.ixnfo.com/Soft/Network/DHCP/dhcpperf-0.3.6.el8.x86_64.rpm

In my case, the following files were unpacked:

/usr/bin/dhcpperf
/usr/share/ncad/dhcpperf/expand.dat
/usr/share/ncad/dhcpperf/discover.dat
/usr/share/ncad/dhcpperf/release.dat
/usr/share/ncad/dhcpperf/request.dat

Default file contents:

/usr/share/ncad/dhcpperf/expand.dat
Hops=0
Secs=0
Broadcast=0
Ciaddr=@auto
Yiaddr=0.0.0.0
Siaddr=0.0.0.0
Giaddr=0.0.0.0
Chaddr=@auto
Sname=""
File=""
53=DHCPREQUEST
54=@auto
55=1,3,6,15
50=@offer
61=@auto
12="dhcpclient"

nano /usr/share/ncad/dhcpperf/discover.dat
Hops=0
Secs=0
Broadcast=@auto
Ciaddr=0.0.0.0
Yiaddr=0.0.0.0
Siaddr=0.0.0.0
Giaddr=@auto
Chaddr=@auto
Sname=""
File=""
12="dhcpperf"
53=DHCPDISCOVER
54=@auto
55=1,3,6,15
61=@auto

nano /usr/share/ncad/dhcpperf/release.dat
Hops=0
Secs=0
Broadcast=@auto
Ciaddr=@auto
Yiaddr=0.0.0.0
Siaddr=0.0.0.0
Giaddr=@offer
Chaddr=@auto
Sname=""
File=""
12="dhcpperf"
53=DHCPRELEASE
54=@auto
55=1,3,6,15
50=@auto
61=@auto

nano /usr/share/ncad/dhcpperf/request.dat
Hops=0
Secs=0
Broadcast=@auto
Ciaddr=0.0.0.0
Yiaddr=0.0.0.0
Siaddr=0.0.0.0
Giaddr=@auto
Chaddr=@auto
Sname=""
File=""
12="dhcpperf"
53=DHCPREQUEST
54=@auto
55=1,3,6,15
50=@offer
61=@auto

View quick help:

dhcpperf -h

Startup example (where 192.168.24.1 is the address of the DHCP server or DHCP Relay agent, eth0 is the network interface through which requests will be sent, -v displays statistics):

dhcpperf -v -s 192.168.24.1 eth0

An example of running a DHCP test using the scenario data:

dhcpperf -v eth0 ./discover.dat ./request.dat ./release.dat

dhcpperf -v eth0 /usr/share/ncad/dhcpperf/discover.dat /usr/share/ncad/dhcpperf/request.dat /usr/share/ncad/dhcpperf/release.dat

mkdir /root/dhcpperf/
cp /usr/share/ncad/dhcpperf/expand.dat /root/dhcpperf/
cp /usr/share/ncad/dhcpperf/discover.dat /root/dhcpperf/
cp /usr/share/ncad/dhcpperf/release.dat /root/dhcpperf/
cp /usr/share/ncad/dhcpperf/request.dat /root/dhcpperf/
cd /root/dhcpperf/
dhcpperf -v eth0 discover.dat request.dat release.dat

Running DHCP Relay test using scenario data:

dhcpperf -v -s 192.168.24.1 eth0 ./discover.dat ./request.dat ./release.dat

Testing lease renewals:

dhcpperf -v -s 192.168.24.1 eth0 discover.dat request.dat expand.dat release.dat

Official documentation – https://www.ncad.co.jp/~prodhcp/dhcpperf/readme-en.html

See also my articles:
What is DHCP and how does it work?
Installing and Using dhcpdump

Leave a comment

Leave a Reply