Windows 10 is not honoring DHCP vendor option for interface metric

Robert Murrell 0 Reputation points
2024-11-22T20:13:51.9566667+00:00

I asked this question in the Microsoft Community forum and they suggested I repost it here.

We manufacture a product that has an Ethernet interface with built in DHCP and DNS servers. When connected to a Windows 10 PC, it starts blasting the device with DNS requests. If the PC is connected to the Internet via WiFi, all internet communications fail because the device does not have internet access. I understand this is due to the default interface metrics settings. Wired Ethernet gets a metric setting of 25 and WiFi of 50. When I manually set the interface metrics of the Ethernet interface to 9999, all works well.

To prevent our customers from have to manually set the interface metrics, I configured the device DHCP server to send the Microsoft vendor-specific option to set the metric to 9999:

Vendor Class "MSFT 5.0"

Vendor code 3, length 4, value 9999

I can see the vendor fields being received in the DHCPACK packet using Wireshark. But the setting is not being honored. I check this by running this Powershell command I found on the web:

Get-NetIPInterface | Select-Object -Property InterfaceAlias, InterfaceMetric | Sort-Object -Property InterfaceMetric

The device is running Linux and uses either dhcpd or dnsmasq. Here are excerpts from their configuration files:

dnsmasq:

interface=usb0

domain=qpm,172.23.166.0/24

address=/qpm/172.23.166.1

dhcp-range=usb0,172.23.166.100,172.23.166.254,255.255.255.0,12h

dhcp-option=option:router,172.23.166.1

dhcp-option=vendor:MSFT 5.0,3,9999i

dhcpd:

option space MS;

option MS.metric code 3 = unsigned integer 32;

class "MSFT 5.0" {

match if option vendor-class-identifier = "MSFT 5.0";

vendor-option-space MS;

option MS.metric 9999;

}

How do I get Windows 10 to honor the DHCP metric setting?

Windows DHCP
Windows DHCP
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.DHCP: Dynamic Host Configuration Protocol (DHCP). A communications protocol that lets network administrators manage centrally and automate the assignment of Internet Protocol (IP) addresses in an organization's network.
1,044 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jing Zhou 7,675 Reputation points Microsoft Vendor
    2024-11-25T23:27:29.7066667+00:00

    Hello,

     

    Thank you for posting in Q&A forum.

    To further troubleshoot this issue, please kindly try below steps:

    1.Check if DHCP server configuration is correct and that it is sending the vendor-specific option properly.

    2.Capture a network trace by wireshark or network monitor and check if the vendor-specific option is indeed being sent correctly.

    3.Uncheck automatic metric and set the Interface metric to 9999 in network adapter properties manually on Windows 10 to test if issue is resolved.

     

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

     

    Best regards,

    Jill Zhou

     


    If the Answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.