How to Set a Lower Metric for Manually Added Routes in Windows to Prioritize Traffic


1 views

When working with network routing in Windows, you might encounter situations where you need to manually add a route with a specific metric to control traffic prioritization. The metric determines the cost of using a particular route, with lower metrics being preferred over higher ones.

In your case, you're trying to add a default route (0.0.0.0 with mask 0.0.0.0) via gateway 192.168.76.2 with a metric of 3, but Windows seems to be ignoring your specified metric and assigning a higher value (23) instead.

The command you're using:

route ADD 0.0.0.0 MASK 0.0.0.0 192.168.76.2 METRIC 3 IF 11

The issue here is that Windows automatically calculates metrics based on interface speed when you don't specify one, and even when you do specify a metric, it might combine it with other factors. The automatic metric feature can override your manual settings.

To truly force your desired metric, you need to:

1. First delete any existing default routes:

route DELETE 0.0.0.0

2. Then add your new route with the persistent (-p) flag and your desired metric:

route ADD -p 0.0.0.0 MASK 0.0.0.0 192.168.76.2 METRIC 3 IF 11

3. Disable automatic metric calculation for the interface:

netsh interface ipv4 set interface 11 metric=3

After making these changes, check your routing table:

route print

You should now see your route with the correct metric:

Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     192.168.76.2    192.168.76.40     3

For more precise control, you can use PowerShell:

# Remove existing default routes
Get-NetRoute -DestinationPrefix "0.0.0.0/0" | Remove-NetRoute -Confirm:$false

# Add new route with forced metric
New-NetRoute -DestinationPrefix "0.0.0.0/0" -NextHop 192.168.76.2 -InterfaceIndex 11 -RouteMetric 3 -PolicyStore ActiveStore

# Disable automatic metric
Set-NetIPInterface -InterfaceIndex 11 -AutomaticMetric Disabled -InterfaceMetric 3

If you're still having issues:
- Make sure you're running commands as Administrator
- Check that the interface index (11 in your case) is correct
- Verify that the gateway (192.168.76.2) is reachable
- Consider rebooting after making changes to ensure they stick

Remember that lower metrics always take precedence, so your new route with metric 3 should now be preferred over any other default routes with higher metrics.


When working with Windows routing tables, you might encounter situations where manually added routes don't get the priority you expect, even when specifying a lower metric. Let's examine this common scenario where a default route needs precedence:

route ADD 0.0.0.0 MASK 0.0.0.0 192.168.76.2 METRIC 3 IF 11

Despite specifying METRIC 3, the system still shows the original default route (metric 20) as active while the new route appears with metric 23 - not the value we specified.

Windows doesn't use the metric value you provide directly. Instead, it combines several factors:

  • Interface metric (automatic or manual)
  • Route metric (what you specify)
  • Network connection type (wired vs wireless)

The actual metric displayed in route print is the sum of these components.

To ensure your manually added route gets priority, you need to modify both the route metric and the underlying interface metric:

netsh interface ipv4 set interface 11 metric=1
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.76.2 METRIC 1 IF 11

This approach gives you better control over the final metric calculation.

To make these changes survive reboots:

route -p ADD 0.0.0.0 MASK 0.0.0.0 192.168.76.2 METRIC 1 IF 11
netsh -c interface dump > C:\persistent_routes.txt

You can create a startup script to reapply these settings automatically.

After making changes, verify with:

route print
netsh interface ipv4 show interfaces

Key things to check:

  • The sum of interface metric and route metric
  • Interface index consistency
  • Gateway reachability

For Windows 10/Server 2016 and later, you can use:

route ADD 0.0.0.0 MASK 0.0.0.0 192.168.76.2 METRIC 1 IF 11 -policy

The -policy flag helps enforce route priority in some scenarios.

Remember that route selection isn't based solely on metric - Windows also considers interface speed, connection type, and other factors in its route selection algorithm.