5

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

Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
      0.0.0.0          0.0.0.0      192.168.1.1      192.168.1.3     25

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

route add 0.0.0.0 mask 0.0.0.0 gateway 192.168.1.3 interface 192.168.1.1 metric 25

but I just get a message saying

route: bad argument 192.168.1.3.

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

8

(edited)

ROUTE ADD 0.0.0.0  MASK 0.0.0.0  192.168.1.3  METRIC 25  

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 255.255.255.255.
  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.

2
  • 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
2

Please open the Command Prompt as an administrator then type:

route add 192.168.89.0 mask 255.255.255.0 0.0.0.0 IF 18 -p
1

Try this:

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

route add 192.168.1.3 mask 255.255.255.255 gateway 127.0.0.1 interface 127.0.0.1 metric 10

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

0

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: 192.168.81.65 
target gateway: 192.168.72.254

Solution: add route to your PC

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

    ROUTE ADD 192.168.81.0 MASK 255.255.255.0 192.168.72.254 METRIC 25

  4. OK!

Works for me

1
  • 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.