none
Retrieving the information “Obtain an IP address automatically”

    Question

  • Hello,

    I'm writing a program in C#, .Net 2.0, that should work on XP, Seven, 8.

    I would like to capture the adapter settings of a PC, including Ipv6 settings.

    What is the best way for achieving this goal: System.Net.NetworkInformation, WMI, reading info in the registry ?

    Especially, I'm interested in retrieving the information “Obtain an IP address automatically”.

    I was thinking of using propertiesIPv4.IsDhcpEnabled. Is it the correct property ?

    Why don't we have the equivalent properties for class IPv6InterfaceProperties ?

    Thanks in advance.

    Pierre Gasnier

    Friday, March 14, 2014 9:26 AM

Answers

  • Hi,

    >>What is the best way for achieving this goal: System.Net.NetworkInformation, WMI, reading info in the registry ?

    For more information, please try to refer to:
    #Finding IP Address Information:
    http://www.codeproject.com/Articles/5657/Finding-IP-Address-Information.
    #VB/WMI script to read remote registry to get IP address information:
    http://myitforum.com/myitforumwp/2011/12/23/vbwmi-script-to-read-remote-registry-to-get-ip-address-information/ .

    >>I was thinking of using propertiesIPv4.IsDhcpEnabled. Is it the correct property ?

    IPv4InterfaceProperties.IsDhcpEnabled indicates whether the interface is configured to use a Dynamic Host Configuration Protocol (DHCP) server to obtain an IP address.

    DHCPv4 could not support IPv6 with just a few minor changes, because DHCPv4 is very dependent on broadcast, which does not exist in IPv6. Also, most IPv6 nodes get their default gateway via SLAAC, so do not need to get it from DHCP. Soon, nodes will also get the IPv6 addresses of DNS via SLAAC (RFC 6106), so there will be even less need for DHCPv6. If you look at the protocols, you can see that DHCPv6 was based on DHCPv4, but using multicast instead of broadcast, and there is no way to configure or provide the default gateway. If DHCPv6 included the ability to provide the default gateway, it would be easier to do configuration without SLAAC.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 17, 2014 2:52 AM