I need to flush and then add this default route back to the Windows routing table:

Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric     25

I can't quite do it. First I do route -f, then I try

route add mask gateway interface metric 25

but I just get a message saying

route: bad argument

Does anyone know the correct route add command to add back this route?




according to

C:\>route /?

Manipulates network routing tables.

ROUTE [-f] [-p] [-4|-6] command [destination]
                  [MASK netmask]  [gateway] [METRIC metric]  [IF interface]

  command      One of these:
                 PRINT     Prints  a route
                 ADD       Adds    a route
                 DELETE    Deletes a route
                 CHANGE    Modifies an existing route
  destination  Specifies the host.
  MASK         Specifies that the next parameter is the 'netmask' value.
  netmask      Specifies a subnet mask value for this route entry.
               If not specified, it defaults to
  gateway      Specifies gateway.
  interface    the interface number for the specified route.
  METRIC       specifies the metric, ie. cost for the destination.

Note that "gateway" means an IP-address not literal text.

The above is from Vista, Your Mileage May Vary.

  • The route addition failed: The system cannot find the file specified. – starcaaa Dec 30 '11 at 17:01
  • 1
    @starcaaa: Sorry, the IF parameter is an interface number (not it's IP-address) – RedGrittyBrick Dec 30 '11 at 17:11

Please open the Command Prompt as an administrator then type:

route add mask IF 18 -p

Try this:

route add mask gateway <Wlan Default Gateway> interface <Wlan Address> metric 1

route add mask gateway interface metric 10

Replace <Wlan Default Gateway> and <Wlan Address> with the relevant addresses.


Cause: my PC connect 2 physical LAN cable with 2 different network. and my PC always route to network that connected to internet

target IP: 
target gateway:

Solution: add route to your PC

  1. press win+X
  2. select Window PowerShell (Admin)
  3. run this command


  4. OK!

Works for me

  • 1
    What does this add to the answer that was given 7 years ago? – Scott Dec 28 '18 at 5:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.