Windows network device driver: set network interface name

488 Views Asked by At

I am writing a network device driver for Windows. I have got the driver working but it shows up as generic Ethernet 2 in both ipconfig output and in Control Panel>Network Adapters. How do I set the interface name to a custom name from within the driver code? I do not want to do it from user level tools.

ipconfig output:

Ethernet adapter Ethernet 2:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::b5d1:2ce1:3e7c:5aa7%18
   Autoconfiguration IPv4 Address. . : 169.254.90.167
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . :

Network Adapters GUI screenshot: Control Panel>Network Adapters

1

There are 1 best solutions below

2
On

Windows does not have any feature for a NIC driver to name itself.

Naming is a bit more complicated than it looks:

  • Windows localizes the name into the user's language and in some cases, automatically updates the name if the system locale changes.
  • In one legal jurisdiction, the OS implements special government-mandated naming rules.
  • When using the "Consistent Device Naming" feature, Windows incorporates the PCI bus topology into the network interface's name.
  • In the future, we may implement new naming features, like allowing the administrator to name all NICs after their MAC addresses.

Allowing the NIC driver to directly assign its own name would undermine the OS's ability to deliver features like those.

Source: I wrote the OS code to determine the name that is assigned to a newly-installed network interface.

Maybe there's another way to solve this problem? What is the ultimate problem you want to solve? (Stack Overflow isn't a discussion board, so an in-depth discussion with back-and-forth is difficult here. Many Windows driver developers hang out on the OSR forum instead.)