How to send NAK to specific mac/ip

I was under impression that when dhcp lease times out dhcp server will send NAK to client. So I set up 5min lease time for one client but client's dhcp does not receive NAK.

I am using openwrt as a "lab" to test client's dhcp behaviour, so I need openwrt to send NAK to client.

What I did so far:

/etc/config/dhcp

config host
	option name 'test-ottt'
	list mac '68:98:61:03:45:76'
	option ip '192.168.1.133'
	option leasetime '5m'

And observed with tcpdump on openwrt:

tcpdump -i br-lan port 67 or port 68 -vv

But I don't see any NAK: I see ACK in tcpdump meaning I'm not doing it right.

EDIT:
I see that's the correct behaviour actually... so my task now would be to somehow make a misconfiguration for this specific client so it will receive NAK?

Nope... NAK is only sent in response to a request from the client.

Why? The client is probably going to ignore it, since it is not an answer to a request it made.

Perhaps you should explain first what issue you are trying to fix, instead of going around possible solutions...

5 Likes

Usually after half of the lease time expires a client will try and RENEW the lease. That is the first opportunity the server has to send a NAK after which a client should stop using the current address and do a new DISCOVER.

So with a 5min lease after 2.5 minutes the client will try and RENEW and if successful gets a 5 min lease on the address.

1 Like