I have a host with two NICs, both have internet access but I'm trying to manually set preference of a specific NIC.
My interface metrics:
PS C:\Users\Administrator\Desktop> Get-NetIPInterface -ConnectionState Connected -InterfaceAlias "Ethernet*" | Format-Table;
ifIndex InterfaceAlias AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp ConnectionState PolicyStore
------- -------------- ------------- ------------ --------------- ---- --------------- -----------
10 Ethernet 5 IPv4 1500 1 Disabled Connected ActiveStore
3 Ethernet 2 IPv4 1500 1 Enabled Connected ActiveStore
NetRoute:
PS C:\Users\Administrator\Desktop> Get-NetRoute -DestinationPrefix "0.0.0.0/0" | Format-Table;
ifIndex DestinationPrefix NextHop RouteMetric PolicyStore
------- ----------------- ------- ----------- -----------
10 0.0.0.0/0 10.0.20.1 2 ActiveStore
3 0.0.0.0/0 172.25.1.1 10 ActiveStore
route print (which seems to be NetIPInterface metric + NetRoute metric):
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 172.25.1.1 172.25.1.89 11
0.0.0.0 0.0.0.0 10.0.20.1 10.0.23.243 3
but then:
PS C:\Users\Administrator\Desktop> (Find-NetRoute -remoteIpAddress 8.8.8.8)[1]
ifIndex DestinationPrefix NextHop RouteMetric PolicyStore
------- ----------------- ------- ----------- -----------
3 0.0.0.0/0 172.25.1.1 10 ActiveStore
the route with gw "10.0.20.1" has a lower metric, why isn't this the next hop? I DONT have a more specific route for "8.8.8.8".
I've tried this:
netsh interface ip delete destinationcache
.
but nothing changed.