tags:

views:

373

answers:

1

I am building a dhcp client using C on Ubuntu 9.04. Now I send a dhcp release to the dhcp server, it sends no ack as expected. I was wondering if it sends any DHCP NAK if any of the parameters are wrong.

There is one more problem. After sending DHCP Release my internet is still working. Also when I do ifconfig it still shows the ip address of eth0. But when I do dhclient -r internet does not work and ifconfig does not show the ip address of eth0.

+1  A: 

Are you using tcpdump to inspect the packet traffic while you debug the handshake? That should show you if your server's implementation sends a NAK. RFC 2123: Dynamic Host Configuration Protocol indicates that there is a DHCPNAK.

DHCPNAK -- Server to client indicating client's notion of network address is incorrect (e.g., client has moved to new subnet) or client's lease as expired.

Ewan Todd
or wireshark formerly ethereal, http://www.wireshark.org/ if you are inclined to use a GUI. Hope this helps, Tom.
tommieb75