DHCP client not working

Simon Hobson dhcp1 at thehobsons.co.uk
Wed Jul 6 11:09:02 UTC 2011

Kishore Kumar Kakarla wrote:

>DHCPv4 client package has been modified to use sockets by defining 
>USE_SOCKETS in site.h of the includes directory so that it works for 
>ppp interface.
>Now when I run dhcp client it is sending DHCP DISCOVER messages, 
>server is responding with a new IP address, which is coming to the 
>m/c (tcpdump report) but DHCP client is not taking the address and 
>assigning to the interface.
>On the machine I have multiple interfaces. I am running DHCP client 
>on eth1 interface and when I see the tcpdump request I see it is 
>going as where is IP address of 
>another interface eth0. DHCP server is responding with new IP 
>When I run DHCP client with USE_SOCKETS disabled the request is 
>going as and server is responding, IP is assigned 
>to eth1 interface.
>Could someone let me know the reason why the request is going with 
> and is this the reason why DHCP client is not 
>accepting IP address for eth1 interface?

This is very, very similar to the query you asked three hours 
earlier, and clearly you did not take note of the reply from Steinar 

You have configured the client to use sockets - this DISABLES CERTAIN 
ESSENTIAL FUNCTIONALITY without which the client cannot work properly 
on a broadcast medium (eg ethernet). A key part of the now missing 
functionality is that the client cannot properly handle broadcast 

So in answer to your specific query, I believe the reason the client 
is using the address of another interface as the packet source 
address is that the client is being forced to send packets via the 
kernel IP stack - which is filling in a source address.

This is almost certainly a red-herring since I believe the server 
and/or relay-agent will use other fields within the packet and NOT 
the apparently source address in the packet header. The bigger issue 
is that the client cannot receive the broadcast response from the 
server/relay-agent because you've removed it's ability to deal with 
broadcast packets.

What you will need to do it run two DIFFERENT clients. One with 
use_sockets turned on to work on a PPP interface, and another 
configured with it turned off so it will work on an ethernet 

Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

More information about the dhcp-users mailing list