none
Configure IPv6 for Windows using C# for disabled Adapter RRS feed

  • Question

  • I need to set the adapter configuration using C#.

    I have tried to set IPv6 address using ManagementObject (WMI) but it is not reflected. I used netsh command for setting IPv6 address and it is working fine for the adapters which is enabled.

    For disabled adapter, netsh command is not able to apply the IPv6 address and it returns the message "Element not found."

    Please help me, How to set the IPv6 address for the disabled adapters.?

    Whether there is any API available for these operations.?

    Friday, January 11, 2019 3:32 PM

All replies

  • Hi Navaneethapperumal,

    Thank you for posting here.

    According to your description, you want to set the IPV6 address for the disabled adapter in c#. For this issue, I’d like to provide some suggestions.

    1. You could not set the IPV6 address for the disabled adapter because it will be emptied in the disabled adapter.

    2. I suggest that it’s best for you to set the IPV6 address in the enabled adapter.

    Hope my solution could help you.

    Best regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 14, 2019 8:40 AM
    Moderator
  • Hi Jack J Jun,

    Thank you for your reply.

    I have a requirement to configure IP addresses (i.e., both IPv4 and IPv6) for connected/disconnected and disabled adapters using C#.

    For IPv4, we can make it through MangementObject (WMI Query). But for IPv6, MangementObject is not working as expected.

    Please let me know any solutions.
    Monday, January 14, 2019 12:15 PM
  • Hi Navaneethapperumal,

    Thanks for your feedback.

    Based on my search, I could find the way to set IP address for enabled adapters instead of disabled adapters. It is best for you to set the IP address for disabled adapters manually. You will find it does not work.Therefore, I suggest that you could choose the enabled disabled adapter to test it.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 29, 2019 8:21 AM
    Moderator