none
Can I turn off the WinCE DHCP server so it always uses zeroconfig? RRS feed

  • Question

  • We have some legacy WinCE devices (WinCE4.2 and 5) that have been working fine for years when they were on a closed ethernet network. But now we're trying to get them to work nicely with other devices and it's failing when there's a DHCP server on the network.

    The problem is that in order to speed up the boot the original engineers set "DhcpEnableImmediateAutoIP" in the registry. This effectively turns off the timeout where WinCE waits for a while before deciding that there's no DHCP server and does a zeroconfig. But because it doesn't actually turn off the DHCP request it allocates an IP address using zeroconfig then screws up when it gets a second IP address from the DHCP server a few seconds later.

    I can see that "DhcpEnableImmediateAutoIP" is one of several keys controlling the DHCP, so I was wondering what would happen if I just set "EnableDHCP" to 0? Does this turn off the DHCP request so it just does a zeroconfig, or does it turn off the zeroconfig as well so it never gets an IP address?

    Is there any other way of doing this?

    Tuesday, June 26, 2012 5:19 PM

All replies

  • EnableDHCP turns off DHCP and then assumes static IP settings (so you need to provide ip address, subnet mask and optionally gateway/dns).

    Here are all the options you can set:

    http://msdn.microsoft.com/en-us/library/ms884977.aspx


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Tuesday, June 26, 2012 9:32 PM
    Moderator
  • It's not clear to me what do you want to do between the following:

    1. Obtain an IP address from a DHCP server
    2. Obtain an IP address from a DHCP server or use autoconfig if there's no DHCP server
    3. Use IP autoconfig regardless of the presence of a DHCP server
    4. Use a static IP


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    Monday, July 2, 2012 7:04 AM
  • Option 3. DHCP and Zeroconfig seem to be part of the same feature, I'm not sure how to turn off DHCP without switching to a static IP address (which I don't want).

    Monday, July 2, 2012 2:16 PM
  • I'm not sure that you can achieve 3 out of the box: DHCP and autoconfig are intimately tied, being autoconfig used to keep the devices on the network and allowing them to communicate even if the DHCP server is not available. But this assumes that the scenario includes a DHCP server. In your first installation the thing worked because you have no server at all so the periodic DHCPdiscover requests by the clients fell into nothing while now they got back a DHCPoffer which are happy to get.

    If you disable DHCP with "EnableDHCP" set to 0 you will disable also autoconfig leaving the only option of the static IP which you don't want.

    I do not understand while having the IP address from the DHCP server is a problem but if this is not solvable I have only two things on the top of my head:

    Keeping DhcpEnableImmediateAutoIP, set the highest possible value for the AutoInterval : REG_DWORD registry entry which specifies the time interval, in seconds, used to verify if a DHCP server is available. This value is internally multiplied * 1000 to have it in msec so the max value you can set without wrapping corresponds to ~49 days. If the device is always on you'll end after that period in having everything screwed up anyway though...

    A definitive solution may be cloning the DHCP client (D:\WINCE600\PRIVATE\WINCEOS\COMM\DHCP) and modify it in order not to send the discover packet, for example stubbing someway the function which is periodically called when the AutoInterval timer elapses


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com

    Monday, July 2, 2012 3:19 PM