One requirement for testing a DHCP server is that the DHCP client is using a different MAC address than the DHCP server (or in other scenarios, a different mac address than the existing client network interface if that interface is already receiving a lease from the same DHCP server). One could grab a notebook to test DHCP or set up a virtual machine, but the easiest way to accomplish this is to use a virtual interface which provides a unique mac address. This is the tricky part because Linux interface aliases and virtual interfaces use the mac address of their hardware interface. The solution is to create a macvlan0 interface using “ip link”.
ip link add dev macvlan0 link eth0 type macvlan
Comment out the request section in /etc/dhclient.conf and use the following request section if you do not want to update your default gateway and DNS settings (e.g. when just testing DHCP communications on a productive machine without changing existing network settings):
request subnet-mask, broadcast-address, interface-mtu;
dhclient -v macvlan0
tcpdump -lenx -i eth0 -s 1500 port bootps or port bootpc -t -vvv
ip link delete dev macvlan0