The Broadband Guide
SG
search advanced
 search
FAQs Categories:

How to tell Windows to use a different default network card ?

In the presence of multiple network adapters, it is sometimes necessary to manually specify which one is the default used for internet routing, for example. To accomplish this, you have to manually add a "metric" to each interface. Windows will automatically use the interface with a lower metric. To check and change your network adapters' metric:

1. Open Command Prompt and type: route print - you will see a list of active routes, the last column displaying their "metric". Lower metric routes are preferred over higher ones.

2. Open the Network Adapter Properties (Control Panel > Network and Internet > Network Connections > right-click on adapter and choose Properties)
3. Open the properties of Internet Protocol Version 4 (TCP/IPv4).
4. Click on Advanced.
5. Untick "Automatic Metric" and set the interface metric to a number.
6. Hit OK until you close the Network Adapter properties.
7. Repeat steps 2-6 for your other network adapter(s) choosing different metrics. Remember lower metrics are preferred over higher ones.


Under Windows 8/10, it is also possible to use Powershell Cmdlets to set NICs priority:

1. Open PowerShell and type: Get-NetIpInterface
Note the first column, the "ifIndex", or interface index, the column "InterfaceAlias", and the column labeled "InterfaceMetric" of each device. Ignore the Loopback pseudo interface lines.

2. Set the metric. On the appropriate network adapter, with the proper "InterfaceIndex" you want to change (let's say "11"), set the "InterfaceMetric", for example:
Set-NetIPInterface -InterfaceIndex 11 -InterfaceMetric 22

It is also possible to use the name of the interface ("InterfaceAlias") rather than the interface index to set the metric:
Set-NetIPInterface -InterfaceAlias "Ethernet 4" -InterfaceMetric 22



Notes:
Lower metric routes are preferred over higher ones.
Metrics can be checked in Command Prompt by typing: route print


  User Reviews/Comments:
    rate:
   avg:
by anonymous - 2015-03-05 08:47
This was extremly helpful. Thx
by anonymous - 2015-03-10 12:00
thx thx thx !! I loosed 3 hours to understand why my Windows tried to reach Internet by another Ethernet card (which is dedicated to a Linux VM in bridge mode, so why it didn't work). This should be mentioned by Microsoft in their support website...
by anonymous - 2015-05-03 08:08
Awesome !!! Thanks for putting that info out there for us.
by Philip - 2015-05-03 21:46
Glad to hear the information is useful :) Thanks for the positive feedback.
by Baikunth - 2015-05-29 09:44
Thank you so much. My IT Support Team couldn't figure this out for hours!
by Cassio - 2015-10-07 12:30
Tks, the only way that I found in the Internet.
by anonymous - 2015-12-15 15:46
DHCP and static IP addresses will give different calculated metric values even if you set the metric value. I am not sure which is selected the calculated metric value or set metric value. So far this is working.
by anonymous - 2015-12-27 04:15
Brilliant thanks so much.
by anonymous - 2015-12-30 06:51
Köszönöm a segítséget!

Bár a cmd parancs win10 alatt nem mutatja megfelelően a metric értéket, de a sorrend megoldotta a problémákat...

Good Job! Thank You!
by anonymous - 2016-01-25 04:20
Great advice on Metric setting. Solved my dual LAN card problem instantly. Many thanks!
by anonymous - 2016-01-25 20:09
I worked around this challenge by assigning a 172.16.10.0/24 network to the router attached to the internet adapter and 192.168.1.0/24 to the internet router.

I also made sure to assign a static 172 address to the computer with both interfaces and remove the default route: i.e. I left it without a default gateway.

Hope this helps!
by anonymous - 2016-03-24 14:49
How do you do this in VB.Net?
by Nicky - 2016-04-12 13:41
Nothing beats understanding the question.
Add my thanks to the list
by anonymous - 2017-03-14 09:44
Many thanx!
by Tom_S - 2017-03-27 09:26
Ace! thanks!
by Xumari - 2017-05-12 13:49
You saved my day!!! Thank you!
(tears of joy)
by Ali Afifi - 2017-08-11 06:06
HOW ON EARTH DID YOU KNOW THIS ??? YOU'RE SUCH A GEEEEEK
oh my god .. I've been looking for this for a whole freaking day !!!
SPOT ONNNNNNNNN and THANKS LOADS
by Mohsin Ali - 2017-11-15 00:48
My company's emails accounts used by pop in Outlook. I want outlook use Internet Explorer or degault web browser proxy settings instead of LAN Gateway.

Please help

Regards
Mohsin

mohsinak2006@yahoo.com
by Rod - 2018-02-22 12:31
Great! Very useful and works for Windows 10 too.
I'm using this to run several VMs on my laptop using WMWARE and different NICs, but still, using only one NIC to send all my own traffic to Internet.
by Azlan Wasti - 2018-07-15 10:04
Thank you .. .I followed what you wrote and it Worked people ..

Finally after 7 months i found that thing what i was looking for ..

THANK YOU SOOOOO SOOOOOO SOOOOOOOO MUCH....
by anonymous - 2021-02-01 19:39
If a network adaptor had metrics set to blank (unchecked without a number), would this adaptor have priority over all other adaptors having a metric specific metric greater than 1?
by Philip - 2021-02-07 12:38
Not necessarily, and depending on your Operating System I suppose. In Windows 10, metric of "1" is usually assigned to the Loopback "pseudo-interface", next in line are Ethernet adapters with higher numbers, and last are Wireless and Bluetooth adapters.
by MWPollard - 2021-10-07 14:56
Unfortunately, VPN connections seem to reset the interface metric each time they connect if it's set by PowerShell.

I connect the VPN, then I set it to 10:
Set-NetIPInterface -InterfaceAlias "My-VPN" -InterfaceMetric "10"

I verify with Get-NetIPInterface:
ifIndex InterfaceAlias AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp ConnectionState PolicyStore
35 My-VPN IPv4 1400 10 Disabled Connected ActiveStore

I disconnect and reconnect the VPN, and check again with Get-NetIPInterface:
ifIndex InterfaceAlias AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp ConnectionState PolicyStore
35 My-VPN IPv4 1400 25 Disabled Connected ActiveStore

Setting the metric via the GUI seems to keep working, but I need to handle this programmatically. My users aren't going to want to run a script after they connect each time. Any suggestions? Is there a registry key I can set for the same setting to be persistent?

BTW, using InterfaceAlias works just as well as the ifIndex, and it doesn't require that you know the index that can vary between computers. With a VPN, I set exactly what it will be called, so that's easier for me to use.
by anonymous - 2022-03-18 04:38
awesome, thx
by mlg4035 - 2023-08-29 22:22
This solved my problem, simply and precisely!
Thank you so much!
News Glossary of Terms FAQs Polls Cool Links SpeedGuide Teams SG Premium Services SG Gear Store
Registry Tweaks Broadband Tools Downloads/Patches Broadband Hardware SG Ports Database Security Default Passwords User Stories
Broadband Routers Wireless Firewalls / VPNs Software Hardware User Reviews
Broadband Security Editorials General User Articles Quick Reference
Broadband Forums General Discussions
Advertising Awards Link to us Server Statistics Helping SG About