Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird network devices

I am using NetworkInformation namespace to list all the network devices.

NetworkInterface.GetAllNetworkInterfaces();

When I get the list, there are some weird unknown devices:

enter image description here

What are they? And should I, and if, then how, get rid of them? In theory it should show only Local Area Connection and Wireless Connection. Under Network Connections I can't find anything like that installed either.

like image 496
Badr Hari Avatar asked Jan 23 '26 05:01

Badr Hari


1 Answers

Windows has network 'devices' that don't exist in terms of physical hardware - they're used for various things, such as VPN connections (like that tunneling pseudo interface) and the loopback adapter, which is what responds to 127.0.0.1

You can parse the non-physical addresses by using WMI to query the list of adapters instead,

using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(new SelectQuery("Win32_NetworkAdapter")))
{
    foreach (ManagementObject mo in searcher.Get())
    {
        if ((bool)mo["PhysicalAdapter"])
            Console.WriteLine(mo["Name"]);
    }
}

(taken from MSDN)

That'll only return physical devices, as you're casting the true/false value of the PhysicalAdapter property as bool.

like image 76
dotalchemy Avatar answered Jan 25 '26 18:01

dotalchemy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!