Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1058673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:03:31+00:00 2026-05-16T18:03:31+00:00

IMPORTANT EDIT: Back again on this subject. As you said there should be no

  • 0

IMPORTANT EDIT: Back again on this subject.
As you said there should be no default NIC, I’m trying to understand if there is a way to detect all the NICs that are actually connected.

Having the MAC address of my physical interface is there a programmatic way to get interface name/interface status/etc…

For example, my XP machine:

Device Realtek RTL8139 Family PCI Fast Ethernet NIC
MAC XXXX-XXXX-XXXX

XXXX-XXXX-XXXX is what I know

Through this device I connect using “Local Area Connection” connection (with all the info related as gateway, subnet, …)

So I’m searching for the link between XXXX-XXXX-XXXX and Local Area Connection.

Hope everything is clear now.

Thanks all!
P.S. Sorry for the delay… +1 vote to all, for patience!


Old question


Hi all,
I’d like to change the IP of “Local Area Connection” by using the command netsh.

My issue is is there a programmatic way to get the default connection name (i.e. exactly “Local Area Connection”)?

Thanks

EDIT: I don’t need the list of all the connection names but only the default one. Accessing the registry I get the list and it seems that the default is marked with a *.
Unfortunately, printing them on a console I get kind of 10 different “Local Area Connection” like…

Local Area Connection* 13
6TO4 Adapter
VMware Network Adapter VMnet1
Wireless Network Connection 2
Reusable ISATAP Interface {483968F2-DBF9-4596-B8BE-725FAAB89F93}
Local Area Connection* 3
Local Area Connection* 2
Reusable Microsoft 6To4 Adapter
Local Area Connection* 7
VMware Network Adapter VMnet8
Local Area Connection* 8
isatap.replynet.prv
Local Area Connection* 9
Local Area Connection* 12
isatap.{FAA80CE0-D641-408A-83F8-5F9C394FFD76}
Bluetooth Network Connection
Local Area Connection* 4
isatap.{40156BF9-6599-4912-A315-62DE5342B452}
isatap.{7651F2F5-4888-4258-92C5-6822C506D726}
Local Area Connection* 5
isatap.{34F5F074-8AA7-4421-AE24-131BA2DC3458}
Local Area Connection*
Local Area Connection* 10
Local Area Connection
Local Area Connection* 6
Wireless Network Connection

and so on…

EDIT2: @ho1 running your code changing FriendlyName that doesn’t exists with Name you’ll get something like the list behind, unfortunately it doesn’t seem to be the output expected

0 - WAN Miniport (SSTP)
1 - WAN Miniport (IKEv2)
2 - WAN Miniport (L2TP)
3 - WAN Miniport (PPTP)
4 - WAN Miniport (PPPOE)
5 - WAN Miniport (IPv6)
6 - WAN Miniport (Network Monitor)
7 - Realtek RTL8168C(P)/8111C(P) Family PCI-E Gigabit Ethernet NIC (NDIS 6.20)
8 - WAN Miniport (IP)
9 - Microsoft ISATAP Adapter
10 - RAS Async Adapter
11 - Broadcom 802.11g Network Adapter
12 - Microsoft 6to4 Adapter
13 - VMware Virtual Ethernet Adapter for VMnet1
14 - Microsoft ISATAP Adapter #3
15 - VMware Virtual Ethernet Adapter for VMnet8
16 - Microsoft ISATAP Adapter #2
17 - Microsoft ISATAP Adapter #4
18 - Microsoft Virtual WiFi Miniport Adapter
19 - Microsoft ISATAP Adapter #5
20 - Microsoft ISATAP Adapter
22 - Bluetooth Device (Personal Area Network)
23 - Microsoft 6to4 Adapter
24 - Microsoft 6to4 Adapter #3
25 - Microsoft 6to4 Adapter #2
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:03:31+00:00Added an answer on May 16, 2026 at 6:03 pm

    This is a dirty way of doing it as it can be optimized by incorporating LINQ, etc

    using System.Net.NetworkInformation;
    
    List<NetworkInterface> Interfaces = new List<NetworkInterface>();
    foreach (var nic in NetworkInterface.GetAllNetworkInterfaces())
    {
        if (nic.OperationalStatus == OperationalStatus.Up)
        {
            Interfaces.Add(nic);
        }
    }
    
    
    NetworkInterface result = null;
    foreach (NetworkInterface nic in Interfaces)
    {
        if (result == null)
        {
            result = nic;
        }
        else
        {
            if (nic.GetIPProperties().GetIPv4Properties() != null)
            {
                if (nic.GetIPProperties().GetIPv4Properties().Index < result.GetIPProperties().GetIPv4Properties().Index)
                    result = nic;
            }
        }
    }
    
    Console.WriteLine(result.Name);
    

    you’ll probably want to tailor your results by using the results from nic.GetIPProperties() and nic.GetIPProperties().GetIPv4Properties()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit: This was accidentally posted twice. Original: VB.NET Importing Classes I've seen some code
Important: This question isn't actually really an ASP.NET question. Anyone who knows anything about
What is the most important features a IOC container should contain? You can easily
There are important features of Emacs which are missing in Vim, such as the
I'm trying to understand REST. Under REST a GET must not trigger something transactional
Unsure if this should be on here or serverfault so apologies if I'm wrong.
I'm trying to edit configuration file in Java. What I really need to do
There are a few questions that approach an answer to this question, but none
This problem drives me crazy. I miss some basic but very important knowledge about
How important is it to make a website layout fit on 640 x 480

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.