DOS route command and metrics to make a network card the primary one

Posted on 2012-09-14
Last Modified: 2012-09-30
Hi, my computer has two network cards on two different networks, and I want to be able to switch between which card I access the internet through.  I can do it by adjusting the metric value on the network card(s) via Windows 7, but I rather do it by DOS and the 'route' command.  Can anybody help me?

Windows way:

DOS way: ?????? Please provide Solution.

>The LAN1 card adapter address is:; Metric is 20
>The other adapter card (LAN2) has a metric of 10
>The Network Destination & Netmask for both cards is:
> Both cards have gateways.

I would like to know how I can make LAN1 the primary card, and then back to the backup one via the DOS route command?
Question by:Hope4U
    LVL 77

    Accepted Solution

    Metrics do not work as they should in Windows operating systems.  You can only have one default gateway.  If you try using 2 it will fail over the the higher metric, but it will never switch back.

    Using a dos command, rather than changing routes you might be better to change the NIC setting since it will retain the default gateway. Assuming the other router/gateway is, t do so use the following command:

    netsh interface ip set address name = "Local Area Connection" gateway = gwmetric = 1

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
    If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now