NIC IP rebind on Desktop RRS feed

  • Question

  • I'm trying to set static IP address on a NIC Card and notify it about the change. I use registry method to set the IP information. But without Restarting PC or Disable, Enabling adapter IP change is not reflecting. I don't want to try some undocumented API like SetAdapterIPAddress or similar.

    Using DeviceIoControl() with IOCTL_NDIS_REBIND_ADAPTER it is possible to rebind IP information on a WinCE device. Is there something similar available for Desktop application ?. 

    ◄◄ hypheni ►►

    Friday, November 30, 2012 6:07 AM


All replies

  • Hi,

    Use CreateUnicastIpAddressEntry() for changing the IP address. It can use in desktop applications and also in kernel-mode.

    BR, Antti

    Friday, November 30, 2012 9:42 AM
  • From MSDN:

    The CreateUnicastIpAddressEntry function is defined on Windows Vista and later.

    The CreateUnicastIpAddressEntry function is used to add a new unicast IP address entry on a local computer. The unicast IP address added by the CreateUnicastIpAddressEntry function is not persistent.

    All IP helper functions are not ideal for setting IP address and store permanently. And of course I need to implement it for supporting >= Win XP

    ◄◄ hypheni ►►

    • Edited by hypheni Friday, November 30, 2012 5:30 PM
    Friday, November 30, 2012 5:29 PM
  • I forgot to mention netsh in my exclude list. I'm searching for the way same as explorer while changing IP for a NIC. Till now I couldn't find it out. May be someone know the trick. 

    ◄◄ hypheni ►►

    Sunday, December 2, 2012 9:27 AM