Cannot Set Metric for Default Gateway in Windows 11

the site yes 20 Reputation points
2025-07-02T12:26:40.1666667+00:00

Why is Windows 11 unable to set the metric for the default gateway for IP 172.16.16.1?

In Windows 10, setting the metric for 172.16.16.1 works fine. Additionally, setting the metric for IPs 192.168.x.x, 172.16.10.10, and 172.16.16.2 is successful in Windows 11. However, when attempting to set the metric for 172.16.16.1 in Windows 11, it reverts back to "AUTO."

What could be causing this issue, and how can it be resolved?

Windows for home | Windows 11 | Settings
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Trinh 485 Reputation points Microsoft External Staff Moderator
    2025-07-02T15:18:33.7566667+00:00

    Hello, the site yes

    Thank you for your feedback. The situation you encountered—where the settings automatically revert to “Automatic”—strongly indicates that some underlying system or service in Windows 11 is overriding your manual settings. Here are some troubleshooting solutions:

    Method 1: Use PowerShell to set the routing hop count

    This method directly modifies the hop count for a specific route rather than the entire interface. This is the most precise control method.

    Open PowerShell as an administrator:

    Click the “Start” button and type “PowerShell.”

    Right-click on “Windows PowerShell” and select “Run as administrator.”

    Locate your network interface information:

    Run the following command to view your network interface list, and note the ifIndex (interface index number) of the target interface.

    Get-NetIPInterface
    

    You will see output similar to the following. Locate the interface associated with 172.16.16.1 (e.g., the interface named “Ethernet”) and note its ifIndex value.

    Directly modify the default route's hop count:

    Now, use the Set-NetRoute command to set the hop count for the gateway you want. For example, if you want to set the hop count for the default route via 172.16.16.1 (destination address 0.0.0.0/0) to 10.

     

    Set-NetRoute -NextHop 172.16.16.1 -DestinationPrefix 0.0.0.0/0 -RouteMetric 10
    

    -NextHop 172.16.16.1: Specifies the gateway you want to modify.

    -DestinationPrefix 0.0.0.0/0: This represents the “default route” (i.e., all traffic).

    -RouteMetric 10: Sets the desired hop count value.

    Verify the changes:

    Run the following command to view the current routing table and confirm that the changes have taken effect.

    powershell

    Get-NetRoute -NextHop 172.16.16.1

    Or use the classic command:

    route print

    In the output, locate the line with a destination of 0.0.0.0 and a gateway of 172.16.16.1, and verify that the Metric value has been updated to 10.

     

    Method 2: Set the interface hop count using PowerShell (alternative method)

    If your goal is to make the entire network adapter (e.g., your wired network card) more prioritized than other adapters (e.g., Wi-Fi or VPN), you can set the interface hop count instead of the gateway hop count. This is a broader but equally effective control method.

     

    Open PowerShell as an administrator and use Get-NetIPInterface to find your ifIndex (as described in Method 1).

    Disable automatic hop count and set a manual value:

    Assuming your interface ifIndex is 15, you want to give it a very low hop count (e.g., 5) to increase its priority.

    Set-NetIPInterface -InterfaceIndex 15 -InterfaceMetric 5
    

    This command forces the baseline cost for the interface to 5. Even if the gateway hop count is automatic, this low baseline value is typically sufficient to ensure that traffic on this interface is prioritized.

     

    I look forward to your feedback.


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.