title: How to request a particular IP address from the DHCP Server?
body: <p>I'm trying to request a specific IP address from a <a href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol" rel="nofollow">DHCP server</a>.</p>
  
  <p>My understanding is that I should be able to do this, if the server supports the  DHCP_REQUESTED_IP request in the initial DHCP_DISCOVER message.</p>
  
  <p>Here's the code I have that isn't working:</p>
  
  <pre><code> ip_addr_copy(&amp;dhcp-&gt;msg_out-&gt;ciaddr , "0xc0a80014" );
   dhcp-&gt;msg_out-&gt;yiaddr.addr = 0xc0a801e0 ;
  
   dhcp_option(dhcp, DHCP_OPTION_REQUESTED_IP, 4);
   dhcp_option_long(dhcp, htonl(0xc0a80176));
   dhcp_option_long(dhcp, htonl(0xc0a801e0));
   dhcp_option(dhcp, DHCP_OPTION_SERVER_ID, 4);
   dhcp_option_long(dhcp, htonl(0xc0a80164));
   dhcp_option_long(dhcp, htonl(0xc0a80101));
  
   dhcp_option(dhcp, DHCP_OPTION_PARAMETER_REQUEST_LIST, 4/*num options*/);
  </code></pre>