A hacky (but effective) way to debug dhclient on many Linux platforms is to enable bash tracing in /sbin/dhclient-script.
dhclient runs that script on most OS variants I've checked (RedHat, Debian, etc).
Simply adding -x
to the shebang (first line) in that script should enable tracing each line to console, eg:
#!/bin/bash -x
Then you can run, for example
dhclient -r #release lease
dhclient #re-acquire lease
And you should see lots of output, not only from dhclient-script, but from all the included .d
scripts in /etc/dhcp*.
The trace output should allow you to figure out what's happening and what decisions the code is making (reference the script itself when looking at the output).
You can usually deduce the inputs (eg parameters including IP, GATEWAY, etc) the script received from this output, but if not, you can temporarily add something like this to the script just before the exit:
env | logger -t dhclient-debugging
Then check your log after running dhclient (/var/log/messages or /var/log/syslog)